mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
Kernel+LibC: Clean up how assertions work in the kernel and LibC
This also brings LibC's abort() function closer to the spec.
This commit is contained in:
parent
33a9b2a3c3
commit
f033416893
13 changed files with 36 additions and 73 deletions
|
@ -35,12 +35,13 @@
|
|||
# define VERIFY_NOT_REACHED() VERIFY(false)
|
||||
#else
|
||||
# define VERIFY(expr)
|
||||
# define VERIFY_NOT_REACHED() CRASH()
|
||||
# define VERIFY_NOT_REACHED() _abort()
|
||||
#endif
|
||||
#define CRASH() \
|
||||
do { \
|
||||
asm volatile("ud2"); \
|
||||
} while (0)
|
||||
|
||||
extern "C" {
|
||||
[[noreturn]] void _abort();
|
||||
[[noreturn]] void abort();
|
||||
}
|
||||
|
||||
#define VERIFY_INTERRUPTS_DISABLED() VERIFY(!(cpu_flags() & 0x200))
|
||||
#define VERIFY_INTERRUPTS_ENABLED() VERIFY(cpu_flags() & 0x200)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue