Re: [PATCH] m68k: Define the m68k-specific syscalls with SYSCALL_DEFINE

From: Daniel Palmer

Date: Mon Nov 23 2026 - 22:45:34 EST


Replying to myself..

On Tue, 24 Nov 2026 at 11:56, Daniel Palmer <daniel@xxxxxxxx> wrote:
>sys_atomic_cmpxchg_32()

Sashiko reports that this got broken because it can't use its trick
for getting pt_regs now that it's wrapped.
I'll send a v2 with this fix at some point:

--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -514,12 +514,8 @@ SYSCALL_DEFINE6(atomic_cmpxchg_32, unsigned long,
newval, int, oldval,
Make the kernel do the necessary page stuff, then re-iterate.
Simulate a write access fault to do that. */
{
- /* The first argument of the function corresponds to
- D1, which is the first field of struct pt_regs. */
- struct pt_regs *fp = (struct pt_regs *)&newval;
-
/* '3' is an RMW flag. */
- if (do_page_fault(fp, (unsigned long)mem, 3))
+ if (do_page_fault(current_pt_regs(), (unsigned
long)mem, 3))
/* If the do_page_fault() failed, we don't
have anything meaningful to return.
There should be a SIGSEGV pending for