Re-enable interrupts only if they were enabled previously
This commit is contained in:
parent
740df726e9
commit
811b173387
@ -168,6 +168,10 @@ KepGetSystemResource(IN SYSTEM_RESOURCE_TYPE ResourceType,
|
|||||||
{
|
{
|
||||||
PSYSTEM_RESOURCE_HEADER Resource;
|
PSYSTEM_RESOURCE_HEADER Resource;
|
||||||
PLIST_ENTRY ListEntry;
|
PLIST_ENTRY ListEntry;
|
||||||
|
BOOLEAN Interrupts;
|
||||||
|
|
||||||
|
/* Check if interrupts are enabled */
|
||||||
|
Interrupts = ArInterruptsEnabled();
|
||||||
|
|
||||||
/* Disable interrupts and acquire a spinlock */
|
/* Disable interrupts and acquire a spinlock */
|
||||||
ArClearInterruptFlag();
|
ArClearInterruptFlag();
|
||||||
@ -205,9 +209,13 @@ KepGetSystemResource(IN SYSTEM_RESOURCE_TYPE ResourceType,
|
|||||||
Resource = NULL;
|
Resource = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release spinlock and enable interrupts */
|
/* Release spinlock and re-enable interrupts if necessary */
|
||||||
KeReleaseSpinLock(&KepSystemResourcesLock);
|
KeReleaseSpinLock(&KepSystemResourcesLock);
|
||||||
ArSetInterruptFlag();
|
if(Interrupts)
|
||||||
|
{
|
||||||
|
/* Re-enable interrupts */
|
||||||
|
ArSetInterruptFlag();
|
||||||
|
}
|
||||||
|
|
||||||
/* Return resource header */
|
/* Return resource header */
|
||||||
*ResourceHeader = Resource;
|
*ResourceHeader = Resource;
|
||||||
|
Loading…
Reference in New Issue
Block a user