Browse Source

get_lapic_id

master
Mathieu Serandour 6 months ago
parent
commit
9989e08897
  1. 7
      kernel/int/apic.c
  2. 3
      kernel/int/apic.h

7
kernel/int/apic.c

@ -58,7 +58,7 @@ struct APICConfig
static_assert(sizeof(struct APICConfig) == 0x400);
static volatile struct APICConfig* apic_config = (void *)APIC_VADDR;
volatile struct APICConfig* apic_config = (void *)APIC_VADDR;
@ -94,6 +94,11 @@ extern uint64_t read_msr(uint32_t address);
extern void write_msr(uint32_t address, uint64_t value);
uint32_t get_lapic_id(void) {
return apic_config->LAPIC_ID.reg;
}
void apic_setup_clock(void) {
log_info("setup local apic clock...");

3
kernel/int/apic.h

@ -18,3 +18,6 @@ uint64_t clock_ns(void);
// acknowledge an apic IRQ
void apic_eoi(void);
uint32_t get_lapic_id(void);

Loading…
Cancel
Save