Commit 00ebfe58 authored by Maxim Kuvyrkov's avatar Maxim Kuvyrkov Committed by Geert Uytterhoeven

m68k: Define sigcontext ABI of ColdFire

The following patch defines sigcontext ABI of ColdFire.  Due to ISA
restrictions ColdFire needs different rt_sigreturn trampoline.

And due to ColdFire FP registers being 8-bytes instead of 12-bytes on
m68k, sigcontext and fpregset structures should be updated.

Regarding the sc_fpstate[16+6*8] field, it would've been enough 16
bytes to store ColdFire's FP state.  To accomodate GLIBC's libSegFault
it would'be been enough 6*8 bytes (room for the 6 non-call-clobbered
FP registers).  I set it to 16+6*8 to provide some extra space for any
future changes in the ColdFire FPU.
Signed-off-by: default avatarMaxim Kuvyrkov <maxim@codesourcery.com>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent a58f7534
...@@ -15,9 +15,15 @@ struct sigcontext { ...@@ -15,9 +15,15 @@ struct sigcontext {
unsigned long sc_pc; unsigned long sc_pc;
unsigned short sc_formatvec; unsigned short sc_formatvec;
#ifndef __uClinux__ #ifndef __uClinux__
# ifdef __mcoldfire__
unsigned long sc_fpregs[2][2]; /* room for two fp registers */
unsigned long sc_fpcntl[3];
unsigned char sc_fpstate[16+6*8];
# else
unsigned long sc_fpregs[2*3]; /* room for two fp registers */ unsigned long sc_fpregs[2*3]; /* room for two fp registers */
unsigned long sc_fpcntl[3]; unsigned long sc_fpcntl[3];
unsigned char sc_fpstate[216]; unsigned char sc_fpstate[216];
# endif
#endif #endif
}; };
......
...@@ -7,7 +7,11 @@ typedef greg_t gregset_t[NGREG]; ...@@ -7,7 +7,11 @@ typedef greg_t gregset_t[NGREG];
typedef struct fpregset { typedef struct fpregset {
int f_fpcntl[3]; int f_fpcntl[3];
#ifdef __mcoldfire__
int f_fpregs[8][2];
#else
int f_fpregs[8*3]; int f_fpregs[8*3];
#endif
} fpregset_t; } fpregset_t;
struct mcontext { struct mcontext {
......
...@@ -897,10 +897,17 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -897,10 +897,17 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
/* Set up to return from userspace. */ /* Set up to return from userspace. */
err |= __put_user(frame->retcode, &frame->pretcode); err |= __put_user(frame->retcode, &frame->pretcode);
#ifdef __mcoldfire__
/* movel #__NR_rt_sigreturn,d0; trap #0 */
err |= __put_user(0x203c0000, (long __user *)(frame->retcode + 0));
err |= __put_user(0x00004e40 + (__NR_rt_sigreturn << 16),
(long __user *)(frame->retcode + 4));
#else
/* moveq #,d0; notb d0; trap #0 */ /* moveq #,d0; notb d0; trap #0 */
err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16), err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16),
(long __user *)(frame->retcode + 0)); (long __user *)(frame->retcode + 0));
err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4)); err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4));
#endif
if (err) if (err)
goto give_sigsegv; goto give_sigsegv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment