Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move MMIO to ACPI code
  • Loading branch information
djphoenix committed May 28, 2019
1 parent a1f6f81 commit b27ffd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 9 additions & 0 deletions src/platform/acpi.cpp
Expand Up @@ -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);
Expand Down
9 changes: 0 additions & 9 deletions src/platform/include/pagetable.hpp
Expand Up @@ -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);
}

0 comments on commit b27ffd4

Please sign in to comment.