Implement lock IRQ nesting via stack variables/contexts
All checks were successful
Build documentation / build-and-deploy (push) Successful in 21s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 21s
This commit is contained in:
@@ -60,8 +60,9 @@ static void amd64_hpet_write32 (uint32_t reg, uint32_t value) {
|
||||
|
||||
static uint64_t amd64_hpet_read_counter (void) {
|
||||
uint64_t value;
|
||||
spin_lock_ctx_t ctxhrc;
|
||||
|
||||
spin_lock (&hpet_lock);
|
||||
spin_lock (&hpet_lock, &ctxhrc);
|
||||
|
||||
if (!hpet_32bits)
|
||||
value = amd64_hpet_read64 (HPET_MCVR);
|
||||
@@ -76,13 +77,15 @@ static uint64_t amd64_hpet_read_counter (void) {
|
||||
value = ((uint64_t)hi1 << 32) | lo;
|
||||
}
|
||||
|
||||
spin_unlock (&hpet_lock);
|
||||
spin_unlock (&hpet_lock, &ctxhrc);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static void amd64_hpet_write_counter (uint64_t value) {
|
||||
spin_lock (&hpet_lock);
|
||||
spin_lock_ctx_t ctxhwc;
|
||||
|
||||
spin_lock (&hpet_lock, &ctxhwc);
|
||||
|
||||
if (!hpet_32bits)
|
||||
amd64_hpet_write64 (HPET_MCVR, value);
|
||||
@@ -91,7 +94,7 @@ static void amd64_hpet_write_counter (uint64_t value) {
|
||||
amd64_hpet_write32 (HPET_MCVR + 4, (uint32_t)(value >> 32));
|
||||
}
|
||||
|
||||
spin_unlock (&hpet_lock);
|
||||
spin_unlock (&hpet_lock, &ctxhwc);
|
||||
}
|
||||
|
||||
/* Sleep for a given amount of microseconds. This time can last longer due to \ref hpet_lock being
|
||||
|
||||
Reference in New Issue
Block a user