diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2022-01-12 22:50:06 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2022-01-12 22:51:25 +0000 |
commit | 1544e0f5d1f1e3b8c10a64cb899a936976ca7ea4 (patch) | |
tree | 29c858abdd45d79936041979ac21fd5bacca8b4d /sys/tools | |
parent | 896a0153190937e071a31c682c6cf55e4c599886 (diff) | |
download | src-1544e0f5d1f1e3b8c10a64cb899a936976ca7ea4.tar.gz src-1544e0f5d1f1e3b8c10a64cb899a936976ca7ea4.zip |
syscallarg_t: Add a type for system call arguments
This more clearly differentiates system call arguments from integer
registers and return values. On current architectures it has no effect,
but on architectures where pointers are not integers (CHERI) and may
not even share registers (CHERI-MIPS) it is necessiary to differentiate
between system call arguments (syscallarg_t) and integer register values
(register_t).
Obtained from: CheriBSD
Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D33780
Diffstat (limited to 'sys/tools')
-rw-r--r-- | sys/tools/makesyscalls.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua index 178869d03b0e..ec79ae30d130 100644 --- a/sys/tools/makesyscalls.lua +++ b/sys/tools/makesyscalls.lua @@ -860,7 +860,7 @@ local function handle_noncompat(sysnum, thr_flag, flags, sysflags, rettype, 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 @@ local function handle_compat(sysnum, thr_flag, flags, sysflags, rettype, 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 proc; 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 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) 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 |