sunriseos / SunriseOS

Horizon/NX kernel reimplementation
Apache License 2.0
232 stars 13 forks source link

Panic if SpinLock locked in interrupt context #528

Closed kitlith closed 5 years ago

kitlith commented 5 years ago

Fixes #471.

This involves creating a newtype wrapper around spin::Mutex to check when locking if the number of interrupts being serviced is currently zero.

kitlith commented 5 years ago

It looks like maybe I should fiddle with this a bit more if syscall context is not considered irq context. (Is it? It's the only 'interrupt' where interrupts are not disabled.) maybe add an extra thing to the macro?

Orycterope commented 5 years ago

Indeed, syscall context isn't interrupt context 😕

kitlith commented 5 years ago

Thanks for the feedback, I'll try to get to that today. Fixing syscall context in particular is going to be annoying (but that'll also lay the groundwork for switching back to counter-based SpinLockIRQ, i think.)

roblabla commented 5 years ago

LGTM, can get merged after a rebase :)