refactor
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include <common/utils.h>
|
||||
#include <kernel/clock.h>
|
||||
#include <kernel/cmdline.h>
|
||||
#include <kernel/mmio.h>
|
||||
#include <kernel/pmap.h>
|
||||
#include <kernel/print.h>
|
||||
#include <kernel/vas.h>
|
||||
#include <kernel/virt.h>
|
||||
#include <assert.h>
|
||||
#include <uacpi/acpi.h>
|
||||
#include <uacpi/status.h>
|
||||
@@ -56,7 +58,11 @@ void hpet_init() {
|
||||
assert(!uacpi_table_find_by_signature("HPET", &table), "HPET table not found!\n");
|
||||
|
||||
struct acpi_hpet* hpet = table.ptr;
|
||||
hpet_clock.regs = mmio_new(hpet->address.address, 0x1000);
|
||||
|
||||
uintptr_t vaddr = vm_alloc(0x1000);
|
||||
pmap_map(&kernel_vas.pmap, vaddr, hpet->address.address, PTE_READ | PTE_WRITE, CACHE_MMIO);
|
||||
hpet_clock.regs = (void*)vaddr;
|
||||
|
||||
uacpi_table_unref(&table);
|
||||
kprintf("HPET regs at %p\n", hpet_clock.regs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user