30 lines
669 B
C
30 lines
669 B
C
#pragma once
|
|
|
|
#include "stdint.h"
|
|
|
|
#define LAPIC_ID_REG 0x020
|
|
#define LAPIC_VERSION_REG 0x030
|
|
#define LAPIC_TPR_REG 0x080
|
|
#define LAPIC_EOI_REG 0x0B0
|
|
#define LAPIC_SVR_REG 0x0F0
|
|
#define LAPIC_ICR_LOW_REG 0x300
|
|
#define LAPIC_ICR_HIGH_REG 0x310
|
|
#define LAPIC_LVT_TIMER_REG 0x320
|
|
#define LAPIC_TIMER_INIT_REG 0x380
|
|
#define LAPIC_TIMER_CURR_REG 0x390
|
|
#define LAPIC_TIMER_DIV_REG 0x3E0
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
void lapic_init(uintptr_t lapic_base_vaddr);
|
|
void lapic_eoi(void);
|
|
uint32_t lapic_read(uint32_t reg);
|
|
void lapic_write(uint32_t reg, uint32_t value);
|
|
uint32_t lapic_get_id(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|