aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/include/asm/syscall_32.h10
-rw-r--r--arch/sh/include/asm/syscall_64.h14
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
97static 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(&regs->regs[2 + i], args, n * sizeof(args[0])); 62 memcpy(&regs->regs[2 + i], args, n * sizeof(args[0]));
62} 63}
63 64
65static 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 */