Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / sysemu / hvf.h
blob730f927f034a834da095b3a7b4fc70b507bc0709
1 /*
2 * QEMU Hypervisor.framework (HVF) support
4 * Copyright Google Inc., 2017
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
9 */
11 /* header to be included in non-HVF-specific code */
13 #ifndef HVF_H
14 #define HVF_H
16 #include "qemu/accel.h"
17 #include "qom/object.h"
19 #ifdef COMPILING_PER_TARGET
20 #include "cpu.h"
22 #ifdef CONFIG_HVF
23 extern bool hvf_allowed;
24 #define hvf_enabled() (hvf_allowed)
25 #else /* !CONFIG_HVF */
26 #define hvf_enabled() 0
27 #endif /* !CONFIG_HVF */
29 #endif /* COMPILING_PER_TARGET */
31 #define TYPE_HVF_ACCEL ACCEL_CLASS_NAME("hvf")
33 typedef struct HVFState HVFState;
34 DECLARE_INSTANCE_CHECKER(HVFState, HVF_STATE,
35 TYPE_HVF_ACCEL)
37 #ifdef COMPILING_PER_TARGET
38 struct hvf_sw_breakpoint {
39 vaddr pc;
40 vaddr saved_insn;
41 int use_count;
42 QTAILQ_ENTRY(hvf_sw_breakpoint) entry;
45 struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu,
46 vaddr pc);
47 int hvf_sw_breakpoints_active(CPUState *cpu);
49 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
50 int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
51 int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type);
52 int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type);
53 void hvf_arch_remove_all_hw_breakpoints(void);
56 * hvf_update_guest_debug:
57 * @cs: CPUState for the CPU to update
59 * Update guest to enable or disable debugging. Per-arch specifics will be
60 * handled by calling down to hvf_arch_update_guest_debug.
62 int hvf_update_guest_debug(CPUState *cpu);
63 void hvf_arch_update_guest_debug(CPUState *cpu);
66 * Return whether the guest supports debugging.
68 bool hvf_arch_supports_guest_debug(void);
69 #endif /* COMPILING_PER_TARGET */
71 #endif