diff options
author | Eric Paris <eparis@redhat.com> | 2014-03-11 13:41:04 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2014-09-23 16:20:01 -0400 |
commit | 37d181bbfe387346b00bd722acfdf93685ac73b3 (patch) | |
tree | 8411accdca930539ea89055565d8e244d0dbc35d | |
parent | 1002d94d30765b1faf0840adef9ed7e6b7aa5783 (diff) |
SH: define syscall_get_arch() for superh
This patch defines syscall_get_arch() for the superh platform. It does
so in both syscall_32.h and syscall_64.h. I'm not certain if the
implementation in syscall_64.h couldn't just be used in syscall.h as I
can't really track the setting of CONFIG_64BIT...
This way is safe, but we might be able to combine these if a superh
person were able to review...
[v2]
fixed indentation stoopidity (Sergei Shtylyov)
use AUDIT_ARCH_SH instead of EM_SH
Based-on-patch-by: Richard Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Cc: linux-sh@vger.kernel.org
-rw-r--r-- | arch/sh/include/asm/syscall_32.h | 10 | ||||
-rw-r--r-- | arch/sh/include/asm/syscall_64.h | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h index 7d80df4f09cb..95be3b0ce0ac 100644 --- a/arch/sh/include/asm/syscall_32.h +++ b/arch/sh/include/asm/syscall_32.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_SH_SYSCALL_32_H | 1 | #ifndef __ASM_SH_SYSCALL_32_H |
2 | #define __ASM_SH_SYSCALL_32_H | 2 | #define __ASM_SH_SYSCALL_32_H |
3 | 3 | ||
4 | #include <uapi/linux/audit.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <linux/err.h> | 7 | #include <linux/err.h> |
@@ -93,4 +94,13 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
93 | } | 94 | } |
94 | } | 95 | } |
95 | 96 | ||
97 | static inline int syscall_get_arch(void) | ||
98 | { | ||
99 | int arch = AUDIT_ARCH_SH; | ||
100 | |||
101 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
102 | arch |= __AUDIT_ARCH_LE; | ||
103 | #endif | ||
104 | return arch; | ||
105 | } | ||
96 | #endif /* __ASM_SH_SYSCALL_32_H */ | 106 | #endif /* __ASM_SH_SYSCALL_32_H */ |
diff --git a/arch/sh/include/asm/syscall_64.h b/arch/sh/include/asm/syscall_64.h index c3561ca72bee..c6a797b90b80 100644 --- a/arch/sh/include/asm/syscall_64.h +++ b/arch/sh/include/asm/syscall_64.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_SH_SYSCALL_64_H | 1 | #ifndef __ASM_SH_SYSCALL_64_H |
2 | #define __ASM_SH_SYSCALL_64_H | 2 | #define __ASM_SH_SYSCALL_64_H |
3 | 3 | ||
4 | #include <uapi/linux/audit.h> | ||
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <asm/ptrace.h> | 7 | #include <asm/ptrace.h> |
@@ -61,4 +62,17 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
61 | memcpy(®s->regs[2 + i], args, n * sizeof(args[0])); | 62 | memcpy(®s->regs[2 + i], args, n * sizeof(args[0])); |
62 | } | 63 | } |
63 | 64 | ||
65 | static inline int syscall_get_arch(void) | ||
66 | { | ||
67 | int arch = AUDIT_ARCH_SH; | ||
68 | |||
69 | #ifdef CONFIG_64BIT | ||
70 | arch |= __AUDIT_ARCH_64BIT; | ||
71 | #endif | ||
72 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
73 | arch |= __AUDIT_ARCH_LE; | ||
74 | #endif | ||
75 | |||
76 | return arch; | ||
77 | } | ||
64 | #endif /* __ASM_SH_SYSCALL_64_H */ | 78 | #endif /* __ASM_SH_SYSCALL_64_H */ |