Hartmut Birr wrote:
Hi,
this changes prevents from using debug print's in the very early boot phase, because the processor runs at HIGH_LEVEL and asserts in KfAcquireSpinLock.
- Hartmut
The problem is that KiAcquireSpinLock is essentially useless on UP and doesn't protect anything. Would you agree with the attached patch?
Regards, Filip
Index: hal/halx86/display.c =================================================================== RCS file: /CVS/ReactOS/reactos/hal/halx86/display.c,v retrieving revision 1.16 diff -u -r1.16 display.c --- hal/halx86/display.c 30 Oct 2004 13:30:03 -0000 1.16 +++ hal/halx86/display.c 31 Oct 2004 13:33:26 -0000 @@ -682,7 +682,14 @@
pch = String;
- OldIrql = KfAcquireSpinLock(&Lock); + if (KeGetCurrentIrql() <= DISPATCH_LEVEL) + { + OldIrql = KfAcquireSpinLock(&Lock); + } + else + { + OldIrql = HIGH_LEVEL; + }
Ki386SaveFlags(Flags); Ki386DisableInterrupts(); @@ -749,7 +756,11 @@ WRITE_PORT_UCHAR((PUCHAR)VGA_CRTC_DATA, (UCHAR)((offset >> 8) & 0xff)); #endif Ki386RestoreFlags(Flags); - KfReleaseSpinLock(&Lock, OldIrql); + + if (OldIrql <= DISPATCH_LEVEL) + { + KfReleaseSpinLock(&Lock, OldIrql); + } }
VOID STDCALL