- Save the old IRQL and assert it in the interrupt handler.
- Fix KTRAP_FRAME structure.
svn path=/trunk/; revision=33934
//
typedef struct _KTRAP_FRAME
{
+ ULONG OldIrql;
+ // UCHAR PreviousMode;
+ // ULONG Fpscr;
+ // ULONG FpExc;
+ // ULONG S[33];
+ // ULONG FpExtra[8];
ULONG Spsr;
ULONG R0;
ULONG R1;
ULONG SvcSp;
ULONG SvcLr;
ULONG Pc;
- ULONG OldIrql;
-// UCHAR PreviousMode;
-// ULONG Fpscr;
-// ULONG FpExc;
-// ULONG S[33];
-// ULONG FpExtra[8];
} KTRAP_FRAME, *PKTRAP_FRAME;
#ifndef NTOS_MODE_USER
//
#define KeGetCurrentProcessorNumber() PCR->Number
#define KeGetCurrentIrql() PCR->CurrentIrql
-#define _KeGetCurrentThread() PCR->CurrentThread
-#define _KeGetPreviousMode() PCR->CurrentThread->PreviousMode
-#define _KeIsExecutingDpc() (PCR->DpcRoutineActive != 0)
+#define _KeGetCurrentThread() PCR->CurrentThread
+#define _KeGetPreviousMode() PCR->CurrentThread->PreviousMode
+#define _KeIsExecutingDpc() (PCR->DpcRoutineActive != 0)
#define KeGetDcacheFillSize() PCR->DcacheFillSize
//
*/
.equ KiPcr, 0xFFFFF000
+/*
+ * PCR Offsets
+ */
+.equ PcCurrentIrql, 0x14C
+
#else
/*
mrs r0, spsr_all
str r0, [sp, #-4]!
+ //
+ // Make space for IRQL
+ //
+ sub sp, sp, #4
+
//
// Call the C handler
//
mov r0, sp
bl KiSoftwareInterruptHandler
+ //
+ // Skip IRQL
+ //
+ add sp, sp, #(4)
+
//
// Get the SPSR and restore it
//
// Save the SVC sp before we modify it
//
mov r2, sp
-
- //
- // Dummy OldIrql
- //
- //str r0, [sp, #-4]!
-
+
//
// Save the abort lr
//
//
mrs r0, spsr_all
str r0, [sp, #-4]!
+
+ //
+ // Make space for IRQL
+ //
+ sub sp, sp, #4
//
// Call the C handler
ldr pc, =KiDataAbortHandler
AbortExit:
+
+ //
+ // Skip IRQL
+ //
+ add sp, sp, #(4)
//
// Get the SPSR and restore it
//
mov r2, sp
- //
- // Dummy OldIrql
- //
- //str r0, [sp, #-4]!
-
//
// Save the IRQ lr
//
//
mrs r0, spsr_all
str r0, [sp, #-4]!
+
+ //
+ // Make space for IRQL
+ //
+ sub sp, sp, #4
//
// Call the C handler
//
// Get the old IRQL
//
- OldIrql = TrapFrame->OldIrql;
+ OldIrql = KeGetCurrentIrql();
+ TrapFrame->OldIrql = OldIrql;
//
// Get the interrupt source
//
InterruptCause = HalGetInterruptSource();
DPRINT1("Interrupt (%x) @ %p %p\n", InterruptCause, TrapFrame->SvcLr, TrapFrame->Pc);
+ DPRINT1("OLD IRQL: %x\n", OldIrql);
//
// Get the new IRQL and Interrupt Mask
//
// Make sure the IRQL is valid
//
- //if (OldIrql < Irql)
- //{
+ if (OldIrql < Irql)
+ {
//
// We should just return, probably
//
- //DPRINT1("IRQL Race!\n");
- //while (TRUE);
- //}
+ DPRINT1("IRQL Race!\n");
+ while (TRUE);
+ }
//
// Check if this interrupt is at DISPATCH or higher