Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183021
b: refs/heads/master
c: 54cb3db
h: refs/heads/master
i:
  183019: f48e48a
v: v3
  • Loading branch information
Russell King committed Feb 15, 2010
1 parent 96545fb commit fbb9878
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 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: 462f39a8c7496c95f4de91ef46d875f46e0fa271
refs/heads/master: 54cb3dbb4a1cccd6b1bffc169ff638f8e74daf44
36 changes: 16 additions & 20 deletions trunk/arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,32 +444,28 @@ void vfp_sync_state(struct thread_info *thread)
void vfp_sync_state(struct thread_info *thread)
{
unsigned int cpu = get_cpu();
u32 fpexc = fmrx(FPEXC);

/*
* If VFP is enabled, the previous state was already saved and
* last_VFP_context updated.
* If the thread we're interested in is the current owner of the
* hardware VFP state, then we need to save its state.
*/
if (fpexc & FPEXC_EN)
goto out;

if (!last_VFP_context[cpu])
goto out;
if (last_VFP_context[cpu] == &thread->vfpstate) {
u32 fpexc = fmrx(FPEXC);

/*
* Save the last VFP state on this CPU.
*/
fmxr(FPEXC, fpexc | FPEXC_EN);
vfp_save_state(last_VFP_context[cpu], fpexc);
fmxr(FPEXC, fpexc);
/*
* Save the last VFP state on this CPU.
*/
fmxr(FPEXC, fpexc | FPEXC_EN);
vfp_save_state(&thread->vfpstate, fpexc | FPEXC_EN);
fmxr(FPEXC, fpexc & ~FPEXC_EN);

/*
* Set the context to NULL to force a reload the next time the thread
* uses the VFP.
*/
last_VFP_context[cpu] = NULL;
/*
* Set the context to NULL to force a reload the next time
* the thread uses the VFP.
*/
last_VFP_context[cpu] = NULL;
}

out:
put_cpu();
}
#endif
Expand Down

0 comments on commit fbb9878

Please sign in to comment.