HomeFreeBSD

makesyscalls: handle 64-bit args on 32-bit

Description

makesyscalls: handle 64-bit args on 32-bit

On 32-bit architectures, 64-bit arguments are passed in pairs of
registers. On non-x86 architectures these arguments must be in evenly
aligned registers which necessiciates inserting a pad register into the
argument list. This has historically been supported by adding ifdefs
around padded and unpadded syscall defintions in syscalls.master.

In order to enable generation of 32-bit support files from the base
syscalls.master, pull this support in to makesyscalls.lua enabled by
adding pair_64bit to abi_flags.

The changes to sys_proto.h simply add #ifdef PAD64_REQUIRED
around pad arguments in struct <syscall>_args. In systrace_args(),
replace static syscall index values with post-incremented indexs
allowing a simple ifdef around the argument. Under -O1 or higher
code generation is identical. systrace_entry_setargdesc() is a bit
more complicated as we switch on argument indices. Solve this
with some use of define/undef pairs to compute the correct indices.

Reviewed by: kevans

Details

Provenance
brooksAuthored on Nov 22 2021, 10:36 PM
Parents
rG79634eb90bff: makesyscalls: handle arrays of pointers
Branches
Unknown
Tags
Unknown