Replace EXCEPTION_FLT_XXX by STATUS_FLOAT_XXX. Set ExceptionFlags to 0
for exceptions dispatched from ntoskrnl.
Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
Modified: trunk/reactos/ntoskrnl/ke/i386/fpu.c
Modified: trunk/reactos/ntoskrnl/ke/i386/usertrap.c
_____
Modified: trunk/reactos/ntoskrnl/ke/i386/exp.c
--- trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-01-14 16:12:34 UTC
(rev 13044)
+++ trunk/reactos/ntoskrnl/ke/i386/exp.c 2005-01-14 19:42:47 UTC
(rev 13045)
@@ -99,7 +99,7 @@
"SIMD Fault"
};
-static NTSTATUS ExceptionToNtStatus[] =
+NTSTATUS ExceptionToNtStatus[] =
{
STATUS_INTEGER_DIVIDE_BY_ZERO,
STATUS_SINGLE_STEP,
@@ -108,7 +108,7 @@
STATUS_INTEGER_OVERFLOW,
STATUS_ARRAY_BOUNDS_EXCEEDED,
STATUS_ILLEGAL_INSTRUCTION,
- STATUS_ACCESS_VIOLATION, /* STATUS_FLT_INVALID_OPERATION */
+ STATUS_FLOAT_INVALID_OPERATION,
STATUS_ACCESS_VIOLATION,
STATUS_ACCESS_VIOLATION,
STATUS_ACCESS_VIOLATION,
@@ -117,10 +117,10 @@
STATUS_ACCESS_VIOLATION,
STATUS_ACCESS_VIOLATION,
STATUS_ACCESS_VIOLATION, /* RESERVED */
- STATUS_ACCESS_VIOLATION, /* STATUS_FLT_INVALID_OPERATION */
+ STATUS_FLOAT_INVALID_OPERATION, /* Should not be used, the FPU can
give more specific info */
STATUS_DATATYPE_MISALIGNMENT,
STATUS_ACCESS_VIOLATION,
- STATUS_ACCESS_VIOLATION /* STATUS_FLT_MULTIPLE_TRAPS? */
+ STATUS_FLOAT_MULTIPLE_TRAPS,
};
/* FUNCTIONS
****************************************************************/
@@ -190,9 +190,8 @@
Er.NumberParameters = 0;
}
- Er.ExceptionFlags = (STATUS_SINGLE_STEP == Er.ExceptionCode ||
- STATUS_BREAKPOINT == Er.ExceptionCode) ?
- 0 : EXCEPTION_NONCONTINUABLE;
+ /* FIXME: Which exceptions are noncontinuable? */
+ Er.ExceptionFlags = 0;
KiDispatchException(&Er, 0, Tf, KernelMode, TRUE);
_____
Modified: trunk/reactos/ntoskrnl/ke/i386/fpu.c
--- trunk/reactos/ntoskrnl/ke/i386/fpu.c 2005-01-14 16:12:34 UTC
(rev 13044)
+++ trunk/reactos/ntoskrnl/ke/i386/fpu.c 2005-01-14 19:42:47 UTC
(rev 13045)
@@ -35,16 +35,6 @@
/* DEFINES
*******************************************************************/
-#define EXCEPTION_FLT_DENORMAL_OPERAND (0xc000008dL)
-#define EXCEPTION_FLT_DIVIDE_BY_ZERO (0xc000008eL)
-#define EXCEPTION_FLT_INEXACT_RESULT (0xc000008fL)
-#define EXCEPTION_FLT_INVALID_OPERATION (0xc0000090L)
-#define EXCEPTION_FLT_OVERFLOW (0xc0000091L)
-#define EXCEPTION_FLT_STACK_CHECK (0xc0000092L)
-#define EXCEPTION_FLT_UNDERFLOW (0xc0000093L)
-#define EXCEPTION_FLT_MULTIPLE_FAULTS (0xC00002B4L)
-#define EXCEPTION_FLT_MULTIPLE_TRAPS (0xC00002B5L)
-
/* x87 Status Word exception flags */
#define X87_SW_IE (1<<0) /* Invalid Operation */
#define X87_SW_DE (1<<1) /* Denormalized Operand */
@@ -566,19 +556,19 @@
DPRINT("FpuStatusWord = 0x%04x\n", FpuStatusWord);
if (FpuStatusWord & X87_SW_IE)
- Er.ExceptionCode = EXCEPTION_FLT_INVALID_OPERATION;
+ Er.ExceptionCode = STATUS_FLOAT_INVALID_OPERATION;
else if (FpuStatusWord & X87_SW_DE)
- Er.ExceptionCode = EXCEPTION_FLT_DENORMAL_OPERAND;
+ Er.ExceptionCode = STATUS_FLOAT_DENORMAL_OPERAND;
else if (FpuStatusWord & X87_SW_ZE)
- Er.ExceptionCode = EXCEPTION_FLT_DIVIDE_BY_ZERO;
+ Er.ExceptionCode = STATUS_FLOAT_DIVIDE_BY_ZERO;
else if (FpuStatusWord & X87_SW_OE)
- Er.ExceptionCode = EXCEPTION_FLT_OVERFLOW;
+ Er.ExceptionCode = STATUS_FLOAT_OVERFLOW;
else if (FpuStatusWord & X87_SW_UE)
- Er.ExceptionCode = EXCEPTION_FLT_UNDERFLOW;
+ Er.ExceptionCode = STATUS_FLOAT_UNDERFLOW;
else if (FpuStatusWord & X87_SW_PE)
- Er.ExceptionCode = EXCEPTION_FLT_INEXACT_RESULT;
+ Er.ExceptionCode = STATUS_FLOAT_INEXACT_RESULT;
else if (FpuStatusWord & X87_SW_SE)
- Er.ExceptionCode = EXCEPTION_FLT_STACK_CHECK;
+ Er.ExceptionCode = STATUS_FLOAT_STACK_CHECK;
else
ASSERT(0); /* not reached */
/* FIXME: is this the right way to get the correct EIP of the
faulting instruction? */
@@ -586,8 +576,8 @@
}
else /* ExceptionNr == 19 */
{
- /* FIXME: When should we use EXCEPTION_FLT_MULTIPLE_FAULTS?
*/
- Er.ExceptionCode = EXCEPTION_FLT_MULTIPLE_TRAPS;
+ /* FIXME: When should we use STATUS_FLOAT_MULTIPLE_FAULTS? */
+ Er.ExceptionCode = STATUS_FLOAT_MULTIPLE_TRAPS;
Er.ExceptionAddress = (PVOID)Tf->Eip;
}
_____
Modified: trunk/reactos/ntoskrnl/ke/i386/usertrap.c
--- trunk/reactos/ntoskrnl/ke/i386/usertrap.c 2005-01-14 16:12:34 UTC
(rev 13044)
+++ trunk/reactos/ntoskrnl/ke/i386/usertrap.c 2005-01-14 19:42:47 UTC
(rev 13045)
@@ -131,11 +131,9 @@
Er.NumberParameters = 0;
}
+ /* FIXME: Which exceptions are noncontinuable? */
+ Er.ExceptionFlags = 0;
- Er.ExceptionFlags = (STATUS_SINGLE_STEP == Er.ExceptionCode ||
- STATUS_BREAKPOINT == Er.ExceptionCode) ?
- 0 : EXCEPTION_NONCONTINUABLE;
-
KiDispatchException(&Er, 0, Tf, UserMode, TRUE);
return(0);
}