mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
apic: Open-code timer save/restore
To enable migration between accelerated and non-accelerated APIC models, we will need to handle the timer saving and restoring specially and can no longer rely on the automatics of VMSTATE_TIMER. Specifically, accelerated model will not start any QEMUTimer. This patch therefore factors out the generic bits into apic_next_timer and use a post-load callback to implemented model-specific logic. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
dae0168528
commit
7a380ca350
3 changed files with 67 additions and 20 deletions
|
@ -92,6 +92,7 @@ struct APICCommonState {
|
|||
int64_t next_time;
|
||||
int idx;
|
||||
QEMUTimer *timer;
|
||||
int64_t timer_expiry;
|
||||
int sipi_vector;
|
||||
int wait_for_sipi;
|
||||
};
|
||||
|
@ -104,9 +105,11 @@ struct APICCommonInfo {
|
|||
void (*set_base)(APICCommonState *s, uint64_t val);
|
||||
void (*set_tpr)(APICCommonState *s, uint8_t val);
|
||||
void (*external_nmi)(APICCommonState *s);
|
||||
void (*post_load)(APICCommonState *s);
|
||||
};
|
||||
|
||||
void apic_report_irq_delivered(int delivered);
|
||||
void apic_qdev_register(APICCommonInfo *info);
|
||||
bool apic_next_timer(APICCommonState *s, int64_t current_time);
|
||||
|
||||
#endif /* !QEMU_APIC_INTERNAL_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue