diff options
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/signal-common.h | 26 | ||||
| -rw-r--r-- | arch/mips/kernel/signal.c | 56 | ||||
| -rw-r--r-- | arch/mips/kernel/signal32.c | 49 | ||||
| -rw-r--r-- | arch/mips/kernel/signal_n32.c | 19 |
4 files changed, 81 insertions, 69 deletions
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h index 03d2b603fb84..6700bde06053 100644 --- a/arch/mips/kernel/signal-common.h +++ b/arch/mips/kernel/signal-common.h | |||
| @@ -12,6 +12,32 @@ | |||
| 12 | #define __SIGNAL_COMMON_H | 12 | #define __SIGNAL_COMMON_H |
| 13 | 13 | ||
| 14 | /* | 14 | /* |
| 15 | * Horribly complicated - with the bloody RM9000 workarounds enabled | ||
| 16 | * the signal trampolines is moving to the end of the structure so we can | ||
| 17 | * increase the alignment without breaking software compatibility. | ||
| 18 | */ | ||
| 19 | #if ICACHE_REFILLS_WORKAROUND_WAR == 0 | ||
| 20 | |||
| 21 | struct sigframe { | ||
| 22 | u32 sf_ass[4]; /* argument save space for o32 */ | ||
| 23 | u32 sf_code[2]; /* signal trampoline */ | ||
| 24 | struct sigcontext sf_sc; | ||
| 25 | sigset_t sf_mask; | ||
| 26 | }; | ||
| 27 | |||
| 28 | #else /* ICACHE_REFILLS_WORKAROUND_WAR */ | ||
| 29 | |||
| 30 | struct sigframe { | ||
| 31 | u32 sf_ass[4]; /* argument save space for o32 */ | ||
| 32 | u32 sf_pad[2]; | ||
| 33 | struct sigcontext sf_sc; /* hw context */ | ||
| 34 | sigset_t sf_mask; | ||
| 35 | u32 sf_code[8] ____cacheline_aligned; /* signal trampoline */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | #endif /* !ICACHE_REFILLS_WORKAROUND_WAR */ | ||
| 39 | |||
| 40 | /* | ||
| 15 | * handle hardware context | 41 | * handle hardware context |
| 16 | */ | 42 | */ |
| 17 | extern int setup_sigcontext(struct pt_regs *, struct sigcontext __user *); | 43 | extern int setup_sigcontext(struct pt_regs *, struct sigcontext __user *); |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 7d5a631d6cab..4a7071863065 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
| @@ -38,6 +38,27 @@ | |||
| 38 | 38 | ||
| 39 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 39 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
| 40 | 40 | ||
| 41 | #if ICACHE_REFILLS_WORKAROUND_WAR == 0 | ||
| 42 | |||
| 43 | struct rt_sigframe { | ||
| 44 | u32 rs_ass[4]; /* argument save space for o32 */ | ||
| 45 | u32 rs_code[2]; /* signal trampoline */ | ||
| 46 | struct siginfo rs_info; | ||
| 47 | struct ucontext rs_uc; | ||
| 48 | }; | ||
| 49 | |||
| 50 | #else | ||
| 51 | |||
| 52 | struct rt_sigframe { | ||
| 53 | u32 rs_ass[4]; /* argument save space for o32 */ | ||
| 54 | u32 rs_pad[2]; | ||
| 55 | struct siginfo rs_info; | ||
| 56 | struct ucontext rs_uc; | ||
| 57 | u32 rs_code[8] ____cacheline_aligned; /* signal trampoline */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | #endif | ||
| 61 | |||
| 41 | /* | 62 | /* |
| 42 | * Helper routines | 63 | * Helper routines |
| 43 | */ | 64 | */ |
| @@ -287,41 +308,6 @@ asmlinkage int sys_sigaltstack(nabi_no_regargs struct pt_regs regs) | |||
| 287 | return do_sigaltstack(uss, uoss, usp); | 308 | return do_sigaltstack(uss, uoss, usp); |
| 288 | } | 309 | } |
| 289 | 310 | ||
| 290 | /* | ||
| 291 | * Horribly complicated - with the bloody RM9000 workarounds enabled | ||
| 292 | * the signal trampolines is moving to the end of the structure so we can | ||
| 293 | * increase the alignment without breaking software compatibility. | ||
| 294 | */ | ||
| 295 | #ifdef CONFIG_TRAD_SIGNALS | ||
| 296 | struct sigframe { | ||
| 297 | u32 sf_ass[4]; /* argument save space for o32 */ | ||
| 298 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 299 | u32 sf_pad[2]; | ||
| 300 | #else | ||
| 301 | u32 sf_code[2]; /* signal trampoline */ | ||
| 302 | #endif | ||
| 303 | struct sigcontext sf_sc; | ||
| 304 | sigset_t sf_mask; | ||
| 305 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 306 | u32 sf_code[8] ____cacheline_aligned; /* signal trampoline */ | ||
| 307 | #endif | ||
| 308 | }; | ||
| 309 | #endif | ||
| 310 | |||
| 311 | struct rt_sigframe { | ||
| 312 | u32 rs_ass[4]; /* argument save space for o32 */ | ||
| 313 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 314 | u32 rs_pad[2]; | ||
| 315 | #else | ||
| 316 | u32 rs_code[2]; /* signal trampoline */ | ||
| 317 | #endif | ||
| 318 | struct siginfo rs_info; | ||
| 319 | struct ucontext rs_uc; | ||
| 320 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 321 | u32 rs_code[8] ____cacheline_aligned; /* signal trampoline */ | ||
| 322 | #endif | ||
| 323 | }; | ||
| 324 | |||
| 325 | #ifdef CONFIG_TRAD_SIGNALS | 311 | #ifdef CONFIG_TRAD_SIGNALS |
| 326 | save_static_function(sys_sigreturn); | 312 | save_static_function(sys_sigreturn); |
| 327 | __attribute_used__ noinline static void | 313 | __attribute_used__ noinline static void |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index c86a5ddff050..e0a855331826 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
| @@ -139,6 +139,27 @@ struct ucontext32 { | |||
| 139 | sigset_t32 uc_sigmask; /* mask last for extensibility */ | 139 | sigset_t32 uc_sigmask; /* mask last for extensibility */ |
| 140 | }; | 140 | }; |
| 141 | 141 | ||
| 142 | #if ICACHE_REFILLS_WORKAROUND_WAR == 0 | ||
| 143 | |||
| 144 | struct rt_sigframe32 { | ||
| 145 | u32 rs_ass[4]; /* argument save space for o32 */ | ||
| 146 | u32 rs_code[2]; /* signal trampoline */ | ||
| 147 | compat_siginfo_t rs_info; | ||
| 148 | struct ucontext32 rs_uc; | ||
| 149 | }; | ||
| 150 | |||
| 151 | #else /* ICACHE_REFILLS_WORKAROUND_WAR */ | ||
| 152 | |||
| 153 | struct rt_sigframe32 { | ||
| 154 | u32 rs_ass[4]; /* argument save space for o32 */ | ||
| 155 | u32 rs_pad[2]; | ||
| 156 | compat_siginfo_t rs_info; | ||
| 157 | struct ucontext32 rs_uc; | ||
| 158 | u32 rs_code[8] __attribute__((aligned(32))); /* signal trampoline */ | ||
| 159 | }; | ||
| 160 | |||
| 161 | #endif /* !ICACHE_REFILLS_WORKAROUND_WAR */ | ||
| 162 | |||
| 142 | extern void __put_sigset_unknown_nsig(void); | 163 | extern void __put_sigset_unknown_nsig(void); |
| 143 | extern void __get_sigset_unknown_nsig(void); | 164 | extern void __get_sigset_unknown_nsig(void); |
| 144 | 165 | ||
| @@ -383,34 +404,6 @@ static int restore_sigcontext32(struct pt_regs *regs, struct sigcontext32 __user | |||
| 383 | return err; | 404 | return err; |
| 384 | } | 405 | } |
| 385 | 406 | ||
| 386 | struct sigframe { | ||
| 387 | u32 sf_ass[4]; /* argument save space for o32 */ | ||
| 388 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 389 | u32 sf_pad[2]; | ||
| 390 | #else | ||
| 391 | u32 sf_code[2]; /* signal trampoline */ | ||
| 392 | #endif | ||
| 393 | struct sigcontext32 sf_sc; | ||
| 394 | sigset_t sf_mask; | ||
| 395 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 396 | u32 sf_code[8] ____cacheline_aligned; /* signal trampoline */ | ||
| 397 | #endif | ||
| 398 | }; | ||
| 399 | |||
| 400 | struct rt_sigframe32 { | ||
| 401 | u32 rs_ass[4]; /* argument save space for o32 */ | ||
| 402 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 403 | u32 rs_pad[2]; | ||
| 404 | #else | ||
| 405 | u32 rs_code[2]; /* signal trampoline */ | ||
| 406 | #endif | ||
| 407 | compat_siginfo_t rs_info; | ||
| 408 | struct ucontext32 rs_uc; | ||
| 409 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 410 | u32 rs_code[8] __attribute__((aligned(32))); /* signal trampoline */ | ||
| 411 | #endif | ||
| 412 | }; | ||
| 413 | |||
| 414 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) | 407 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) |
| 415 | { | 408 | { |
| 416 | int err; | 409 | int err; |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index b28646b3ceae..192073ee098f 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
| @@ -66,20 +66,27 @@ struct ucontextn32 { | |||
| 66 | sigset_t uc_sigmask; /* mask last for extensibility */ | 66 | sigset_t uc_sigmask; /* mask last for extensibility */ |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | #if ICACHE_REFILLS_WORKAROUND_WAR == 0 | ||
| 70 | |||
| 69 | struct rt_sigframe_n32 { | 71 | struct rt_sigframe_n32 { |
| 70 | u32 rs_ass[4]; /* argument save space for o32 */ | 72 | u32 rs_ass[4]; /* argument save space for o32 */ |
| 71 | #if ICACHE_REFILLS_WORKAROUND_WAR | ||
| 72 | u32 rs_pad[2]; | ||
| 73 | #else | ||
| 74 | u32 rs_code[2]; /* signal trampoline */ | 73 | u32 rs_code[2]; /* signal trampoline */ |
| 75 | #endif | ||
| 76 | struct siginfo rs_info; | 74 | struct siginfo rs_info; |
| 77 | struct ucontextn32 rs_uc; | 75 | struct ucontextn32 rs_uc; |
| 78 | #if ICACHE_REFILLS_WORKAROUND_WAR | 76 | }; |
| 77 | |||
| 78 | #else /* ICACHE_REFILLS_WORKAROUND_WAR */ | ||
| 79 | |||
| 80 | struct rt_sigframe_n32 { | ||
| 81 | u32 rs_ass[4]; /* argument save space for o32 */ | ||
| 82 | u32 rs_pad[2]; | ||
| 83 | struct siginfo rs_info; | ||
| 84 | struct ucontextn32 rs_uc; | ||
| 79 | u32 rs_code[8] ____cacheline_aligned; /* signal trampoline */ | 85 | u32 rs_code[8] ____cacheline_aligned; /* signal trampoline */ |
| 80 | #endif | ||
| 81 | }; | 86 | }; |
| 82 | 87 | ||
| 88 | #endif /* !ICACHE_REFILLS_WORKAROUND_WAR */ | ||
| 89 | |||
| 83 | extern void sigset_from_compat (sigset_t *set, compat_sigset_t *compat); | 90 | extern void sigset_from_compat (sigset_t *set, compat_sigset_t *compat); |
| 84 | 91 | ||
| 85 | save_static_function(sysn32_rt_sigsuspend); | 92 | save_static_function(sysn32_rt_sigsuspend); |
