feat: make kernel architecture-agnostic; primitive work on arm port
This commit is contained in:
1 parent
dab7d5427b
commit
1bae77ec84
164 files changed
+3664
-1641
No files matched your search
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "AcpiShutdown.hpp"
|
||||
#include <Arch/Cpu.hpp>
|
||||
#include "AcpiSleep.hpp"
|
||||
#include "AcpiEvents.hpp"
|
||||
#include <ACPI/FADT.hpp>
|
||||
@@ -95,7 +96,7 @@ namespace Hal {
|
||||
}
|
||||
}
|
||||
|
||||
asm volatile("cli");
|
||||
Arch::DisableInterrupts();
|
||||
|
||||
// Phase 1: Write SLP_TYP to PM1x_CNT without SLP_EN,
|
||||
// preserving existing register bits
|
||||
@@ -110,7 +111,7 @@ namespace Hal {
|
||||
}
|
||||
|
||||
// Flush all caches before entering sleep state
|
||||
asm volatile("wbinvd");
|
||||
Arch::WritebackInvalidateCaches();
|
||||
|
||||
// Phase 2: Assert SLP_EN to trigger the transition
|
||||
Io::Out16(pm1a | SLP_EN, (uint16_t)g_pm1aControlBlock);
|
||||
@@ -122,7 +123,7 @@ namespace Hal {
|
||||
|
||||
// Halt and wait for the hardware to power off
|
||||
for (;;) {
|
||||
asm volatile("hlt");
|
||||
Arch::Halt();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user