feat: Various improvements
This commit is contained in:
@@ -12,6 +12,6 @@
|
||||
// but should not be removed, unless you know what you are doing.
|
||||
extern "C" {
|
||||
int __cxa_atexit(void (*)(void *), void *, void *) { return 0; }
|
||||
void __cxa_pure_virtual() { hcf(); }
|
||||
void __cxa_pure_virtual() { Hal::Halt(); }
|
||||
void *__dso_handle;
|
||||
}
|
||||
|
||||
@@ -5,16 +5,18 @@
|
||||
*/
|
||||
|
||||
// Halt and catch fire function.
|
||||
void hcf()
|
||||
{
|
||||
for (;;)
|
||||
namespace Hal {
|
||||
__attribute__((noreturn)) void Halt()
|
||||
{
|
||||
#if defined(__x86_64__)
|
||||
asm("hlt");
|
||||
#elif defined(__aarch64__) || defined(__riscv)
|
||||
asm("wfi");
|
||||
#elif defined(__loongarch64)
|
||||
asm("idle 0");
|
||||
#endif
|
||||
for (;;)
|
||||
{
|
||||
#if defined(__x86_64__)
|
||||
asm("hlt");
|
||||
#elif defined(__aarch64__) || defined(__riscv)
|
||||
asm("wfi");
|
||||
#elif defined(__loongarch64)
|
||||
asm("idle 0");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -7,4 +7,6 @@
|
||||
#pragma once
|
||||
|
||||
// Halt and catch fire function.
|
||||
void hcf();
|
||||
namespace Hal {
|
||||
__attribute__((noreturn)) void Halt();
|
||||
};
|
||||
Reference in New Issue
Block a user