windows-nt/Source/XPSP1/NT/base/ntos/ke/interobj.c
2020-09-26 16:20:57 +08:00

103 lines
1.7 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 2000 Microsoft Corporation
Module Name:
interobj.c
Abstract:
This module implements functions to acquire and release the spin lock
associated with an interrupt object.
Author:
David N. Cutler (davec) 10-Apr-2000
Environment:
Kernel mode only.
Revision History:
--*/
#include "ki.h"
KIRQL
KeAcquireInterruptSpinLock (
IN PKINTERRUPT Interrupt
)
/*++
Routine Description:
This function raises the IRQL to the interrupt synchronization level
and acquires the actual spin lock associated with an interrupt object.
Arguments:
Interrupt - Supplies a pointer to a control object of type interrupt.
Return Value:
The previous IRQL is returned as the function value.
--*/
{
KIRQL OldIrql;
//
// Raise IRQL to interrupt synchronization level and acquire the actual
// spin lock associated with the interrupt object.
//
KeRaiseIrql(Interrupt->SynchronizeIrql, &OldIrql);
KeAcquireSpinLockAtDpcLevel(Interrupt->ActualLock);
return OldIrql;
}
VOID
KeReleaseInterruptSpinLock (
IN PKINTERRUPT Interrupt,
IN KIRQL OldIrql
)
/*++
Routine Description:
This function releases the actual spin lock associated with an interrupt
object and lowers the IRQL to its previous value.
Arguments:
Interrupt - Supplies a pointer to a control object of type interrupt.
OldIrql - Supplies the previous IRQL value.
Return Value:
None.
--*/
{
//
// Release the actual spin lock associated with the interrupt object
// and lower IRQL to its previous value.
//
KeReleaseSpinLockFromDpcLevel(Interrupt->ActualLock);
KeLowerIrql(OldIrql);
return;
}