From 7a2ebc71aeb70234cc8cdee9fbd2aea19d434881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Wed, 5 Nov 2003 22:37:42 +0000 Subject: [PATCH] - Add -Wall and -Werror compile flags and fix resulting problems - Reimplement KeAcquireSpinLockRaiseToSynch with the help of Vizzini svn path=/trunk/; revision=6534 --- reactos/hal/halx86/Makefile | 4 ++-- reactos/hal/halx86/irql.c | 4 +--- reactos/hal/halx86/spinlock.c | 19 +++++++++++++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/reactos/hal/halx86/Makefile b/reactos/hal/halx86/Makefile index 3447f39d298..5ed42e251bc 100644 --- a/reactos/hal/halx86/Makefile +++ b/reactos/hal/halx86/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.11 2003/08/07 04:03:22 royce Exp $ +# $Id: Makefile,v 1.12 2003/11/05 22:37:42 gvg Exp $ PATH_TO_TOP = ../.. @@ -26,7 +26,7 @@ TARGET_LIBPATH = . TARGET_ASFLAGS = -I$(PATH_TO_TOP)/include -I$(PATH_TO_TOP)/ntoskrnl/include -D__ASM__ -TARGET_CFLAGS = -I./include -I$(PATH_TO_TOP)/ntoskrnl/include -g +TARGET_CFLAGS = -I./include -I$(PATH_TO_TOP)/ntoskrnl/include -Wall -Werror # require os code to explicitly request A/W version of structs/functions TARGET_CFLAGS += -D_DISABLE_TIDENTS diff --git a/reactos/hal/halx86/irql.c b/reactos/hal/halx86/irql.c index 31aa2e71a56..1441a72d513 100644 --- a/reactos/hal/halx86/irql.c +++ b/reactos/hal/halx86/irql.c @@ -1,4 +1,4 @@ -/* $Id: irql.c,v 1.11 2003/11/04 21:36:22 gvg Exp $ +/* $Id: irql.c,v 1.12 2003/11/05 22:37:42 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -201,8 +201,6 @@ HalpLowerIrql(KIRQL NewIrql) VOID FASTCALL KfLowerIrql (KIRQL NewIrql) { - KIRQL OldIrql; - DPRINT("KfLowerIrql(NewIrql %d)\n", NewIrql); if (NewIrql > CurrentIrql) diff --git a/reactos/hal/halx86/spinlock.c b/reactos/hal/halx86/spinlock.c index c5224ec7025..1bee58307a1 100644 --- a/reactos/hal/halx86/spinlock.c +++ b/reactos/hal/halx86/spinlock.c @@ -1,4 +1,4 @@ -/* $Id: spinlock.c,v 1.4 2003/08/12 21:19:50 royce Exp $ +/* $Id: spinlock.c,v 1.5 2003/11/05 22:37:42 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -44,8 +44,23 @@ KeAcquireSpinLockRaiseToSynch ( PKSPIN_LOCK SpinLock ) { - ASSERT_IRQL(SYNCH_LEVEL); + KIRQL OldIrql; + KIRQL NewIrql; + +#ifdef MP + NewIrql = IPI_LEVEL - 1; +#else + NewIrql = DISPATCH_LEVEL; +#endif + + OldIrql = KeGetCurrentIrql(); + if (OldIrql < NewIrql) + { + KeRaiseIrql(NewIrql, &OldIrql); + } KeAcquireSpinLockAtDpcLevel(SpinLock); + + return OldIrql; } VOID STDCALL