18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * System call table for UML/i386, copied from arch/x86/kernel/syscall_*.c 48c2ecf20Sopenharmony_ci * with some changes for UML. 58c2ecf20Sopenharmony_ci */ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <linux/linkage.h> 88c2ecf20Sopenharmony_ci#include <linux/sys.h> 98c2ecf20Sopenharmony_ci#include <linux/cache.h> 108c2ecf20Sopenharmony_ci#include <asm/unistd.h> 118c2ecf20Sopenharmony_ci#include <asm/syscall.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#define __NO_STUBS 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/* 168c2ecf20Sopenharmony_ci * Below you can see, in terms of #define's, the differences between the x86-64 178c2ecf20Sopenharmony_ci * and the UML syscall table. 188c2ecf20Sopenharmony_ci */ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* Not going to be implemented by UML, since we have no hardware. */ 218c2ecf20Sopenharmony_ci#define sys_iopl sys_ni_syscall 228c2ecf20Sopenharmony_ci#define sys_ioperm sys_ni_syscall 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#define sys_vm86old sys_ni_syscall 258c2ecf20Sopenharmony_ci#define sys_vm86 sys_ni_syscall 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define old_mmap sys_old_mmap 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#define __SYSCALL_I386(nr, sym) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) ; 308c2ecf20Sopenharmony_ci#include <asm/syscalls_32.h> 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci#undef __SYSCALL_I386 338c2ecf20Sopenharmony_ci#define __SYSCALL_I386(nr, sym) [ nr ] = sym, 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ciextern asmlinkage long sys_ni_syscall(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long); 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciconst sys_call_ptr_t sys_call_table[] ____cacheline_aligned = { 388c2ecf20Sopenharmony_ci /* 398c2ecf20Sopenharmony_ci * Smells like a compiler bug -- it doesn't work 408c2ecf20Sopenharmony_ci * when the & below is removed. 418c2ecf20Sopenharmony_ci */ 428c2ecf20Sopenharmony_ci [0 ... __NR_syscall_max] = &sys_ni_syscall, 438c2ecf20Sopenharmony_ci#include <asm/syscalls_32.h> 448c2ecf20Sopenharmony_ci}; 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ciint syscall_table_size = sizeof(sys_call_table); 47