mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-06 02:24:14 +08:00
caab277b1d
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 503 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Enrico Weigelt <info@metux.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190602204653.811534538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
62 lines
1.5 KiB
C
62 lines
1.5 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* AArch64-specific system calls implementation
|
|
*
|
|
* Copyright (C) 2012 ARM Ltd.
|
|
* Author: Catalin Marinas <catalin.marinas@arm.com>
|
|
*/
|
|
|
|
#include <linux/compiler.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/fs.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/export.h>
|
|
#include <linux/sched.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/syscalls.h>
|
|
|
|
#include <asm/cpufeature.h>
|
|
#include <asm/syscall.h>
|
|
|
|
SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
|
|
unsigned long, prot, unsigned long, flags,
|
|
unsigned long, fd, unsigned long, off)
|
|
{
|
|
if (offset_in_page(off) != 0)
|
|
return -EINVAL;
|
|
|
|
return ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
|
|
}
|
|
|
|
SYSCALL_DEFINE1(arm64_personality, unsigned int, personality)
|
|
{
|
|
if (personality(personality) == PER_LINUX32 &&
|
|
!system_supports_32bit_el0())
|
|
return -EINVAL;
|
|
return ksys_personality(personality);
|
|
}
|
|
|
|
asmlinkage long sys_ni_syscall(void);
|
|
|
|
asmlinkage long __arm64_sys_ni_syscall(const struct pt_regs *__unused)
|
|
{
|
|
return sys_ni_syscall();
|
|
}
|
|
|
|
/*
|
|
* Wrappers to pass the pt_regs argument.
|
|
*/
|
|
#define __arm64_sys_personality __arm64_sys_arm64_personality
|
|
|
|
#undef __SYSCALL
|
|
#define __SYSCALL(nr, sym) asmlinkage long __arm64_##sym(const struct pt_regs *);
|
|
#include <asm/unistd.h>
|
|
|
|
#undef __SYSCALL
|
|
#define __SYSCALL(nr, sym) [nr] = __arm64_##sym,
|
|
|
|
const syscall_fn_t sys_call_table[__NR_syscalls] = {
|
|
[0 ... __NR_syscalls - 1] = __arm64_sys_ni_syscall,
|
|
#include <asm/unistd.h>
|
|
};
|