Make FPU exception dispatching work (more?) properly.

svn path=/trunk/; revision=57279
This commit is contained in:
Mike Nordell 2012-09-11 17:34:49 +00:00
parent 858cfa0dbb
commit e46fb748a9

View file

@ -297,8 +297,9 @@ KiNpxHandler(IN PKTRAP_FRAME TrapFrame,
} }
/* Get legal exceptions that software should handle */ /* Get legal exceptions that software should handle */
Error &= (FSW_STACK_FAULT | /* We do this by first masking off from the Mask the bits we need, */
FSW_INVALID_OPERATION | /* This is done so we can keep the FSW_STACK_FAULT bit in Error. */
Mask &= (FSW_INVALID_OPERATION |
FSW_DENORMAL | FSW_DENORMAL |
FSW_ZERO_DIVIDE | FSW_ZERO_DIVIDE |
FSW_OVERFLOW | FSW_OVERFLOW |
@ -306,6 +307,12 @@ KiNpxHandler(IN PKTRAP_FRAME TrapFrame,
FSW_PRECISION); FSW_PRECISION);
Error &= ~Mask; Error &= ~Mask;
/* Check for invalid operation */
if (Error & FSW_INVALID_OPERATION)
{
/* NOTE: Stack fault is handled differently than any other case. */
/* 1. It's only raised for invalid operation. */
/* 2. It's only raised if invalid operation is not masked. */
if (Error & FSW_STACK_FAULT) if (Error & FSW_STACK_FAULT)
{ {
/* Issue stack check fault */ /* Issue stack check fault */
@ -316,9 +323,6 @@ KiNpxHandler(IN PKTRAP_FRAME TrapFrame,
TrapFrame); TrapFrame);
} }
/* Check for invalid operation */
if (Error & FSW_INVALID_OPERATION)
{
/* Issue fault */ /* Issue fault */
KiDispatchException1Args(STATUS_FLOAT_INVALID_OPERATION, KiDispatchException1Args(STATUS_FLOAT_INVALID_OPERATION,
ErrorOffset, ErrorOffset,