Re-enable interrupts only if they were enabled previously
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 42s
Builds / ExectOS (i686) (push) Successful in 40s

This commit is contained in:
Rafal Kupiec 2024-05-17 23:24:04 +02:00
parent 740df726e9
commit 811b173387
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -168,6 +168,10 @@ KepGetSystemResource(IN SYSTEM_RESOURCE_TYPE ResourceType,
{
PSYSTEM_RESOURCE_HEADER Resource;
PLIST_ENTRY ListEntry;
BOOLEAN Interrupts;
/* Check if interrupts are enabled */
Interrupts = ArInterruptsEnabled();
/* Disable interrupts and acquire a spinlock */
ArClearInterruptFlag();
@ -205,9 +209,13 @@ KepGetSystemResource(IN SYSTEM_RESOURCE_TYPE ResourceType,
Resource = NULL;
}
/* Release spinlock and enable interrupts */
/* Release spinlock and re-enable interrupts if necessary */
KeReleaseSpinLock(&KepSystemResourcesLock);
if(Interrupts)
{
/* Re-enable interrupts */
ArSetInterruptFlag();
}
/* Return resource header */
*ResourceHeader = Resource;