1 /* SPDX-License-Identifier: GPL-2.0+ */ 1 2 /* 3 * Author: Hanlu Li <lihanlu@loongson.cn> 4 * Huacai Chen <chenhuacai@loongson.cn 5 * 6 * Copyright (C) 2020-2022 Loongson Technology 7 */ 8 9 #ifndef __ASM_LOONGARCH_SYSCALL_H 10 #define __ASM_LOONGARCH_SYSCALL_H 11 12 #include <linux/compiler.h> 13 #include <uapi/linux/audit.h> 14 #include <linux/elf-em.h> 15 #include <linux/kernel.h> 16 #include <linux/sched.h> 17 #include <linux/uaccess.h> 18 #include <asm/ptrace.h> 19 #include <asm/unistd.h> 20 21 extern void *sys_call_table[]; 22 23 static inline long syscall_get_nr(struct task_ 24 struct pt_re 25 { 26 return regs->regs[11]; 27 } 28 29 static inline void syscall_rollback(struct tas 30 struct pt_ 31 { 32 regs->regs[4] = regs->orig_a0; 33 } 34 35 static inline long syscall_get_error(struct ta 36 struct pt 37 { 38 unsigned long error = regs->regs[4]; 39 40 return IS_ERR_VALUE(error) ? error : 0 41 } 42 43 static inline long syscall_get_return_value(st 44 st 45 { 46 return regs->regs[4]; 47 } 48 49 static inline void syscall_set_return_value(st 50 st 51 in 52 { 53 regs->regs[4] = (long) error ? error : 54 } 55 56 static inline void syscall_get_arguments(struc 57 struc 58 unsig 59 { 60 args[0] = regs->orig_a0; 61 memcpy(&args[1], ®s->regs[5], 5 * s 62 } 63 64 static inline int syscall_get_arch(struct task 65 { 66 return AUDIT_ARCH_LOONGARCH64; 67 } 68 69 static inline bool arch_syscall_is_vdso_sigret 70 { 71 return false; 72 } 73 74 #endif /* __ASM_LOONGARCH_SYSCALL_H */ 75
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.