2023-03-10 10:32:50 +00:00
|
|
|
// This file is part of noxos and licensed under the MIT open source license
|
2023-02-05 13:39:35 +00:00
|
|
|
|
|
|
|
#ifndef NOX_CORE_H
|
|
|
|
#define NOX_CORE_H
|
|
|
|
|
2023-02-05 14:29:26 +00:00
|
|
|
#include "utils/logger.h"
|
2023-03-04 16:23:12 +00:00
|
|
|
#include "platform/interrupts.h"
|
2023-02-05 14:29:26 +00:00
|
|
|
|
2023-03-04 16:23:12 +00:00
|
|
|
#define CORE_INTERRUPTABLE_HALT_WHILE(a) while(!g_handling_interrupt && a) { asm("hlt"); }
|
|
|
|
#define CORE_HALT_WHILE(a) while(!g_handling_interrupt && a) { asm("hlt"); }
|
|
|
|
#define CORE_HALT_FOREVER log(LOG_WARNING, "!=====[ HALTING SYSTEM ]=====!"); while(1) { asm("hlt"); }
|
2023-02-17 11:51:11 +00:00
|
|
|
|
2023-03-04 16:23:12 +00:00
|
|
|
#define CORE_INTERRUPTS_ENABLE asm("sti");
|
|
|
|
#define CORE_INTERRUPTS_DISABLE asm("cli");
|
2023-02-05 13:39:35 +00:00
|
|
|
|
|
|
|
#endif //NOX_CORE_H
|