1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include <linux/compiler.h>
21#include <linux/errno.h>
22#include <linux/fs.h>
23#include <linux/mm.h>
24#include <linux/export.h>
25#include <linux/sched.h>
26#include <linux/slab.h>
27#include <linux/syscalls.h>
28
29#include <asm/cpufeature.h>
30#include <asm/syscall.h>
31
32SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
33 unsigned long, prot, unsigned long, flags,
34 unsigned long, fd, off_t, off)
35{
36 if (offset_in_page(off) != 0)
37 return -EINVAL;
38
39 return ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
40}
41
42SYSCALL_DEFINE1(arm64_personality, unsigned int, personality)
43{
44 if (personality(personality) == PER_LINUX32 &&
45 !system_supports_32bit_el0())
46 return -EINVAL;
47 return ksys_personality(personality);
48}
49
50
51
52
53#define sys_personality sys_arm64_personality
54
55asmlinkage long sys_ni_syscall(const struct pt_regs *);
56#define __arm64_sys_ni_syscall sys_ni_syscall
57
58#undef __SYSCALL
59#define __SYSCALL(nr, sym) asmlinkage long __arm64_##sym(const struct pt_regs *);
60#include <asm/unistd.h>
61
62#undef __SYSCALL
63#define __SYSCALL(nr, sym) [nr] = (syscall_fn_t)__arm64_##sym,
64
65const syscall_fn_t sys_call_table[__NR_syscalls] = {
66 [0 ... __NR_syscalls - 1] = (syscall_fn_t)sys_ni_syscall,
67#include <asm/unistd.h>
68};
69