Unverified Commit b27ffd46 authored by PhoeniX's avatar PhoeniX

Move MMIO to ACPI code

parent a1f6f81d
......@@ -17,6 +17,15 @@ ACPI* ACPI::getController() {
return const_cast<ACPI*>(controller);
}
inline static void MmioWrite32(void *p, uint32_t data) {
Pagetable::map(p);
*reinterpret_cast<volatile uint32_t *>(p) = data;
}
inline static uint32_t MmioRead32(const void *p) {
Pagetable::map(p);
return *reinterpret_cast<const volatile uint32_t *>(p);
}
ACPI::ACPI() {
static const void *const ACPI_FIND_START = reinterpret_cast<const void*>(0x000e0000);
static const void *const ACPI_FIND_TOP = reinterpret_cast<const void*>(0x000fffff);
......
......@@ -76,12 +76,3 @@ class Pagetable {
static void* lowalloc(size_t count = 1);
static void free(void* page);
};
inline static void MmioWrite32(void *p, uint32_t data) {
Pagetable::map(p);
*reinterpret_cast<volatile uint32_t *>(p) = data;
}
inline static uint32_t MmioRead32(const void *p) {
Pagetable::map(p);
return *reinterpret_cast<const volatile uint32_t *>(p);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment