blob: 1594ec72bcbb7183512f087acd29160443802683 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001// SPDX-License-Identifier: GPL-2.0
2/* System call table for x86-64. */
3
4#include <linux/linkage.h>
5#include <linux/sys.h>
6#include <linux/cache.h>
Olivier Deprez0e641232021-09-23 10:07:05 +02007#include <linux/syscalls.h>
Olivier Deprez157378f2022-04-04 15:47:50 +02008#include <asm/unistd.h>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00009#include <asm/syscall.h>
10
Olivier Deprez157378f2022-04-04 15:47:50 +020011#define __SYSCALL_X32(nr, sym)
12#define __SYSCALL_COMMON(nr, sym) __SYSCALL_64(nr, sym)
Olivier Deprez0e641232021-09-23 10:07:05 +020013
Olivier Deprez157378f2022-04-04 15:47:50 +020014#define __SYSCALL_64(nr, sym) extern long __x64_##sym(const struct pt_regs *);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000015#include <asm/syscalls_64.h>
16#undef __SYSCALL_64
17
Olivier Deprez157378f2022-04-04 15:47:50 +020018#define __SYSCALL_64(nr, sym) [nr] = __x64_##sym,
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000019
20asmlinkage const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
21 /*
22 * Smells like a compiler bug -- it doesn't work
23 * when the & below is removed.
24 */
Olivier Deprez0e641232021-09-23 10:07:05 +020025 [0 ... __NR_syscall_max] = &__x64_sys_ni_syscall,
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000026#include <asm/syscalls_64.h>
27};