Browse Source

VIRTUAL_ADDR -> VADDR

master
Mathieu Serandour 1 year ago
parent
commit
5b42fcf910
  1. 4
      kernel/acpi/acpi.c
  2. 12
      kernel/acpi/power.c
  3. 2
      kernel/int/apic.c
  4. 4
      kernel/int/pic.c

4
kernel/acpi/acpi.c

@ -105,9 +105,9 @@ void read_acpi_tables(const void* rsdp_location) {
void map_acpi_mmios(void) {
// mmios to map: HPET, PCIE
// cache disable
map_pages((uint64_t)apic_config_base, APIC_VIRTUAL_ADDRESS, 1,
map_pages((uint64_t)apic_config_base, APIC_VADDR, 1,
PRESENT_ENTRY | PCD | PL_XD);
map_pages((uint64_t)hpet_config_space, HPET_VIRTUAL_ADDRESS, 1,
map_pages((uint64_t)hpet_config_space, HPET_VADDR, 1,
PRESENT_ENTRY | PCD | PL_XD);
}

12
kernel/acpi/power.c

@ -1,7 +1,10 @@
#include "power.h"
#include "../lib/assert.h"
#include "../lib/panic.h"
#include "../lib/logging.h"
#include "../drivers/ps2kb.h"
#include "../int/idt.h"
#include "../memory/heap.h"
static void (*funcs[MAX_SHUTDOWN_FUNCS])(void);
static int n_funcs = 0;
@ -26,6 +29,15 @@ void reboot(void) {
for(int i = 0; i < n_funcs; i++)
funcs[i]();
unsigned still_allocated = get_n_allocation();
if(still_allocated) {
log_warn("%u FREE BLOCKS AT SHUTDOWN, %u", still_allocated);
panic("oui");
}
panic("non");
_cli();
ps2_trigger_CPU_reset();

2
kernel/int/apic.c

@ -54,7 +54,7 @@ struct APICConfig
static_assert(sizeof(struct APICConfig) == 0x400);
static volatile struct APICConfig* apic_config = (void *)APIC_VIRTUAL_ADDRESS;
static volatile struct APICConfig* apic_config = (void *)APIC_VADDR;
static uint64_t apic_timer_clock_count = 0;

4
kernel/int/pic.c

@ -33,10 +33,6 @@ void pic_eoi(unsigned char irq)
outb(PIC1_COMMAND,PIC_EOI);
}
static void io_wait(void) {
outb(0x80,0);
}
static uint16_t mask = 0xff;
void pic_init(void) {

Loading…
Cancel
Save