APIC 学习资料整理
apic
- https://habr.com/en/post/446312/
// global apic variable
struct apic *apic __ro_after_init = &apic_flat;
- apic, timer and LVIT
- what’s LVIT ? ```c /* 进入到 arch/x86/kernel/apic/apic.c 了 */ // 好吧,就是向 apic 控制器写入寄存器之类的操作 !
/*
- The local apic timer can be used for any function which is CPU local. */ static struct clock_event_device lapic_clockevent = { .name = “lapic”, .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_C3STOP | CLOCK_EVT_FEAT_DUMMY, .shift = 32, .set_state_shutdown = lapic_timer_shutdown, .set_state_periodic = lapic_timer_set_periodic, .set_state_oneshot = lapic_timer_set_oneshot, .set_state_oneshot_stopped = lapic_timer_shutdown, .set_next_event = lapic_next_event, .broadcast = lapic_timer_broadcast, .rating = 100, .irq = -1, };
static int lapic_timer_set_oneshot(struct clock_event_device *evt) { return lapic_timer_set_periodic_oneshot(evt, true); }
static inline int lapic_timer_set_periodic_oneshot(struct clock_event_device evt, bool oneshot) { / Lapic used as dummy for broadcast ? */ if (evt->features & CLOCK_EVT_FEAT_DUMMY) return 0;
__setup_APIC_LVTT(lapic_timer_period, oneshot, 1);
return 0; } ```
apic_intr_mode_select
APIC 可以有多个模式,通过内核配置,来模拟 pic 模式的
本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。