Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299873
b: refs/heads/master
c: ff9a184
h: refs/heads/master
i:
  299871: 283fc4a
v: v3
  • Loading branch information
Will Deacon authored and Russell King committed Apr 23, 2012
1 parent 4ddcd9d commit 0b9977c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 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: 2498814fcb3068f19b82b1519b4038721f61af43
refs/heads/master: ff9a184cfb6542bef98aff1789481284e122a4b3
22 changes: 21 additions & 1 deletion trunk/arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,21 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,

if (err)
return -EFAULT;

/* Ensure that VFP is disabled. */
vfp_flush_hwstate(thread);

/*
* As per the PCS, clear the length and stride bits for function
* entry.
*/
hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK);

/*
* Disable VFP in the hwstate so that we can detect if it gets
* used.
*/
hwstate->fpexc &= ~FPEXC_EN;
return 0;
}

Expand All @@ -576,7 +591,12 @@ int vfp_restore_user_hwstate(struct user_vfp __user *ufp,
unsigned long fpexc;
int err = 0;

vfp_flush_hwstate(thread);
/*
* If VFP has been used, then disable it to avoid corrupting
* the new thread state.
*/
if (hwstate->fpexc & FPEXC_EN)
vfp_flush_hwstate(thread);

/*
* Copy the floating point registers. There can be unused
Expand Down

0 comments on commit 0b9977c

Please sign in to comment.