syscall_x32.c 713 B

12345678910111213141516171819202122232425
  1. // SPDX-License-Identifier: GPL-2.0
  2. /* System call table for x32 ABI. */
  3. #include <linux/linkage.h>
  4. #include <linux/sys.h>
  5. #include <linux/cache.h>
  6. #include <linux/syscalls.h>
  7. #include <asm/syscall.h>
  8. #define __SYSCALL(nr, sym) extern long __x64_##sym(const struct pt_regs *);
  9. #define __SYSCALL_NORETURN(nr, sym) extern long __noreturn __x64_##sym(const struct pt_regs *);
  10. #include <asm/syscalls_x32.h>
  11. #undef __SYSCALL
  12. #undef __SYSCALL_NORETURN
  13. #define __SYSCALL_NORETURN __SYSCALL
  14. #define __SYSCALL(nr, sym) case nr: return __x64_##sym(regs);
  15. long x32_sys_call(const struct pt_regs *regs, unsigned int nr)
  16. {
  17. switch (nr) {
  18. #include <asm/syscalls_x32.h>
  19. default: return __x64_sys_ni_syscall(regs);
  20. }
  21. };