|
@@ -104,12 +104,17 @@ static void vfp_thread_exit(struct thread_info *thread)
|
|
|
static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
|
|
|
{
|
|
|
struct thread_info *thread = v;
|
|
|
+ u32 fpexc;
|
|
|
+#ifdef CONFIG_SMP
|
|
|
+ unsigned int cpu;
|
|
|
+#endif
|
|
|
|
|
|
- if (likely(cmd == THREAD_NOTIFY_SWITCH)) {
|
|
|
- u32 fpexc = fmrx(FPEXC);
|
|
|
+ switch (cmd) {
|
|
|
+ case THREAD_NOTIFY_SWITCH:
|
|
|
+ fpexc = fmrx(FPEXC);
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
- unsigned int cpu = thread->cpu;
|
|
|
+ cpu = thread->cpu;
|
|
|
|
|
|
/*
|
|
|
* On SMP, if VFP is enabled, save the old state in
|
|
@@ -134,13 +139,16 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
|
|
|
* old state.
|
|
|
*/
|
|
|
fmxr(FPEXC, fpexc & ~FPEXC_EN);
|
|
|
- return NOTIFY_DONE;
|
|
|
- }
|
|
|
+ break;
|
|
|
|
|
|
- if (cmd == THREAD_NOTIFY_FLUSH)
|
|
|
+ case THREAD_NOTIFY_FLUSH:
|
|
|
vfp_thread_flush(thread);
|
|
|
- else
|
|
|
+ break;
|
|
|
+
|
|
|
+ case THREAD_NOTIFY_EXIT:
|
|
|
vfp_thread_exit(thread);
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
return NOTIFY_DONE;
|
|
|
}
|