systbl.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * This file contains the table of syscall-handling functions.
  4. * Copyright (C) 1995-1996 Gary Thomas ([email protected])
  5. *
  6. * Largely rewritten by Cort Dougan ([email protected])
  7. * and Paul Mackerras.
  8. *
  9. * Adapted for iSeries by Mike Corrigan ([email protected])
  10. * PPC64 updates by Dave Engebretsen ([email protected])
  11. */
  12. #include <linux/syscalls.h>
  13. #include <linux/compat.h>
  14. #include <asm/unistd.h>
  15. #include <asm/syscalls.h>
  16. #undef __SYSCALL_WITH_COMPAT
  17. #define __SYSCALL_WITH_COMPAT(nr, entry, compat) __SYSCALL(nr, entry)
  18. #undef __SYSCALL
  19. #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
  20. #define __SYSCALL(nr, entry) [nr] = entry,
  21. #else
  22. /*
  23. * Coerce syscall handlers with arbitrary parameters to common type
  24. * requires cast to void* to avoid -Wcast-function-type.
  25. */
  26. #define __SYSCALL(nr, entry) [nr] = (void *) entry,
  27. #endif
  28. const syscall_fn sys_call_table[] = {
  29. #ifdef CONFIG_PPC64
  30. #include <asm/syscall_table_64.h>
  31. #else
  32. #include <asm/syscall_table_32.h>
  33. #endif
  34. };
  35. #ifdef CONFIG_COMPAT
  36. #undef __SYSCALL_WITH_COMPAT
  37. #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat)
  38. const syscall_fn compat_sys_call_table[] = {
  39. #include <asm/syscall_table_32.h>
  40. };
  41. #endif /* CONFIG_COMPAT */