From a1cffc79f88a87474769836b00db595b014996a8 Mon Sep 17 00:00:00 2001 From: ergo720 <45463469+ergo720@users.noreply.github.com> Date: Sat, 7 May 2022 14:58:27 +0200 Subject: [PATCH 1/2] Fixed wrong irql masks --- src/core/kernel/exports/EmuKrnl.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/kernel/exports/EmuKrnl.cpp b/src/core/kernel/exports/EmuKrnl.cpp index 06a8e0e10..f7b0cb444 100644 --- a/src/core/kernel/exports/EmuKrnl.cpp +++ b/src/core/kernel/exports/EmuKrnl.cpp @@ -183,13 +183,13 @@ const DWORD IrqlMasks[] = { 0x03FFFFF0, // IRQL 4 0x01FFFFF0, // IRQL 5 0x00FFFFF0, // IRQL 6 - 0x00EFFFF0, // IRQL 7 - 0x007FFFF0, // IRQL 8 - 0x003FFFF0, // IRQL 9 - 0x001FFFF0, // IRQL 10 - 0x000EFFF0, // IRQL 11 - 0x0007FFF0, // IRQL 12 - 0x0003FFF0, // IRQL 13 + 0x007FFFF0, // IRQL 7 + 0x003FFFF0, // IRQL 8 + 0x001FFFF0, // IRQL 9 + 0x000FFFF0, // IRQL 10 + 0x0007FFF0, // IRQL 11 + 0x0003FFF0, // IRQL 12 + 0x0001FFF0, // IRQL 13 0x0001FFF0, // IRQL 14 0x00017FF0, // IRQL 15 0x00013FF0, // IRQL 16 From 2168b033c6a79be9d26ed6de7be62d2f8d3fd90f Mon Sep 17 00:00:00 2001 From: ergo720 <45463469+ergo720@users.noreply.github.com> Date: Sat, 7 May 2022 22:30:35 +0200 Subject: [PATCH 2/2] Added comment --- src/core/kernel/exports/EmuKrnl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/kernel/exports/EmuKrnl.cpp b/src/core/kernel/exports/EmuKrnl.cpp index f7b0cb444..a53220c83 100644 --- a/src/core/kernel/exports/EmuKrnl.cpp +++ b/src/core/kernel/exports/EmuKrnl.cpp @@ -175,6 +175,7 @@ void CallSoftwareInterrupt(const xbox::KIRQL SoftwareIrql) HalInterruptRequestRegister ^= (1 << SoftwareIrql); } +// This masks have been verified to be correct against a kernel dump const DWORD IrqlMasks[] = { 0xFFFFFFFE, // IRQL 0 0xFFFFFFFC, // IRQL 1 (APC_LEVEL) @@ -189,12 +190,12 @@ const DWORD IrqlMasks[] = { 0x000FFFF0, // IRQL 10 0x0007FFF0, // IRQL 11 0x0003FFF0, // IRQL 12 - 0x0001FFF0, // IRQL 13 - 0x0001FFF0, // IRQL 14 + 0x0001FFF0, // IRQL 13 (same as IRQL 14) + 0x0001FFF0, // IRQL 14 (same as IRQL 13) 0x00017FF0, // IRQL 15 0x00013FF0, // IRQL 16 - 0x00011FF0, // IRQL 17 - 0x00011FF0, // IRQL 18 + 0x00011FF0, // IRQL 17 (same as IRQL 18) + 0x00011FF0, // IRQL 18 (same as IRQL 17) 0x000117F0, // IRQL 19 0x000113F0, // IRQL 20 0x000111F0, // IRQL 21