mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
1c49b34b93
Also added an ASSERT_INTERRUPTS_DISABLED() macro.
11 lines
449 B
C
11 lines
449 B
C
#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))
|