Index: sys/arm64/arm64/trap.c =================================================================== --- sys/arm64/arm64/trap.c +++ sys/arm64/arm64/trap.c @@ -134,7 +134,7 @@ cpu_fetch_syscall_args(struct thread *td) { struct proc *p; - register_t *ap, *dst_ap; + syscallarg_t *ap, *dst_ap; struct syscall_args *sa; p = td->td_proc; @@ -159,7 +159,7 @@ KASSERT(sa->callp->sy_narg <= nitems(sa->args), ("Syscall %d takes too many arguments", sa->code)); - memcpy(dst_ap, ap, (nitems(sa->args) - 1) * sizeof(register_t)); + memcpy(dst_ap, ap, (nitems(sa->args) - 1) * sizeof(*dst_ap)); td->td_retval[0] = 0; td->td_retval[1] = 0; Index: sys/kern/kern_ktrace.c =================================================================== --- sys/kern/kern_ktrace.c +++ sys/kern/kern_ktrace.c @@ -524,7 +524,7 @@ } void -ktrsyscall(int code, int narg, register_t args[]) +ktrsyscall(int code, int narg, syscallarg_t args[]) { struct ktr_request *req; struct ktr_syscall *ktp; Index: sys/kern/sys_process.c =================================================================== --- sys/kern/sys_process.c +++ sys/kern/sys_process.c @@ -474,7 +474,7 @@ struct dbreg dbreg; struct fpreg fpreg; struct reg reg; - char args[sizeof(td->td_sa.args)]; + syscallarg_t args[nitems(td->td_sa.args)]; struct ptrace_sc_ret psr; int ptevents; } r; @@ -1010,7 +1010,7 @@ /* See the explanation in linux_ptrace_get_syscall_info(). */ bcopy(td2->td_sa.args, addr, SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX ? sizeof(td2->td_sa.args) : - td2->td_sa.callp->sy_narg * sizeof(register_t)); + td2->td_sa.callp->sy_narg * sizeof(syscallarg_t)); break; case PT_GET_SC_RET: Index: sys/riscv/riscv/trap.c =================================================================== --- sys/riscv/riscv/trap.c +++ sys/riscv/riscv/trap.c @@ -94,7 +94,7 @@ cpu_fetch_syscall_args(struct thread *td) { struct proc *p; - register_t *ap, *dst_ap; + syscallarg_t *ap, *dst_ap; struct syscall_args *sa; p = td->td_proc; @@ -119,7 +119,7 @@ KASSERT(sa->callp->sy_narg <= nitems(sa->args), ("Syscall %d takes too many arguments", sa->code)); - memcpy(dst_ap, ap, (NARGREG - 1) * sizeof(register_t)); + memcpy(dst_ap, ap, (NARGREG - 1) * sizeof(*dst_ap)); td->td_retval[0] = 0; td->td_retval[1] = 0; Index: sys/sys/ktrace.h =================================================================== --- sys/sys/ktrace.h +++ sys/sys/ktrace.h @@ -284,7 +284,7 @@ void ktrfault(vm_offset_t, int); void ktrfaultend(int); void ktrgenio(int, enum uio_rw, struct uio *, int); -void ktrsyscall(int, int narg, register_t args[]); +void ktrsyscall(int, int narg, syscallarg_t args[]); void ktrsysctl(int *name, u_int namelen); void ktrsysret(int, int, register_t); void ktrprocctor(struct proc *); Index: sys/sys/proc.h =================================================================== --- sys/sys/proc.h +++ sys/sys/proc.h @@ -357,7 +357,7 @@ } td_state; /* (t) thread state */ /* Note: td_state must be accessed using TD_{GET,SET}_STATE(). */ union { - register_t tdu_retval[2]; + syscallarg_t tdu_retval[2]; off_t tdu_off; } td_uretoff; /* (k) Syscall aux returns. */ #define td_retval td_uretoff.tdu_retval Index: sys/sys/ptrace.h =================================================================== --- sys/sys/ptrace.h +++ sys/sys/ptrace.h @@ -160,7 +160,7 @@ /* Argument structure for PT_GET_SC_RET. */ struct ptrace_sc_ret { - register_t sr_retval[2]; /* Only valid if sr_error == 0. */ + syscallarg_t sr_retval[2]; /* Only valid if sr_error == 0. */ int sr_error; }; Index: sys/sys/types.h =================================================================== --- sys/sys/types.h +++ sys/sys/types.h @@ -270,6 +270,8 @@ typedef __rman_res_t rman_res_t; +typedef __register_t syscallarg_t; + #ifdef _KERNEL typedef int boolean_t; typedef struct _device *device_t; Index: sys/tools/makesyscalls.lua =================================================================== --- sys/tools/makesyscalls.lua +++ sys/tools/makesyscalls.lua @@ -860,7 +860,7 @@ write_line("sysarg", "};\n") else write_line("sysarg", string.format( - "struct %s {\n\tregister_t dummy;\n};\n", argalias)) + "struct %s {\n\tsyscallarg_t dummy;\n};\n", argalias)) end end @@ -986,7 +986,7 @@ write_line(out, "};\n") elseif flags & nargflags == 0 then write_line("sysarg", string.format( - "struct %s {\n\tregister_t dummy;\n};\n", argalias)) + "struct %s {\n\tsyscallarg_t dummy;\n};\n", argalias)) end if flags & dprotoflags == 0 then write_line(outdcl, string.format( @@ -1439,8 +1439,8 @@ struct thread; -#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ - 0 : sizeof(register_t) - sizeof(t)) +#define PAD_(t) (sizeof(syscallarg_t) <= sizeof(t) ? \ + 0 : sizeof(syscallarg_t) - sizeof(t)) #if BYTE_ORDER == LITTLE_ENDIAN #define PADL_(t) 0 @@ -1530,7 +1530,7 @@ process_sysfile(sysfile) write_line("sysinc", - "\n#define AS(name) (sizeof(struct name) / sizeof(register_t))\n") + "\n#define AS(name) (sizeof(struct name) / sizeof(syscallarg_t))\n") for _, v in pairs(compat_options) do if v["count"] > 0 then Index: sys/vm/vm_mmap.c =================================================================== --- sys/vm/vm_mmap.c +++ sys/vm/vm_mmap.c @@ -420,7 +420,7 @@ } if (error == 0) - td->td_retval[0] = (register_t) (addr + pageoff); + td->td_retval[0] = (syscallarg_t)(addr + pageoff); done: if (fp) fdrop(fp, td); Index: usr.bin/truss/syscall.h =================================================================== --- usr.bin/truss/syscall.h +++ usr.bin/truss/syscall.h @@ -227,7 +227,7 @@ }; struct syscall *get_syscall(struct threadinfo *, u_int, u_int); -char *print_arg(struct syscall_arg *, unsigned long *, register_t *, +char *print_arg(struct syscall_arg *, unsigned long *, syscallarg_t *, struct trussinfo *); /* @@ -251,8 +251,8 @@ #define LINUX_SENDMSG 16 #define LINUX_RECVMSG 17 -#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ - 0 : sizeof(register_t) - sizeof(t)) +#define PAD_(t) (sizeof(syscallarg_t) <= sizeof(t) ? \ + 0 : sizeof(syscallarg_t) - sizeof(t)) #if BYTE_ORDER == LITTLE_ENDIAN #define PADL_(t) 0 @@ -271,5 +271,5 @@ }; void print_syscall(struct trussinfo *); -void print_syscall_ret(struct trussinfo *, int, register_t *); +void print_syscall_ret(struct trussinfo *, int, syscallarg_t *); void print_summary(struct trussinfo *trussinfo); Index: usr.bin/truss/syscalls.c =================================================================== --- usr.bin/truss/syscalls.c +++ usr.bin/truss/syscalls.c @@ -1556,7 +1556,7 @@ * an array of all of the system call arguments. */ char * -print_arg(struct syscall_arg *sc, unsigned long *args, register_t *retval, +print_arg(struct syscall_arg *sc, unsigned long *args, syscallarg_t *retval, struct trussinfo *trussinfo) { FILE *fp; @@ -2731,7 +2731,7 @@ } void -print_syscall_ret(struct trussinfo *trussinfo, int error, register_t *retval) +print_syscall_ret(struct trussinfo *trussinfo, int error, syscallarg_t *retval) { struct timespec timediff; struct threadinfo *t; Index: usr.bin/truss/truss.h =================================================================== --- usr.bin/truss/truss.h +++ usr.bin/truss/truss.h @@ -81,7 +81,7 @@ struct syscall *sc; unsigned int number; unsigned int nargs; - unsigned long args[10]; + syscallarg_t args[10]; char *s_args[10]; /* the printable arguments */ };