mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
Selectively disable interrupts in MM.
Also added an ASSERT_INTERRUPTS_DISABLED() macro.
This commit is contained in:
parent
86a547dcac
commit
1c49b34b93
2 changed files with 13 additions and 0 deletions
|
@ -1,8 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "kprintf.h"
|
||||
#include "i386.h"
|
||||
|
||||
#define CRASH() do { asm volatile("ud2"); } while(0)
|
||||
#define ASSERT(x) do { if (!(x)) { asm volatile("cli"); kprintf("ASSERTION FAILED: " #x "\n%s:%u in %s\n", __FILE__, __LINE__, __PRETTY_FUNCTION__); CRASH(); } } while(0)
|
||||
#define RELEASE_ASSERT(x) do { if (!(x)) CRASH(); } while(0)
|
||||
#define ASSERT_NOT_REACHED() ASSERT(false)
|
||||
#define ASSERT_INTERRUPTS_DISABLED() ASSERT(!(cpuFlags() & 0x200))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue