]>
git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blob - arch/mips/include/asm/syscall.h
2 * Access to user system call parameters and results
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * See asm-generic/syscall.h for descriptions of what we must do here.
10 * Copyright (C) 2012 Ralf Baechle <ralf@linux-mips.org>
13 #ifndef __ASM_MIPS_SYSCALL_H
14 #define __ASM_MIPS_SYSCALL_H
16 #include <linux/kernel.h>
17 #include <linux/sched.h>
18 #include <linux/uaccess.h>
19 #include <asm/ptrace.h>
21 static inline long syscall_get_nr(struct task_struct
*task
,
27 static inline unsigned long mips_get_syscall_arg(unsigned long *arg
,
28 struct task_struct
*task
, struct pt_regs
*regs
, unsigned int n
)
30 unsigned long usp
= regs
->regs
[29];
33 case 0: case 1: case 2: case 3:
34 *arg
= regs
->regs
[4 + n
];
39 case 4: case 5: case 6: case 7:
40 return get_user(*arg
, (int *)usp
+ 4 * n
);
44 case 4: case 5: case 6: case 7:
45 #ifdef CONFIG_MIPS32_O32
46 if (test_thread_flag(TIF_32BIT_REGS
))
47 return get_user(*arg
, (int *)usp
+ 4 * n
);
50 *arg
= regs
->regs
[4 + n
];
60 static inline void syscall_get_arguments(struct task_struct
*task
,
62 unsigned int i
, unsigned int n
,
69 ret
|= mips_get_syscall_arg(&arg
, task
, regs
, i
++);
72 * No way to communicate an error because this is a void function.
79 extern const unsigned long sys_call_table
[];
80 extern const unsigned long sys32_call_table
[];
81 extern const unsigned long sysn32_call_table
[];
83 #endif /* __ASM_MIPS_SYSCALL_H */