kernel/inc/utils/core.h

17 lines
620 B
C
Raw Normal View History

// 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"
#include "platform/interrupts.h"
2023-02-05 14:29:26 +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"); }
#define CORE_INTERRUPTS_ENABLE asm("sti");
#define CORE_INTERRUPTS_DISABLE asm("cli");
2023-02-05 13:39:35 +00:00
#endif //NOX_CORE_H