Skip to content

Commit fa56244

Browse files
ldv-altpcmoore
authored andcommitted
nds32: define syscall_get_arch()
syscall_get_arch() is required to be implemented on all architectures in addition to already implemented syscall_get_nr(), syscall_get_arguments(), syscall_get_error(), and syscall_get_return_value() functions in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Acked-by: Paul Moore <paul@paul-moore.com> Acked-by: Vincent Chen <vincentc@andestech.com> Acked-by: Greentime Hu <greentime@andestech.com> Cc: Elvira Khabirova <lineprinter@altlinux.org> Cc: Eugene Syromyatnikov <esyr@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: linux-audit@redhat.com Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent 530ff23 commit fa56244

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎arch/nds32/include/asm/syscall.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef _ASM_NDS32_SYSCALL_H
66
#define _ASM_NDS32_SYSCALL_H 1
77

8+
#include <uapi/linux/audit.h>
89
#include <linux/err.h>
910
struct task_struct;
1011
struct pt_regs;
@@ -185,4 +186,12 @@ void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
185186

186187
memcpy(&regs->uregs[0] + i, args, n * sizeof(args[0]));
187188
}
189+
190+
static inline int
191+
syscall_get_arch(void)
192+
{
193+
return IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
194+
? AUDIT_ARCH_NDS32BE : AUDIT_ARCH_NDS32;
195+
}
196+
188197
#endif /* _ASM_NDS32_SYSCALL_H */

‎include/uapi/linux/audit.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ enum {
401401
#define AUDIT_ARCH_MIPSEL64 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
402402
#define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
403403
__AUDIT_ARCH_CONVENTION_MIPS64_N32)
404+
#define AUDIT_ARCH_NDS32 (EM_NDS32|__AUDIT_ARCH_LE)
405+
#define AUDIT_ARCH_NDS32BE (EM_NDS32)
404406
#define AUDIT_ARCH_OPENRISC (EM_OPENRISC)
405407
#define AUDIT_ARCH_PARISC (EM_PARISC)
406408
#define AUDIT_ARCH_PARISC64 (EM_PARISC|__AUDIT_ARCH_64BIT)

0 commit comments

Comments
 (0)