KiAcquire/ReleaseSpinLock adaption

svn path=/trunk/; revision=7757
This commit is contained in:
Gunnar Dalsnes 2004-01-18 22:35:26 +00:00
parent 703eb5e8c9
commit 11a4e44d62
2 changed files with 15 additions and 15 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: display.c,v 1.12 2003/12/28 22:38:09 fireball Exp $
/* $Id: display.c,v 1.13 2004/01/18 22:35:26 gdalsnes Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -692,7 +692,7 @@ HalDisplayString(IN PCH String)
#error Unknown compiler for inline assembler
#endif
KeAcquireSpinLockAtDpcLevel(&Lock);
KiAcquireSpinLock(&Lock);
#if 0
if (HalOwnsDisplay == FALSE)
@ -754,7 +754,7 @@ HalDisplayString(IN PCH String)
WRITE_PORT_UCHAR((PUCHAR)VGA_CRTC_INDEX, CRTC_CURHI);
WRITE_PORT_UCHAR((PUCHAR)VGA_CRTC_DATA, (UCHAR)((offset >> 8) & 0xff));
#endif
KeReleaseSpinLockFromDpcLevel(&Lock);
KiReleaseSpinLock(&Lock);
popfl(Flags);
}

View file

@ -1,4 +1,4 @@
/* $Id: spinlock.c,v 1.6 2003/11/06 21:13:21 gvg Exp $
/* $Id: spinlock.c,v 1.7 2004/01/18 22:35:05 gdalsnes Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -35,8 +35,7 @@ KeAcquireSpinLock (
* OldIrql (OUT) = Caller supplied storage for the previous irql
*/
{
KeRaiseIrql(DISPATCH_LEVEL,OldIrql);
KeAcquireSpinLockAtDpcLevel(SpinLock);
*OldIrql = KfAcquireSpinLock(SpinLock);
}
KIRQL FASTCALL
@ -46,9 +45,8 @@ KeAcquireSpinLockRaiseToSynch (
{
KIRQL OldIrql;
KeRaiseIrql(SYNCH_LEVEL, &OldIrql);
KeAcquireSpinLockAtDpcLevel(SpinLock);
OldIrql = KfRaiseIrql(SYNCH_LEVEL);
KiAcquireSpinLock(SpinLock);
return OldIrql;
}
@ -65,8 +63,7 @@ KeReleaseSpinLock (
* NewIrql = Irql level before acquiring the spinlock
*/
{
KeReleaseSpinLockFromDpcLevel(SpinLock);
KeLowerIrql(NewIrql);
KfReleaseSpinLock(SpinLock, NewIrql);
}
KIRQL FASTCALL
@ -76,8 +73,10 @@ KfAcquireSpinLock (
{
KIRQL OldIrql;
KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
KeAcquireSpinLockAtDpcLevel(SpinLock);
assert(KeGetCurrentIrql() <= DISPATCH_LEVEL);
OldIrql = KfRaiseIrql(DISPATCH_LEVEL);
KiAcquireSpinLock(SpinLock);
return OldIrql;
}
@ -94,8 +93,9 @@ KfReleaseSpinLock (
* NewIrql = Irql level before acquiring the spinlock
*/
{
KeReleaseSpinLockFromDpcLevel(SpinLock);
KeLowerIrql(NewIrql);
assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
KiReleaseSpinLock(SpinLock);
KfLowerIrql(NewIrql);
}
/* EOF */