···2828struct sigcontext;2929struct sigcontext32;30303131-extern asmlinkage int (*save_fp_context)(struct sigcontext __user *sc);3232-extern asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc);3333-3434-extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);3535-extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);3636-3731extern void fpu_emulator_init_fpu(void);3838-extern int fpu_emulator_save_context(struct sigcontext __user *sc);3939-extern int fpu_emulator_restore_context(struct sigcontext __user *sc);4032extern void _init_fpu(void);4133extern void _save_fp(struct task_struct *);4234extern void _restore_fp(struct task_struct *);
+46
arch/mips/kernel/signal.c
···35353636#include "signal-common.h"37373838+static int (*save_fp_context)(struct sigcontext __user *sc);3939+static int (*restore_fp_context)(struct sigcontext __user *sc);4040+4141+extern asmlinkage int _save_fp_context(struct sigcontext __user *sc);4242+extern asmlinkage int _restore_fp_context(struct sigcontext __user *sc);4343+4444+extern asmlinkage int fpu_emulator_save_context(struct sigcontext __user *sc);4545+extern asmlinkage int fpu_emulator_restore_context(struct sigcontext __user *sc);4646+3847/*3948 * Horribly complicated - with the bloody RM9000 workarounds enabled4049 * the signal trampolines is moving to the end of the structure so we can···718709 key_replace_session_keyring();719710 }720711}712712+713713+#ifdef CONFIG_SMP714714+static int smp_save_fp_context(struct sigcontext __user *sc)715715+{716716+ return raw_cpu_has_fpu717717+ ? _save_fp_context(sc)718718+ : fpu_emulator_save_context(sc);719719+}720720+721721+static int smp_restore_fp_context(struct sigcontext __user *sc)722722+{723723+ return raw_cpu_has_fpu724724+ ? _restore_fp_context(sc)725725+ : fpu_emulator_restore_context(sc);726726+}727727+#endif728728+729729+static int signal_setup(void)730730+{731731+#ifdef CONFIG_SMP732732+ /* For now just do the cpu_has_fpu check when the functions are invoked */733733+ save_fp_context = smp_save_fp_context;734734+ restore_fp_context = smp_restore_fp_context;735735+#else736736+ if (cpu_has_fpu) {737737+ save_fp_context = _save_fp_context;738738+ restore_fp_context = _restore_fp_context;739739+ } else {740740+ save_fp_context = fpu_emulator_save_context;741741+ restore_fp_context = fpu_emulator_restore_context;742742+ }743743+#endif744744+745745+ return 0;746746+}747747+748748+arch_initcall(signal_setup);
+24
arch/mips/kernel/signal32.c
···35353636#include "signal-common.h"37373838+static int (*save_fp_context32)(struct sigcontext32 __user *sc);3939+static int (*restore_fp_context32)(struct sigcontext32 __user *sc);4040+4141+extern asmlinkage int _save_fp_context32(struct sigcontext32 __user *sc);4242+extern asmlinkage int _restore_fp_context32(struct sigcontext32 __user *sc);4343+4444+extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 __user *sc);4545+extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 __user *sc);4646+3847/*3948 * Including <asm/unistd.h> would give use the 64-bit syscall numbers ...4049 */···837828 info.si_code |= __SI_CHLD;838829 return copy_siginfo_to_user32(uinfo, &info);839830}831831+832832+static int signal32_init(void)833833+{834834+ if (cpu_has_fpu) {835835+ save_fp_context32 = _save_fp_context32;836836+ restore_fp_context32 = _restore_fp_context32;837837+ } else {838838+ save_fp_context32 = fpu_emulator_save_context32;839839+ restore_fp_context32 = fpu_emulator_restore_context32;840840+ }841841+842842+ return 0;843843+}844844+845845+arch_initcall(signal32_init);
-76
arch/mips/kernel/traps.c
···13951395 return set_vi_srs_handler(n, addr, 0);13961396}1397139713981398-/*13991399- * This is used by native signal handling14001400- */14011401-asmlinkage int (*save_fp_context)(struct sigcontext __user *sc);14021402-asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc);14031403-14041404-extern asmlinkage int _save_fp_context(struct sigcontext __user *sc);14051405-extern asmlinkage int _restore_fp_context(struct sigcontext __user *sc);14061406-14071407-extern asmlinkage int fpu_emulator_save_context(struct sigcontext __user *sc);14081408-extern asmlinkage int fpu_emulator_restore_context(struct sigcontext __user *sc);14091409-14101410-#ifdef CONFIG_SMP14111411-static int smp_save_fp_context(struct sigcontext __user *sc)14121412-{14131413- return raw_cpu_has_fpu14141414- ? _save_fp_context(sc)14151415- : fpu_emulator_save_context(sc);14161416-}14171417-14181418-static int smp_restore_fp_context(struct sigcontext __user *sc)14191419-{14201420- return raw_cpu_has_fpu14211421- ? _restore_fp_context(sc)14221422- : fpu_emulator_restore_context(sc);14231423-}14241424-#endif14251425-14261426-static inline void signal_init(void)14271427-{14281428-#ifdef CONFIG_SMP14291429- /* For now just do the cpu_has_fpu check when the functions are invoked */14301430- save_fp_context = smp_save_fp_context;14311431- restore_fp_context = smp_restore_fp_context;14321432-#else14331433- if (cpu_has_fpu) {14341434- save_fp_context = _save_fp_context;14351435- restore_fp_context = _restore_fp_context;14361436- } else {14371437- save_fp_context = fpu_emulator_save_context;14381438- restore_fp_context = fpu_emulator_restore_context;14391439- }14401440-#endif14411441-}14421442-14431443-#ifdef CONFIG_MIPS32_COMPAT14441444-14451445-/*14461446- * This is used by 32-bit signal stuff on the 64-bit kernel14471447- */14481448-asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc);14491449-asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc);14501450-14511451-extern asmlinkage int _save_fp_context32(struct sigcontext32 __user *sc);14521452-extern asmlinkage int _restore_fp_context32(struct sigcontext32 __user *sc);14531453-14541454-extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 __user *sc);14551455-extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 __user *sc);14561456-14571457-static inline void signal32_init(void)14581458-{14591459- if (cpu_has_fpu) {14601460- save_fp_context32 = _save_fp_context32;14611461- restore_fp_context32 = _restore_fp_context32;14621462- } else {14631463- save_fp_context32 = fpu_emulator_save_context32;14641464- restore_fp_context32 = fpu_emulator_restore_context32;14651465- }14661466-}14671467-#endif14681468-14691398extern void cpu_cache_init(void);14701399extern void tlb_init(void);14711400extern void flush_tlb_handlers(void);···17071778 memcpy((void *)(ebase + 0x180), &except_vec3_generic, 0x80);17081779 else17091780 memcpy((void *)(ebase + 0x080), &except_vec3_generic, 0x80);17101710-17111711- signal_init();17121712-#ifdef CONFIG_MIPS32_COMPAT17131713- signal32_init();17141714-#endif1715178117161782 local_flush_icache_range(ebase, ebase + 0x400);17171783 flush_tlb_handlers();