kv2: add paging
this also fixes up a bunch of formatting, adding the type vaddr_t Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
parent
27a7f3de75
commit
d6873d6c7a
18 changed files with 130 additions and 66 deletions
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
static uintptr_t ioapic_addr = 0xFEC00000;
|
||||
static uintptr_t lapic_addr = 0xFEE00000;
|
||||
static vaddr_t ioapic_addr = 0xFEC00000;
|
||||
static vaddr_t lapic_addr = 0xFEE00000;
|
||||
static uint8_t lapic_id = 0;
|
||||
|
||||
static struct ioapic {
|
||||
|
|
@ -34,13 +34,13 @@ void ioapic_redirect_insert(size_t irq, size_t isr, size_t low_active, size_t le
|
|||
ioapic_write(0x10 + 2 * irq + 1, lapic_id << 24);
|
||||
}
|
||||
|
||||
uint32_t lapic_read(uintptr_t addr, unsigned int regoffset)
|
||||
uint32_t lapic_read(vaddr_t addr, unsigned int regoffset)
|
||||
{
|
||||
volatile uint32_t *lapic = (volatile uint32_t *)addr;
|
||||
return lapic[regoffset >> 2];
|
||||
}
|
||||
|
||||
uint32_t lapic_write(uintptr_t addr, unsigned int regoffset, uint32_t value)
|
||||
uint32_t lapic_write(vaddr_t addr, unsigned int regoffset, uint32_t value)
|
||||
{
|
||||
volatile uint32_t *lapic = (volatile uint32_t *)addr;
|
||||
lapic[regoffset >> 2] = value;
|
||||
|
|
|
|||
Loading…
Reference in a new issue