 |
Xyris
0.5
|
Go to the documentation of this file.
26 #if UINTPTR_MAX == UINT32_MAX
28 #elif UINTPTR_MAX == UINT64_MAX
41 panic(
"Smashed stack detected.");
46 panic(
"Pure virtual called!");
75 static void cxaGuardSetInitializeHasRun(
__guard* g)
80 static bool cxaGuardHasInitializerRun(
__guard* g)
82 return g->initialized;
85 static void cxaGuardSetInUse(
__guard* g)
90 static void cxaGuardSetNotInUse(
__guard* g)
95 static bool cxaGuardIsInUse(
__guard* g)
110 if (cxaGuardHasInitializerRun(g)) {
116 if (cxaGuardHasInitializerRun(g)) {
121 if (cxaGuardIsInUse(g)) {
122 panicf(
"[%s] __guard in bad state", __func__);
131 cxaGuardSetInitializeHasRun(g);
138 cxaGuardSetNotInUse(g);
bool unlock()
Release the mutex.
void __cxa_guard_release(__guard *g)
void __cxa_guard_abort(__guard *g)
void __stack_chk_fail(void)
bool lock()
Aquire the mutex.
Architecture control and initialization.
void panicf(const char *fmt,...)
Halt the system and print the provided message and arguments on the panic screen.
uintptr_t __stack_chk_guard
This function is the global handler for all stack protection. GCC will automatically write the canary...
int __cxa_guard_acquire(__guard *g)
Mutex cxaGuard("cxaguard")
void panic(const char *msg)
Halt the system and print the provided message on the panic screen.
typedef__extension__ struct cxaguard __guard
void __cxa_pure_virtual()