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
-----Original Message----- From: ros-cvs-bounces@reactos.com [mailto:ros-cvs-bounces@reactos.com] On Behalf Of navaraf@cvs.reactos.com Sent: Saturday, October 30, 2004 6:30 AM To: ros-cvs@reactos.com Subject: [ros-cvs] CVS Update: reactos
CVSROOT: /CVS/ReactOS Module name: reactos Repository: reactos/hal/halx86/ Changes by: navaraf@mok.osexperts.com 04/10/30 06:30:05
Modified files: reactos/hal/halx86/: display.c
Log message:
- Use KfAcquireSpinLock/KfReleaseSpinLock instead of
KiAcquireSpinLock/KiReleaseSpinLock.
Ros-cvs mailing list Ros-cvs@reactos.com http://reactos.com/mailman/listinfo/ros-cvs
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
-----Original Message----- From: ros-dev-bounces@reactos.com [mailto:ros-dev-bounces@reactos.com] On Behalf Of Filip Navara Sent: Sunday, October 31, 2004 2:36 PM To: ReactOS Development List Subject: Re: [ros-dev] RE: [ros-cvs] CVS Update: reactos
The problem is that KiAcquireSpinLock is essentially useless on UP and doesn't protect anything.
You are right.
Would you agree with the attached patch?
I don't agree, because DbgPrint/HalDisplayString can be called on each irql. We must always raise the irql to HIGH_LEVEL.
- Hartmut