kernel: Sanity-check interrupts in snooze().

This didn't trigger any panics on my bare-metal dev install when tested,
but it might explain some easily-reproducible hardlocks (i.e. can't
even drop to KDL via emergency keys) I was seeing on other machines.
This commit is contained in:
Augustin Cavalier
2019-02-17 14:36:16 -05:00
parent 1eededf17f
commit c054900882
+7
View File
@@ -1373,6 +1373,13 @@ static status_t
common_snooze_etc(bigtime_t timeout, clockid_t clockID, uint32 flags,
bigtime_t* _remainingTime)
{
#if KDEBUG
if (!are_interrupts_enabled()) {
panic("common_snooze_etc(): called with interrupts disabled, timeout "
"%" B_PRIdBIGTIME, timeout);
}
#endif
switch (clockID) {
case CLOCK_REALTIME:
// make sure the B_TIMEOUT_REAL_TIME_BASE flag is set and fall