Author: sginsberg
Date: Sat Sep 26 10:12:53 2015
New Revision: 69362
URL:
http://svn.reactos.org/svn/reactos?rev=69362&view=rev
Log:
[KE]
Misc trap/interrupt fixes:
- Stub legacy KiGetTickCountHandler (INT 2A) to fail instead of breakpointing. We have
made it so far without it, and if someone finds something that actually uses this instead
of Win32's GetTickCount we can add it then. Raises the bar of making ReactOS
breakpoint from 2 bytes to 4.
- Bugcheck with the right status code in case Kei386EoiHelper is called (which means you
are trying to load a Windows HAL which we totally do not support right now).
- Use Ke* instead of Kf* in C code for IRQL routines.
Modified:
trunk/reactos/ntoskrnl/ke/i386/irqobj.c
trunk/reactos/ntoskrnl/ke/i386/kiinit.c
trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
Modified: trunk/reactos/ntoskrnl/ke/i386/irqobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/irqobj.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/irqobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/irqobj.c [iso-8859-1] Sat Sep 26 10:12:53 2015
@@ -587,7 +587,8 @@
KIRQL OldIrql;
/* Raise IRQL */
- OldIrql = KfRaiseIrql(Interrupt->SynchronizeIrql);
+ KeRaiseIrql(Interrupt->SynchronizeIrql,
+ &OldIrql);
/* Acquire interrupt spinlock */
KeAcquireSpinLockAtDpcLevel(Interrupt->ActualLock);
@@ -599,7 +600,7 @@
KeReleaseSpinLockFromDpcLevel(Interrupt->ActualLock);
/* Lower IRQL */
- KfLowerIrql(OldIrql);
+ KeLowerIrql(OldIrql);
/* Return status */
return Success;
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c [iso-8859-1] Sat Sep 26 10:12:53 2015
@@ -31,9 +31,9 @@
/* FUNCTIONS *****************************************************************/
+INIT_SECTION
VOID
NTAPI
-INIT_FUNCTION
KiInitMachineDependent(VOID)
{
ULONG CpuCount;
@@ -324,9 +324,9 @@
KiSetCR0Bits();
}
+INIT_SECTION
VOID
NTAPI
-INIT_FUNCTION
KiInitializePcr(IN ULONG ProcessorNumber,
IN PKIPCR Pcr,
IN PKIDTENTRY Idt,
@@ -386,9 +386,9 @@
Pcr->PrcbData.MultiThreadProcessorSet = Pcr->PrcbData.SetMember;
}
+INIT_SECTION
VOID
NTAPI
-INIT_FUNCTION
KiInitializeKernel(IN PKPROCESS InitProcess,
IN PKTHREAD InitThread,
IN PVOID IdleStack,
@@ -401,6 +401,7 @@
ULONG PageDirectory[2];
PVOID DpcStack;
ULONG Vendor[3];
+ KIRQL DummyIrql;
/* Detect and set the CPU Type */
KiSetProcessorType();
@@ -593,7 +594,8 @@
}
/* Raise to Dispatch */
- KfRaiseIrql(DISPATCH_LEVEL);
+ KeRaiseIrql(DISPATCH_LEVEL,
+ &DummyIrql);
/* Set the Idle Priority to 0. This will jump into Phase 1 */
KeSetPriorityThread(InitThread, 0);
@@ -604,13 +606,14 @@
KiReleasePrcbLock(Prcb);
/* Raise back to HIGH_LEVEL and clear the PRCB for the loader block */
- KfRaiseIrql(HIGH_LEVEL);
+ KeRaiseIrql(HIGH_LEVEL,
+ &DummyIrql);
LoaderBlock->Prcb = 0;
}
+INIT_SECTION
VOID
FASTCALL
-INIT_FUNCTION
KiGetMachineBootPointers(IN PKGDTENTRY *Gdt,
IN PKIDTENTRY *Idt,
IN PKIPCR *Pcr,
@@ -649,9 +652,9 @@
TssSelector.HighWord.Bytes.BaseHi << 24);
}
+INIT_SECTION
VOID
NTAPI
-INIT_FUNCTION
KiSystemStartupBootStack(VOID)
{
PKTHREAD Thread;
@@ -670,7 +673,7 @@
/* Force interrupts enabled and lower IRQL back to DISPATCH_LEVEL */
_enable();
- KfLowerIrql(DISPATCH_LEVEL);
+ KeLowerIrql(DISPATCH_LEVEL);
/* Set the right wait IRQL */
Thread->WaitIrql = DISPATCH_LEVEL;
@@ -701,9 +704,9 @@
__invlpg(Address);
}
+INIT_SECTION
VOID
NTAPI
-INIT_FUNCTION
KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
ULONG Cpu;
@@ -714,6 +717,7 @@
KIDTENTRY NmiEntry, DoubleFaultEntry;
PKTSS Tss;
PKIPCR Pcr;
+ KIRQL DummyIrql;
/* Boot cycles timestamp */
BootCycles = __rdtsc();
@@ -825,7 +829,8 @@
}
/* Raise to HIGH_LEVEL */
- KfRaiseIrql(HIGH_LEVEL);
+ KeRaiseIrql(HIGH_LEVEL,
+ &DummyIrql);
/* Switch to new kernel stack and start kernel bootstrapping */
KiSwitchToBootStack(InitialStack & ~3);
Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Sat Sep 26 10:12:53 2015
@@ -683,7 +683,7 @@
}
/* Go to APC level */
- OldIrql = KfRaiseIrql(APC_LEVEL);
+ KeRaiseIrql(APC_LEVEL, &OldIrql);
_enable();
/* Check for BOP */
@@ -694,7 +694,7 @@
}
/* Bring IRQL back */
- KfLowerIrql(OldIrql);
+ KeLowerIrql(OldIrql);
_disable();
/* Do a quick V86 exit if possible */
@@ -938,7 +938,7 @@
}
/* Go to APC level */
- OldIrql = KfRaiseIrql(APC_LEVEL);
+ KeRaiseIrql(APC_LEVEL, &OldIrql);
_enable();
/* Handle the V86 opcode */
@@ -949,7 +949,7 @@
}
/* Bring IRQL back */
- KfLowerIrql(OldIrql);
+ KeLowerIrql(OldIrql);
_disable();
/* Do a quick V86 exit if possible */
@@ -1522,7 +1522,17 @@
FASTCALL
KiGetTickCountHandler(IN PKTRAP_FRAME TrapFrame)
{
- UNIMPLEMENTED_DBGBREAK();
+ /* Save trap frame */
+ KiEnterTrap(TrapFrame);
+
+ /*
+ * Just fail the request
+ */
+ DbgPrint("INT 0x2A attempted, returning 0 tick count\n");
+ TrapFrame->Eax = 0;
+
+ /* Exit the trap */
+ KiEoiHelper(TrapFrame);
}
VOID
@@ -1756,7 +1766,7 @@
Kei386EoiHelper(VOID)
{
/* We should never see this call happening */
- ERROR_FATAL("Mismatched NT/HAL version");
+ KeBugCheck(MISMATCHED_HAL);
}
/* EOF */