Linus Torvalds writes: (Summary)
More realistically, I was thinking we'd just use a separate table or
system calls, and generate different versions.
system calls, and generate different versions.
In fact, you can see exactly that in my WIP branch, except it uses the wrong name.
wrong name.
So see the "WIP-syscall" branch in my normal git kernel repo, and in particular the patch to <linux/syscalls.h>, which generates "sys_x64##name" and "sys_i86##name()" inline functions that do that mapping correcty for native x86-64, and for the (misnamed) x32 cases. So there are three different cases:
So there are three different cases:
- native: sys_x64_name() generated by SYSCALL_DEFINEx() - native: sys_x64_name() generated by SYSCALL_DEFINEx() - compat -bit: compat_sys_i86_name() generated by COMPAT_SYSCALL_DEFINEx() - compat -bit: compat_sys_i86_name() generated by COMPAT_SYSCALL_DEFINEx() - x32: sys_i86_name() generated by SYSCALL_DEFINEx().
system calls, and generate different versions.
In fact, you can see exactly that in my WIP branch, except it uses the wrong name.
wrong name.
So see the "WIP-syscall" branch in my normal git kernel repo, and in particular the patch to <linux/syscalls.h>, which generates "sys_x64##name" and "sys_i86##name()" inline functions that do that mapping correcty for native x86-64, and for the (misnamed) x32 cases. So there are three different cases:
So there are three different cases:
- native: sys_x64_name() generated by SYSCALL_DEFINEx() - native: sys_x64_name() generated by SYSCALL_DEFINEx() - compat -bit: compat_sys_i86_name() generated by COMPAT_SYSCALL_DEFINEx() - compat -bit: compat_sys_i86_name() generated by COMPAT_SYSCALL_DEFINEx() - x32: sys_i86_name() generated by SYSCALL_DEFINEx().