Skip to content

Commit

Permalink
ARM: 5909/1: ARM: Correct the FPSCR bits setting when raising exceptions
Browse files Browse the repository at this point in the history
Commit c98929c removed the clearing of the FPSCR[31:28] bits from the
vfp_raise_exceptions() function and the new bits are or'ed with the old
FPSCR bits leading to unexpected results (the original commit was
referring to the cumulative bits - FPSCR[4:0]).

Reported-by: Tom Hameenanttila <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
ctmarinas authored and Russell King committed Feb 1, 2010
1 parent c540b9f commit dbead40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,13 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_
}

/*
* Update the FPSCR with the additional exception flags.
* If any of the status flags are set, update the FPSCR.
* Comparison instructions always return at least one of
* these flags set.
*/
if (exceptions & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V))
fpscr &= ~(FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V);

fpscr |= exceptions;

fmxr(FPSCR, fpscr);
Expand Down

0 comments on commit dbead40

Please sign in to comment.