2020-09-21 13:15:55 +03:00
|
|
|
#ifndef __SYS__APIC_H__
|
|
|
|
#define __SYS__APIC_H__
|
2020-09-18 15:39:29 +03:00
|
|
|
|
2021-09-21 12:11:52 +03:00
|
|
|
#include <stddef.h>
|
2020-09-18 15:39:29 +03:00
|
|
|
#include <stdint.h>
|
2020-09-27 02:32:47 +03:00
|
|
|
#include <stdbool.h>
|
2020-09-18 15:39:29 +03:00
|
|
|
|
|
|
|
#define LAPIC_REG_ICR0 0x300
|
|
|
|
#define LAPIC_REG_ICR1 0x310
|
|
|
|
#define LAPIC_REG_SPURIOUS 0x0f0
|
|
|
|
#define LAPIC_REG_EOI 0x0b0
|
|
|
|
|
2020-10-22 16:25:10 +03:00
|
|
|
bool lapic_check(void);
|
2021-09-21 18:28:32 +03:00
|
|
|
void lapic_eoi(void);
|
2020-10-12 22:20:58 +03:00
|
|
|
uint32_t lapic_read(uint32_t reg);
|
|
|
|
void lapic_write(uint32_t reg, uint32_t data);
|
2020-10-22 16:25:10 +03:00
|
|
|
|
2020-10-12 22:20:58 +03:00
|
|
|
bool x2apic_check(void);
|
|
|
|
bool x2apic_enable(void);
|
|
|
|
uint64_t x2apic_read(uint32_t reg);
|
|
|
|
void x2apic_write(uint32_t reg, uint64_t data);
|
2020-09-27 02:32:47 +03:00
|
|
|
|
2021-09-21 12:11:52 +03:00
|
|
|
void init_io_apics(void);
|
|
|
|
uint32_t io_apic_read(size_t io_apic, uint32_t reg);
|
|
|
|
void io_apic_write(size_t io_apic, uint32_t reg, uint32_t value);
|
|
|
|
uint32_t io_apic_gsi_count(size_t io_apic);
|
|
|
|
void io_apic_mask_all(void);
|
|
|
|
|
2020-09-18 15:39:29 +03:00
|
|
|
#endif
|