| 1 | #ifndef APIC_H |
| 2 | #define APIC_H |
| 3 | |
| 4 | typedef struct APICCommonState APICCommonState; |
| 5 | |
| 6 | /* apic.c */ |
| 7 | void apic_set_max_apic_id(uint32_t max_apic_id); |
| 8 | int apic_accept_pic_intr(APICCommonState *s); |
| 9 | void apic_deliver_pic_intr(APICCommonState *s, int level); |
| 10 | void apic_deliver_nmi(APICCommonState *s); |
| 11 | int apic_get_interrupt(APICCommonState *s); |
| 12 | int cpu_set_apic_base(APICCommonState *s, uint64_t val); |
| 13 | uint64_t cpu_get_apic_base(APICCommonState *s); |
| 14 | bool cpu_is_apic_enabled(APICCommonState *s); |
| 15 | void cpu_set_apic_tpr(APICCommonState *s, uint8_t val); |
| 16 | uint8_t cpu_get_apic_tpr(APICCommonState *s); |
| 17 | void apic_init_reset(APICCommonState *s); |
| 18 | void apic_sipi(APICCommonState *s); |
| 19 | void apic_poll_irq(APICCommonState *s); |
| 20 | void apic_designate_bsp(APICCommonState *s, bool bsp); |
| 21 | int apic_get_highest_priority_irr(APICCommonState *s); |
| 22 | int apic_msr_read(APICCommonState *s, int index, uint64_t *val); |
| 23 | int apic_msr_write(APICCommonState *s, int index, uint64_t val); |
| 24 | bool is_x2apic_mode(APICCommonState *s); |
| 25 | |
| 26 | /* pc.c */ |
| 27 | APICCommonState *cpu_get_current_apic(void); |
| 28 | |
| 29 | #endif |