Skip to content

Commit be6c50d

Browse files
Michael Schmitzgeertu
authored andcommitted
selftests/seccomp: Add m68k support
Add m68k seccomp definitions to seccomp_bpf self test code. Tested on ARAnyM. Signed-off-by: Michael Schmitz <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 6baaade commit be6c50d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ struct seccomp_data {
138138
# define __NR_seccomp 337
139139
# elif defined(__sh__)
140140
# define __NR_seccomp 372
141+
# elif defined(__mc68000__)
142+
# define __NR_seccomp 380
141143
# else
142144
# warning "seccomp syscall number unknown for this architecture"
143145
# define __NR_seccomp 0xffff
@@ -1838,6 +1840,10 @@ TEST_F(TRACE_poke, getpid_runs_normally)
18381840
# define ARCH_REGS struct pt_regs
18391841
# define SYSCALL_NUM(_regs) (_regs).regs[3]
18401842
# define SYSCALL_RET(_regs) (_regs).regs[0]
1843+
#elif defined(__mc68000__)
1844+
# define ARCH_REGS struct user_regs_struct
1845+
# define SYSCALL_NUM(_regs) (_regs).orig_d0
1846+
# define SYSCALL_RET(_regs) (_regs).d0
18411847
#else
18421848
# error "Do not know how to find your architecture's registers and syscalls"
18431849
#endif
@@ -1902,7 +1908,7 @@ const bool ptrace_entry_set_syscall_ret =
19021908
* Use PTRACE_GETREGS and PTRACE_SETREGS when available. This is useful for
19031909
* architectures without HAVE_ARCH_TRACEHOOK (e.g. User-mode Linux).
19041910
*/
1905-
#if defined(__x86_64__) || defined(__i386__) || defined(__mips__)
1911+
#if defined(__x86_64__) || defined(__i386__) || defined(__mips__) || defined(__mc68000__)
19061912
# define ARCH_GETREGS(_regs) ptrace(PTRACE_GETREGS, tracee, 0, &(_regs))
19071913
# define ARCH_SETREGS(_regs) ptrace(PTRACE_SETREGS, tracee, 0, &(_regs))
19081914
#else

0 commit comments

Comments
 (0)