acpi: Fix copy/paste error in GlobalLock functions.

Should fix #18701.
This commit is contained in:
Augustin Cavalier 2023-12-07 16:08:44 -05:00
parent 13bbb4d8f2
commit 64408be772

View File

@ -1238,7 +1238,8 @@ AcpiOsAcquireGlobalLock(volatile uint32_t *lock)
if ((oldValue & ACPI_GLOCK_OWNED) != 0) if ((oldValue & ACPI_GLOCK_OWNED) != 0)
newValue |= ACPI_GLOCK_PENDING; newValue |= ACPI_GLOCK_PENDING;
} while (atomic_test_and_set((int32*)lock, newValue, oldValue) != (int32)oldValue); } while (atomic_test_and_set((int32*)lock, newValue, oldValue) != (int32)oldValue);
return (newValue & ACPI_GLOCK_PENDING) != 0;
return (newValue & ACPI_GLOCK_PENDING) == 0;
} }
@ -1259,6 +1260,7 @@ AcpiOsReleaseGlobalLock(volatile uint32_t *lock)
oldValue = *lock; oldValue = *lock;
newValue = oldValue & ~(ACPI_GLOCK_PENDING | ACPI_GLOCK_OWNED); newValue = oldValue & ~(ACPI_GLOCK_PENDING | ACPI_GLOCK_OWNED);
} while (atomic_test_and_set((int32*)lock, newValue, oldValue) != (int32)oldValue); } while (atomic_test_and_set((int32*)lock, newValue, oldValue) != (int32)oldValue);
return (oldValue & ACPI_GLOCK_PENDING) != 0; return (oldValue & ACPI_GLOCK_PENDING) != 0;
} }