From 09a07606da0b9a1cf3ef32a5345ed29d0535c128 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 27 Aug 2006 12:38:34 +0100 Subject: [PATCH] --- yaml --- r: 36561 b: refs/heads/master c: 681a4991f83742a0d2325afbf7b7f22045ad5b30 h: refs/heads/master i: 36559: 9b7a2a688a7a74eb1eb4525b2bcea22f3fccc71d v: v3 --- [refs] | 2 +- trunk/arch/arm/vfp/vfpmodule.c | 40 ++++++++++++++-------------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/[refs] b/[refs] index d566a3fb1046..b1d817859e74 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b36e4758dc1b9ff1f6d97e951edba22366230d11 +refs/heads/master: 681a4991f83742a0d2325afbf7b7f22045ad5b30 diff --git a/trunk/arch/arm/vfp/vfpmodule.c b/trunk/arch/arm/vfp/vfpmodule.c index 4178f6cc3d37..dedbb449632e 100644 --- a/trunk/arch/arm/vfp/vfpmodule.c +++ b/trunk/arch/arm/vfp/vfpmodule.c @@ -40,10 +40,19 @@ unsigned int VFP_arch; static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) { struct thread_info *thread = v; - union vfp_state *vfp = &thread->vfpstate; + union vfp_state *vfp; - switch (cmd) { - case THREAD_NOTIFY_FLUSH: + if (likely(cmd == THREAD_NOTIFY_SWITCH)) { + /* + * Always disable VFP so we can lazily save/restore the + * old state. + */ + fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE); + return NOTIFY_DONE; + } + + vfp = &thread->vfpstate; + if (cmd == THREAD_NOTIFY_FLUSH) { /* * Per-thread VFP initialisation. */ @@ -56,29 +65,12 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v) * Disable VFP to ensure we initialise it first. */ fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE); - - /* - * FALLTHROUGH: Ensure we don't try to overwrite our newly - * initialised state information on the first fault. - */ - - case THREAD_NOTIFY_RELEASE: - /* - * Per-thread VFP cleanup. - */ - if (last_VFP_context == vfp) - last_VFP_context = NULL; - break; - - case THREAD_NOTIFY_SWITCH: - /* - * Always disable VFP so we can lazily save/restore the - * old state. - */ - fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_ENABLE); - break; } + /* flush and release case: Per-thread VFP cleanup. */ + if (last_VFP_context == vfp) + last_VFP_context = NULL; + return NOTIFY_DONE; }