> From: Aleksandar Markovic <aleksandar.marko...@rt-rk.com> > Sent: Tuesday, July 24, 2018 7:32 PM > From: Dimitrije Nikolic <dniko...@wavecomp.com> > > Add signal.c as a dredirection of regular mips' signal.c, but also > amend regular mips' signal.c. this is done to avoid the duplication > of large pieces of code.
dredirection of -> redirection to mips' -> MIPS' this -> This diff --git a/linux-user/mips/signal.c b/linux-user/mips/signal.c index 6aa303e..3d7bcbc 100644 --- a/linux-user/mips/signal.c +++ b/linux-user/mips/signal.c @@ -21,7 +21,15 @@ #include "signal-common.h" #include "linux-user/trace.h" -# if defined(TARGET_ABI_MIPSO32) +#if defined(TARGET_ABI_MIPSP32) +struct target_sigcontext { + uint64_t sc_regs[32]; + uint64_t sc_pc; + uint32_t sc_used_math; + uint32_t sc_reserved; +}; +#define TARGET_ALMASK (~15) +#elif defined(TARGET_ABI_MIPSO32) struct target_sigcontext { uint32_t sc_regmask; /* Unused */ uint32_t sc_status; @@ -43,6 +51,7 @@ struct target_sigcontext { target_ulong sc_hi3; target_ulong sc_lo3; }; +#define TARGET_ALMASK (~7) # else /* N32 || N64 */ struct target_sigcontext { uint64_t sc_regs[32]; @@ -61,6 +70,7 @@ struct target_sigcontext { uint32_t sc_dsp; uint32_t sc_reserved; }; +#define TARGET_ALMASK (~15) # endif /* O32 */ > struct sigframe { > @@ -91,6 +101,17 @@ static inline int install_sigtramp(unsigned int *tramp, > unsigned int syscall) > { > int err = 0; > > +#if defined(TARGET_ABI_MIPSP32) > + uint16_t *tramp16 = (uint16_t *)tramp; > + /* > + * li $2, __NR__foo_sigreturn > + * syscall 0 > + */ > + __put_user(0x6040 , tramp16 + 0); > + __put_user(syscall, tramp16 + 1); > + __put_user(0 , tramp16 + 2); > + __put_user(0x1008 , tramp16 + 3); > +#else > /* > * Set up the return code ... > * This code segment should be in a separate patch, called, let's say, "target/mips: Set up signal trampoline for nanoMIPS". Perhaps there should be one more patch "target/mips: Handle signal context for nanoMIPS", obtained in a similar fashion. Aleksandar M.