Maxim Kuvyrkov wrote: > The following patch define sigcontext ABI of ColdFire. ... > --- a/arch/m68k/kernel/signal.c > +++ b/arch/m68k/kernel/signal.c > @@ -897,9 +897,15 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, > > /* Set up to return from userspace. */ > err |= __put_user(frame->retcode, &frame->pretcode); > +#ifdef __mcoldfire__ > + /* move.w #,d0; trap #0 */ > + err |= __put_user(0x303c0000 + __NR_rt_sigreturn, > + (long __user *)(frame->retcode + 0)); > +#else > /* moveq #,d0; notb d0; trap #0 */ > err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16), > (long __user *)(frame->retcode + 0)); > +#endif > err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4)); > > if (err) This turned out to be buggy: move.w will only set the lower 16 bits of %d0 so if the signal handler leaves something in the high-order bits, then the trampoline will trap into a non-existent syscall. The attached patch fixes this; nothing else in it has changed since the initial revision. I was lured into thinking that the above sequence is OK by m68knommu's version of the trampoline. Arch/m68knommu/kernel/entry.S uses "move #__NR_rt_sigreturn,%d0" which assembles into "move.w". This is too is buggy and I'm also attaching the fix for the nommu version. Regards, -- Maxim K. CodeSourcery