feat: add kernel ACPI support for querying battery percentage, add battery indicator to desktop, move log state to 0:/state directory
This commit is contained in:
1 parent
0a18b2cf2d
commit
e641500b40
34 files changed
+2461
-100
No files matched your search
@@ -5,6 +5,14 @@
|
||||
#include <CppLib/Spinlock.hpp>
|
||||
|
||||
namespace Memory::VMM {
|
||||
|
||||
// Top of the contiguous HHDM mapping, published by Init() for callers that
|
||||
// must validate a firmware-supplied physical address before dereferencing
|
||||
// it through the HHDM.
|
||||
static std::uint64_t g_hhdmLimit = 0;
|
||||
|
||||
std::uint64_t Paging::HhdmLimit() { return g_hhdmLimit; }
|
||||
|
||||
Paging* g_paging = nullptr;
|
||||
|
||||
static constexpr uint64_t LeafAddressMask = 0x000FFFFFFFFFF000ULL;
|
||||
@@ -88,6 +96,7 @@ namespace Memory::VMM {
|
||||
if (entryEnd > maxPhysAddr) maxPhysAddr = entryEnd;
|
||||
}
|
||||
maxPhysAddr = (maxPhysAddr + 0xFFF) & ~0xFFFULL;
|
||||
g_hhdmLimit = maxPhysAddr;
|
||||
|
||||
for (uint64_t pageAddr = 0; pageAddr < maxPhysAddr; pageAddr += 0x1000) {
|
||||
Map(pageAddr, HHDM(pageAddr));
|
||||
|
||||
@@ -90,6 +90,14 @@ public:
|
||||
Paging();
|
||||
void Init(std::uint64_t kernelBaseVirt, std::uint64_t kernelSize, const montauk::boot::MemoryMap& memMap,
|
||||
const montauk::boot::Framebuffer& framebuffer);
|
||||
// Top of the contiguous HHDM mapping built by Init(). A physical
|
||||
// address at or above this is NOT reachable at phys+hhdmBase, and
|
||||
// dereferencing it there faults (non-canonical addresses raise #GP
|
||||
// rather than #PF). Anything that turns firmware-supplied numbers into
|
||||
// HHDM pointers -- the AML interpreter's SystemMemory regions above all
|
||||
// -- must check against this first.
|
||||
static std::uint64_t HhdmLimit();
|
||||
|
||||
void Map(std::uint64_t physicalAddress, std::uint64_t virtualAddress);
|
||||
void MapMMIO(std::uint64_t physicalAddress, std::uint64_t virtualAddress);
|
||||
void MapWC(std::uint64_t physicalAddress, std::uint64_t virtualAddress);
|
||||
|
||||
Reference in new issue
Block a user