target/i386: Move has_work() from CPUClass to SysemuCPUOps
Move has_work() from CPUClass to SysemuCPUOps, restrict x86_cpu_pending_interrupt() to system. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250125170125.32855-10-philmd@linaro.org>
This commit is contained in:
parent
91231d99ac
commit
f0bef00571
@ -8604,16 +8604,15 @@ static vaddr x86_cpu_get_pc(CPUState *cs)
|
||||
return cpu->env.eip + cpu->env.segs[R_CS].base;
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request)
|
||||
{
|
||||
X86CPU *cpu = X86_CPU(cs);
|
||||
CPUX86State *env = &cpu->env;
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
if (interrupt_request & CPU_INTERRUPT_POLL) {
|
||||
return CPU_INTERRUPT_POLL;
|
||||
}
|
||||
#endif
|
||||
if (interrupt_request & CPU_INTERRUPT_SIPI) {
|
||||
return CPU_INTERRUPT_SIPI;
|
||||
}
|
||||
@ -8634,14 +8633,12 @@ int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request)
|
||||
(env->eflags & IF_MASK &&
|
||||
!(env->hflags & HF_INHIBIT_IRQ_MASK))))) {
|
||||
return CPU_INTERRUPT_HARD;
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
} else if (env->hflags2 & HF2_VGIF_MASK) {
|
||||
if((interrupt_request & CPU_INTERRUPT_VIRQ) &&
|
||||
(env->eflags & IF_MASK) &&
|
||||
!(env->hflags & HF_INHIBIT_IRQ_MASK)) {
|
||||
return CPU_INTERRUPT_VIRQ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -8652,6 +8649,7 @@ static bool x86_cpu_has_work(CPUState *cs)
|
||||
{
|
||||
return x86_cpu_pending_interrupt(cs, cs->interrupt_request) != 0;
|
||||
}
|
||||
#endif /* !CONFIG_USER_ONLY */
|
||||
|
||||
int x86_mmu_index_pl(CPUX86State *env, unsigned pl)
|
||||
{
|
||||
@ -8893,6 +8891,7 @@ static const Property x86_cpu_properties[] = {
|
||||
#include "hw/core/sysemu-cpu-ops.h"
|
||||
|
||||
static const struct SysemuCPUOps i386_sysemu_ops = {
|
||||
.has_work = x86_cpu_has_work,
|
||||
.get_memory_mapping = x86_cpu_get_memory_mapping,
|
||||
.get_paging_enabled = x86_cpu_get_paging_enabled,
|
||||
.get_phys_page_attrs_debug = x86_cpu_get_phys_page_attrs_debug,
|
||||
@ -8926,7 +8925,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
cc->class_by_name = x86_cpu_class_by_name;
|
||||
cc->parse_features = x86_cpu_parse_featurestr;
|
||||
cc->has_work = x86_cpu_has_work;
|
||||
cc->mmu_index = x86_cpu_mmu_index;
|
||||
cc->dump_state = x86_cpu_dump_state;
|
||||
cc->set_pc = x86_cpu_set_pc;
|
||||
|
@ -2349,8 +2349,6 @@ struct X86CPUClass {
|
||||
extern const VMStateDescription vmstate_x86_cpu;
|
||||
#endif
|
||||
|
||||
int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
|
||||
|
||||
int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu,
|
||||
int cpuid, DumpState *s);
|
||||
int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
|
||||
@ -2373,6 +2371,8 @@ void x86_cpu_list(void);
|
||||
int cpu_x86_support_mca_broadcast(CPUX86State *env);
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
|
||||
|
||||
hwaddr x86_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr,
|
||||
MemTxAttrs *attrs);
|
||||
int cpu_get_pic_interrupt(CPUX86State *s);
|
||||
|
Loading…
x
Reference in New Issue
Block a user