Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36561
b: refs/heads/master
c: 681a499
h: refs/heads/master
i:
  36559: 9b7a2a6
v: v3
  • Loading branch information
Russell King authored and Russell King committed Sep 20, 2006
1 parent bf14c9d commit 09a0760
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b36e4758dc1b9ff1f6d97e951edba22366230d11
refs/heads/master: 681a4991f83742a0d2325afbf7b7f22045ad5b30
40 changes: 16 additions & 24 deletions trunk/arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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;
}

Expand Down

0 comments on commit 09a0760

Please sign in to comment.