syscall_32.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0
  2. /* System call table for i386. */
  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. #ifdef CONFIG_IA32_EMULATION
  9. #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat)
  10. #else
  11. #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
  12. #endif
  13. #define __SYSCALL(nr, sym) extern long __ia32_##sym(const struct pt_regs *);
  14. #define __SYSCALL_NORETURN(nr, sym) extern long __noreturn __ia32_##sym(const struct pt_regs *);
  15. #include <asm/syscalls_32.h>
  16. #undef __SYSCALL
  17. #undef __SYSCALL_NORETURN
  18. #define __SYSCALL_NORETURN __SYSCALL
  19. /*
  20. * The sys_call_table[] is no longer used for system calls, but
  21. * kernel/trace/trace_syscalls.c still wants to know the system
  22. * call address.
  23. */
  24. #ifdef CONFIG_X86_32
  25. #define __SYSCALL(nr, sym) __ia32_##sym,
  26. const sys_call_ptr_t sys_call_table[] = {
  27. #include <asm/syscalls_32.h>
  28. };
  29. #undef __SYSCALL
  30. #endif
  31. #define __SYSCALL(nr, sym) case nr: return __ia32_##sym(regs);
  32. long ia32_sys_call(const struct pt_regs *regs, unsigned int nr)
  33. {
  34. switch (nr) {
  35. #include <asm/syscalls_32.h>
  36. default: return __ia32_sys_ni_syscall(regs);
  37. }
  38. };