xref: /linux/arch/powerpc/kernel/systbl.c (revision e80a48bade619ec5a92230b3d4ae84bfc2746822)
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 (gdt@linuxppc.org)
5  *
6  * Largely rewritten by Cort Dougan (cort@cs.nmt.edu)
7  * and Paul Mackerras.
8  *
9  * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
10  * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
11  */
12 
13 #include <linux/syscalls.h>
14 #include <linux/compat.h>
15 #include <asm/unistd.h>
16 #include <asm/syscalls.h>
17 
18 #undef __SYSCALL_WITH_COMPAT
19 #define __SYSCALL_WITH_COMPAT(nr, entry, compat) __SYSCALL(nr, entry)
20 
21 #undef __SYSCALL
22 #ifdef CONFIG_ARCH_HAS_SYSCALL_WRAPPER
23 #define __SYSCALL(nr, entry) [nr] = entry,
24 #else
25 /*
26  * Coerce syscall handlers with arbitrary parameters to common type
27  * requires cast to void* to avoid -Wcast-function-type.
28  */
29 #define __SYSCALL(nr, entry) [nr] = (void *) entry,
30 #endif
31 
32 const syscall_fn sys_call_table[] = {
33 #ifdef CONFIG_PPC64
34 #include <asm/syscall_table_64.h>
35 #else
36 #include <asm/syscall_table_32.h>
37 #endif
38 };
39 
40 #ifdef CONFIG_COMPAT
41 #undef __SYSCALL_WITH_COMPAT
42 #define __SYSCALL_WITH_COMPAT(nr, native, compat)	__SYSCALL(nr, compat)
43 const syscall_fn compat_sys_call_table[] = {
44 #include <asm/syscall_table_32.h>
45 };
46 #endif /* CONFIG_COMPAT */
47