acpi: calibrate local APIC timer on BSP
This commit is contained in:
@@ -33,6 +33,8 @@ namespace arch::acpi {
|
||||
kern_status_t read_irq(unsigned int index, irq_entry &entry);
|
||||
void write_irq(unsigned int index, const irq_entry &entry);
|
||||
void map_irq(unsigned int src, unsigned int dest);
|
||||
void mask_irq(unsigned int vec);
|
||||
void unmask_irq(unsigned int vec, unsigned int dest_cpu = (unsigned int)-1);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,22 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define APIC_LVT_INT_MASKED 0x10000
|
||||
#define APIC_LVT_TIMER_MODE_PERIODIC 0x20000
|
||||
|
||||
namespace arch::acpi {
|
||||
class local_apic {
|
||||
uint32_t *base_ = nullptr;
|
||||
|
||||
public:
|
||||
enum {
|
||||
EOI = 0xB0,
|
||||
LVT_TIMER = 320,
|
||||
TIMER_INITCOUNT = 0x380,
|
||||
TIMER_CURCOUNT = 0x390,
|
||||
TIMER_DIV = 0x3E0,
|
||||
};
|
||||
|
||||
local_apic(uint32_t *base);
|
||||
|
||||
uint32_t read(uint32_t reg);
|
||||
|
||||
Reference in New Issue
Block a user