NEED_CPU_H and cpu.h cleanups
Subsystems (9)
cover NEED_CPU_H and cpu.h cleanups
(CCs only on cover letter due to huge series).
This series removes usage of NEED_CPU_H from several central include files in QEMU, most notably hw/hw.h and qemu-common.h. Definitions conditional on NEED_CPU_H remain only in disas/disas.h, exec/gdbstub.h, exec/helper-head.h and exec/log.h.
The interesting patches are interspersed with other miscellaenous cleanups that I won't really dwell on in the cover letter. Most of them are just making indirect inclusions explicit.
Patches 4 to 26 make sure that target-independent code can access QOM objects for the CPU through an opaque type. This is useful because often target-independent code uses a target-specific header file that happens to use pointers to ARMCPU* or similar. The target-independent code itself does not use the pointed-to object, but the very presenece of the ARMCPU* name means that all users of that header have to bring in cpu.h. By providing the opaque type, a much smaller API can be exposed to all these users in hw/.
Patches 33 to 36 remove NEED_CPU_H from hw/hw.h, exec/memory.h and exec/cpu-common.h.
Patches 37 and 38 remove two nested inclusions from qemu-common.h. This should make Markus's patch to remove unnecessary qemu-common.h inclusions even more effective.
Patches 41 and 42 disentangle qemu-common.h and cpu.h, so that all users of the latter have to be explicit.
Patches 45 to 49 remove more nested inclusions, and especially:
1) the inclusion of the (TCG-specific) exec-all.h header from cpu.h, avoiding that non-TCG functions creep in again in exec-all.h; 2) indirect qemu-common.h inclusion in hw/hw.h.
Paolo
Paolo Bonzini (49):
include: move CPU-related definitions out of qemu-common.h
log: do not use CONFIG_USER_ONLY
hw: explicitly include qemu-common.h and cpu.h
cpu: make cpu-qom.h only include-able from cpu.h
target-alpha: make cpu-qom.h not target specific
target-arm: make cpu-qom.h not target specific
target-cris: make cpu-qom.h not target specific
target-i386: make cpu-qom.h not target specific
target-lm32: make cpu-qom.h not target specific
target-m68k: make cpu-qom.h not target specific
target-microblaze: make cpu-qom.h not target specific
target-mips: make cpu-qom.h not target specific
target-ppc: do not use target_ulong in cpu-qom.h
target-ppc: make cpu-qom.h not target specific
target-s390x: make cpu-qom.h not target specific
target-sh4: make cpu-qom.h not target specific
target-sparc: make cpu-qom.h not target specific
target-tricore: make cpu-qom.h not target specific
target-unicore32: make cpu-qom.h not target specific
target-xtensa: make cpu-qom.h not target specific
arm: include cpu-qom.h in files that require ARMCPU
m68k: include cpu-qom.h in files that require M68KCPU
sh4: include cpu-qom.h in files that require SuperHCPU
alpha: include cpu-qom.h in files that require AlphaCPU
mips: use MIPSCPU instead of CPUMIPSState
ppc: use PowerPCCPU instead of CPUPPCState
arm: remove useless cpu.h inclusion
explicitly include qom/cpu.h
explicitly include hw/qdev-core.h
explicitly include linux/kvm.h
apic: move target-dependent definitions to cpu.h
include: poison symbols in osdep.h
hw: do not use VMSTATE_*TL
hw: move CPU state serialization to migration/cpu.h
hw: cannot include hw/hw.h from user emulation
cpu: move endian-dependent load/store functions to cpu-all.h
qemu-common: stop including qemu/bswap.h from qemu-common.h
qemu-common: stop including qemu/host-utils.h from qemu-common.h
gdbstub: remove includes from gdbstub-xml.c
dma: do not depend on kvm_enabled()
s390x: move stuff out of cpu.h
qemu-common: push cpu.h inclusion out of qemu-common.h
arm: move arm_log_exception into .c file
mips: move CP0 functions out of cpu.h
hw: explicitly include qemu/log.h
exec: extract exec/tb-context.h
cpu: move exec-all.h inclusion out of cpu.h
hw: remove pio_addr_t
hw: clean up hw/hw.h includes
arch_init.c | 2 +
audio/mixeng.c | 1 +
audio/noaudio.c | 1 +
audio/wavaudio.c | 2 +-
block/bochs.c | 1 +
block/cloop.c | 1 +
block/parallels.c | 1 +
block/qcow.c | 1 +
block/qcow2-cluster.c | 1 +
block/qcow2-refcount.c | 1 +
block/qcow2-snapshot.c | 1 +
block/qcow2.c | 1 +
block/qed-table.c | 1 +
block/qed.c | 1 +
block/vdi.c | 1 +
block/vhdx-endian.c | 1 +
block/vhdx-log.c | 1 +
block/vhdx.c | 1 +
block/vmdk.c | 1 +
block/vpc.c | 1 +
block/vvfat.c | 1 +
bootdevice.c | 1 +
bsd-user/main.c | 2 +
bsd-user/qemu.h | 1 +
contrib/ivshmem-server/ivshmem-server.c | 1 +
cpu-exec-common.c | 1 +
cpu-exec.c | 1 +
cpus.c | 4 +-
cputlb.c | 1 +
device_tree.c | 1 +
disas/tci.c | 1 +
exec.c | 25 ++--
gdbstub.c | 2 +
hw/acpi/core.c | 6 +
hw/acpi/piix4.c | 1 +
hw/alpha/alpha_sys.h | 1 +
hw/alpha/dp264.c | 2 +
hw/alpha/pci.c | 1 +
hw/arm/allwinner-a10.c | 2 +
hw/arm/armv7m.c | 2 +
hw/arm/bcm2836.c | 2 +
hw/arm/collie.c | 1 +
hw/arm/cubieboard.c | 2 +
hw/arm/digic_boards.c | 2 +
hw/arm/exynos4210.c | 2 +
hw/arm/exynos4_boards.c | 2 +
hw/arm/fsl-imx25.c | 2 +
hw/arm/fsl-imx31.c | 2 +
hw/arm/imx25_pdk.c | 2 +
hw/arm/integratorcp.c | 2 +
hw/arm/kzm.c | 2 +
hw/arm/musicpal.c | 2 +
hw/arm/nseries.c | 3 +
hw/arm/omap1.c | 2 +
hw/arm/omap2.c | 2 +
hw/arm/pxa2xx.c | 2 +
hw/arm/pxa2xx_gpio.c | 2 +
hw/arm/pxa2xx_pic.c | 2 +
hw/arm/raspi.c | 2 +
hw/arm/realview.c | 2 +
hw/arm/stellaris.c | 1 +
hw/arm/stm32f205_soc.c | 1 +
hw/arm/strongarm.c | 2 +
hw/arm/strongarm.h | 1 +
hw/arm/versatilepb.c | 2 +
hw/arm/vexpress.c | 2 +
hw/arm/xilinx_zynq.c | 2 +
hw/arm/xlnx-ep108.c | 3 +
hw/arm/xlnx-zynqmp.c | 2 +
hw/audio/pl041.c | 1 +
hw/block/hd-geometry.c | 1 +
hw/block/m25p80.c | 1 +
hw/block/pflash_cfi01.c | 1 +
hw/bt/hci-csr.c | 1 +
hw/bt/l2cap.c | 1 +
hw/bt/sdp.c | 1 +
hw/char/cadence_uart.c | 4 +
hw/char/digic-uart.c | 1 +
hw/char/imx_serial.c | 1 +
hw/char/pl011.c | 1 +
hw/char/spapr_vty.c | 2 +
hw/char/stm32f2xx_usart.c | 1 +
hw/core/Makefile.objs | 2 +-
hw/core/nmi.c | 5 +
hw/core/qdev-properties.c | 1 +
hw/core/sysbus.c | 4 +-
hw/cpu/a9mpcore.c | 1 +
hw/cris/axis_dev88.c | 2 +
hw/cris/boot.c | 2 +
hw/display/cg3.c | 2 +
hw/display/pl110.c | 1 +
hw/display/sm501.c | 2 +
hw/display/tc6393xb.c | 1 +
hw/display/tcx.c | 1 +
hw/display/virtio-gpu.c | 1 +
hw/dma/pl080.c | 1 +
hw/dma/pl330.c | 1 +
hw/dma/rc4030.c | 1 +
hw/gpio/imx_gpio.c | 1 +
hw/gpio/pl061.c | 1 +
hw/i2c/imx_i2c.c | 1 +
hw/i2c/versatile_i2c.c | 1 +
hw/i386/kvm/apic.c | 2 +
hw/i386/kvm/clock.c | 1 +
hw/i386/kvm/i8254.c | 1 +
hw/i386/kvm/pci-assign.c | 1 +
hw/i386/kvmvapic.c | 3 +
hw/i386/multiboot.c | 2 +
hw/input/pl050.c | 1 +
hw/intc/allwinner-a10-pic.c | 1 +
hw/intc/apic.c | 2 +
hw/intc/apic_common.c | 2 +
hw/intc/arm_gic.c | 1 +
hw/intc/arm_gic_kvm.c | 2 +
hw/intc/arm_gicv2m.c | 2 +
hw/intc/armv7m_nvic.c | 3 +
hw/intc/bcm2835_ic.c | 1 +
hw/intc/bcm2836_control.c | 1 +
hw/intc/i8259.c | 1 +
hw/intc/imx_avic.c | 1 +
hw/intc/ioapic.c | 1 +
hw/intc/openpic.c | 1 +
hw/intc/openpic_kvm.c | 2 +
hw/intc/pl190.c | 1 +
hw/intc/s390_flic_kvm.c | 2 +
hw/intc/sh_intc.c | 2 +
hw/intc/xics.c | 2 +
hw/intc/xics_kvm.c | 2 +
hw/isa/lpc_ich9.c | 2 +
hw/lm32/lm32_boards.c | 2 +
hw/lm32/milkymist.c | 2 +
hw/m68k/an5206.c | 2 +
hw/m68k/dummy_m68k.c | 2 +
hw/m68k/mcf5206.c | 2 +
hw/m68k/mcf5208.c | 2 +
hw/m68k/mcf_intc.c | 2 +
hw/microblaze/boot.c | 2 +
hw/microblaze/petalogix_ml605_mmu.c | 2 +
hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +
hw/mips/cputimer.c | 4 +-
hw/mips/mips_fulong2e.c | 4 +-
hw/mips/mips_int.c | 3 +-
hw/mips/mips_jazz.c | 4 +-
hw/mips/mips_malta.c | 11 +-
hw/mips/mips_mipssim.c | 6 +-
hw/mips/mips_r4k.c | 6 +-
hw/misc/arm11scu.c | 1 +
hw/misc/arm_integrator_debug.c | 1 +
hw/misc/arm_l2x0.c | 1 +
hw/misc/arm_sysctl.c | 1 +
hw/misc/bcm2835_mbox.c | 1 +
hw/misc/bcm2835_property.c | 1 +
hw/misc/imx25_ccm.c | 1 +
hw/misc/imx31_ccm.c | 1 +
hw/misc/imx_ccm.c | 1 +
hw/misc/macio/cuda.c | 1 +
hw/misc/macio/mac_dbdma.c | 1 +
hw/misc/stm32f2xx_syscfg.c | 1 +
hw/misc/zynq-xadc.c | 1 +
hw/misc/zynq_slcr.c | 1 +
hw/moxie/moxiesim.c | 2 +
hw/net/allwinner_emac.c | 1 +
hw/net/fsl_etsec/etsec.c | 1 +
hw/net/fsl_etsec/rings.c | 2 +-
hw/net/imx_fec.c | 1 +
hw/net/lan9118.c | 1 +
hw/net/milkymist-minimac2.c | 2 +
hw/net/spapr_llan.c | 11 +-
hw/net/xilinx_ethlite.c | 2 +
hw/nvram/spapr_nvram.c | 2 +
hw/openrisc/openrisc_sim.c | 2 +
hw/pci-host/apb.c | 1 +
hw/pci-host/versatile.c | 1 +
hw/ppc/e500plat.c | 1 +
hw/ppc/mpc8544_guts.c | 2 +
hw/ppc/ppc.c | 22 ++--
hw/ppc/ppc405_boards.c | 2 +
hw/ppc/ppc405_uc.c | 2 +
hw/ppc/ppc4xx_devs.c | 1 +
hw/ppc/ppc_booke.c | 2 +
hw/ppc/prep.c | 1 +
hw/ppc/spapr.c | 1 +
hw/ppc/spapr_drc.c | 2 +
hw/ppc/spapr_hcall.c | 3 +
hw/ppc/spapr_iommu.c | 1 +
hw/ppc/spapr_pci.c | 2 +
hw/ppc/spapr_pci_vfio.c | 2 +
hw/ppc/spapr_rng.c | 2 +
hw/ppc/spapr_rtas.c | 2 +
hw/ppc/spapr_vio.c | 3 +-
hw/ppc/virtex_ml507.c | 1 +
hw/s390x/css.c | 4 +-
hw/s390x/s390-pci-bus.c | 2 +
hw/s390x/s390-pci-inst.c | 2 +
hw/s390x/s390-skeys.c | 1 +
hw/s390x/s390-virtio-ccw.c | 6 +-
hw/s390x/virtio-ccw.c | 5 +-
hw/s390x/virtio-ccw.h | 3 +-
hw/scsi/spapr_vscsi.c | 2 +
hw/sd/pl181.c | 1 +
hw/sd/sd.c | 1 +
hw/sd/sdhci.c | 1 +
hw/sh4/r2d.c | 2 +
hw/sh4/sh7750.c | 1 +
hw/sh4/shix.c | 2 +
hw/sparc/leon3.c | 2 +
hw/sparc/sun4m.c | 2 +
hw/sparc64/sun4u.c | 2 +
hw/ssi/pl022.c | 1 +
hw/timer/allwinner-a10-pit.c | 1 +
hw/timer/arm_timer.c | 1 +
hw/timer/digic-timer.c | 1 +
hw/timer/ds1338.c | 1 +
hw/timer/imx_epit.c | 1 +
hw/timer/imx_gpt.c | 1 +
hw/timer/mc146818rtc.c | 1 +
hw/timer/pl031.c | 1 +
hw/timer/stm32f2xx_timer.c | 1 +
hw/tricore/tricore_testboard.c | 2 +
hw/unicore32/puv3.c | 2 +
hw/vfio/common.c | 3 +
hw/virtio/virtio.c | 3 +-
hw/watchdog/wdt_diag288.c | 1 +
hw/xtensa/pic_cpu.c | 1 +
hw/xtensa/sim.c | 2 +
hw/xtensa/xtfpga.c | 2 +
include/disas/disas.h | 2 +
include/exec/cpu-all.h | 25 ++++
include/exec/cpu-common.h | 14 --
include/exec/cpu-defs.h | 1 +
include/exec/exec-all.h | 56 +-------
include/exec/gdbstub.h | 2 +
include/exec/helper-head.h | 23 ++--
include/exec/hwaddr.h | 2 +
include/exec/ioport.h | 19 +--
include/exec/memory.h | 17 ---
include/exec/poison.h | 8 --
include/exec/tb-context.h | 46 +++++++
include/hw/acpi/acpi.h | 7 -
include/hw/arm/arm.h | 2 +-
include/hw/arm/digic.h | 1 -
include/hw/arm/exynos4210.h | 1 +
include/hw/arm/omap.h | 1 +
include/hw/arm/pxa.h | 1 +
include/hw/arm/virt-acpi-build.h | 1 +
include/hw/arm/virt.h | 1 +
include/hw/hw.h | 60 +--------
include/hw/i386/apic.h | 5 -
include/hw/isa/isa.h | 2 +-
include/hw/m68k/mcf.h | 2 +
include/hw/mips/cpudevs.h | 7 +-
include/hw/ppc/openpic.h | 3 +-
include/hw/ppc/ppc.h | 24 ++--
include/hw/ppc/spapr_vio.h | 2 +-
{hw => include/hw}/s390x/css.h | 31 ++++-
{target-s390x => include/hw/s390x}/ioinst.h | 16 +--
include/hw/sd/sd.h | 2 +
include/hw/sh4/sh.h | 1 +
include/hw/sysbus.h | 4 +-
include/hw/xen/xen.h | 7 +-
include/migration/cpu.h | 48 +++++++
include/qemu-common.h | 32 -----
include/qemu/log.h | 17 +--
include/qemu/osdep.h | 2 +
include/qemu/timer.h | 2 +-
include/qom/cpu.h | 19 +++
include/sysemu/cpus.h | 13 ++
include/sysemu/dma.h | 5 +-
include/sysemu/kvm.h | 1 +
io/channel-websock.c | 1 +
ioport.c | 14 +-
kvm-stub.c | 1 -
linux-user/main.c | 2 +
linux-user/qemu.h | 1 +
memory.c | 2 +
migration/ram.c | 2 +
migration/savevm.c | 1 +
monitor.c | 4 +
nbd/nbd-internal.h | 1 +
page_cache.c | 1 +
qemu-nbd.c | 1 +
qtest.c | 2 +
scripts/create_config | 2 +-
scripts/feature_to_c.sh | 3 -
scripts/tracetool/format/tcg_helper_c.py | 1 +
slirp/slirp.h | 1 +
stubs/cpu-get-icount.c | 1 +
stubs/slirp.c | 1 +
target-alpha/cpu-qom.h | 41 +-----
target-alpha/cpu.c | 1 +
target-alpha/cpu.h | 44 ++++++-
target-alpha/fpu_helper.c | 1 +
target-alpha/gdbstub.c | 1 +
target-alpha/helper.c | 1 +
target-alpha/int_helper.c | 1 +
target-alpha/machine.c | 3 +
target-alpha/mem_helper.c | 1 +
target-alpha/sys_helper.c | 1 +
target-alpha/translate.c | 1 +
target-alpha/vax_helper.c | 1 +
target-arm/arm_ldst.h | 1 +
target-arm/cpu-qom.h | 178 +------------------------
target-arm/cpu.c | 1 +
target-arm/cpu.h | 181 +++++++++++++++++++++++++-
target-arm/gdbstub.c | 1 +
target-arm/gdbstub64.c | 1 +
target-arm/helper-a64.c | 1 +
target-arm/helper.c | 15 +++
target-arm/internals.h | 15 +--
target-arm/kvm-stub.c | 1 +
target-arm/kvm32.c | 2 +-
target-arm/kvm64.c | 2 +-
target-arm/machine.c | 3 +
target-arm/op_helper.c | 1 +
target-arm/psci.c | 2 +-
target-arm/translate-a64.c | 1 +
target-arm/translate.c | 1 +
target-cris/cpu-qom.h | 40 +-----
target-cris/cpu.c | 1 +
target-cris/cpu.h | 43 +++++-
target-cris/gdbstub.c | 1 +
target-cris/helper.c | 1 +
target-cris/machine.c | 3 +
target-cris/mmu.c | 1 +
target-cris/op_helper.c | 1 +
target-cris/translate.c | 1 +
target-i386/bpt_helper.c | 1 +
target-i386/cpu-qom.h | 98 +-------------
target-i386/cpu.c | 3 +-
target-i386/cpu.h | 107 ++++++++++++++-
target-i386/excp_helper.c | 1 +
target-i386/fpu_helper.c | 1 +
target-i386/gdbstub.c | 1 +
target-i386/helper.c | 1 +
target-i386/int_helper.c | 1 +
target-i386/kvm-stub.c | 1 +
target-i386/kvm.c | 2 +-
target-i386/machine.c | 6 +
target-i386/mem_helper.c | 1 +
target-i386/misc_helper.c | 1 +
target-i386/mpx_helper.c | 1 +
target-i386/seg_helper.c | 1 +
target-i386/svm_helper.c | 1 +
target-i386/translate.c | 1 +
target-lm32/cpu-qom.h | 42 +-----
target-lm32/cpu.c | 1 +
target-lm32/cpu.h | 46 ++++++-
target-lm32/gdbstub.c | 1 +
target-lm32/helper.c | 1 +
target-lm32/machine.c | 3 +
target-lm32/op_helper.c | 1 +
target-lm32/translate.c | 1 +
target-m68k/cpu-qom.h | 34 +----
target-m68k/cpu.c | 1 +
target-m68k/cpu.h | 38 +++++-
target-m68k/gdbstub.c | 1 +
target-m68k/helper.c | 1 +
target-m68k/m68k-semi.c | 1 +
target-m68k/op_helper.c | 1 +
target-m68k/translate.c | 1 +
target-microblaze/cpu-qom.h | 44 +------
target-microblaze/cpu.c | 1 +
target-microblaze/cpu.h | 47 ++++++-
target-microblaze/gdbstub.c | 1 +
target-microblaze/helper.c | 1 +
target-microblaze/mmu.c | 1 +
target-microblaze/op_helper.c | 1 +
target-microblaze/translate.c | 1 +
target-mips/cpu-qom.h | 37 +-----
target-mips/cpu.c | 1 +
target-mips/cpu.h | 171 ++++++------------------
target-mips/gdbstub.c | 1 +
target-mips/helper.c | 126 ++++++++++++++++++
target-mips/kvm.c | 2 +-
target-mips/machine.c | 4 +-
target-mips/mips-semi.c | 1 +
target-mips/msa_helper.c | 1 +
target-mips/op_helper.c | 1 +
target-mips/translate.c | 1 +
target-moxie/cpu.c | 1 +
target-moxie/cpu.h | 1 -
target-moxie/machine.c | 3 +
target-openrisc/cpu.c | 1 +
target-openrisc/cpu.h | 2 -
target-openrisc/exception.c | 1 +
target-openrisc/gdbstub.c | 1 +
target-openrisc/interrupt.c | 1 +
target-openrisc/interrupt_helper.c | 1 +
target-openrisc/machine.c | 3 +
target-openrisc/mmu.c | 1 +
target-openrisc/mmu_helper.c | 1 +
target-openrisc/sys_helper.c | 1 +
target-ppc/cpu-qom.h | 159 +++++++++++++++--------
target-ppc/cpu.h | 164 ++++++++---------------
target-ppc/excp_helper.c | 1 +
target-ppc/gdbstub.c | 1 +
target-ppc/int_helper.c | 1 +
target-ppc/kvm-stub.c | 1 +
target-ppc/kvm.c | 2 +-
target-ppc/machine.c | 5 +
target-ppc/mem_helper.c | 2 +
target-ppc/misc_helper.c | 1 +
target-ppc/mmu-hash32.c | 3 +-
target-ppc/mmu-hash32.h | 2 +-
target-ppc/mmu-hash64.c | 3 +-
target-ppc/mmu-hash64.h | 2 +-
target-ppc/mmu_helper.c | 1 +
target-ppc/timebase_helper.c | 1 +
target-ppc/translate.c | 1 +
target-ppc/translate_init.c | 92 ++++++-------
target-s390x/cc_helper.c | 1 +
target-s390x/cpu-qom.h | 46 +------
target-s390x/cpu.c | 4 +-
target-s390x/cpu.h | 166 ++++++++++-------------
target-s390x/fpu_helper.c | 1 +
target-s390x/gdbstub.c | 2 +
target-s390x/helper.c | 2 +
target-s390x/int_helper.c | 1 +
target-s390x/interrupt.c | 64 +++++++++
target-s390x/ioinst.c | 2 +-
target-s390x/kvm.c | 2 +-
target-s390x/mem_helper.c | 4 +
target-s390x/misc_helper.c | 3 +-
target-s390x/translate.c | 1 +
target-sh4/cpu-qom.h | 31 +----
target-sh4/cpu.c | 1 +
target-sh4/cpu.h | 34 ++++-
target-sh4/gdbstub.c | 1 +
target-sh4/helper.c | 1 +
target-sh4/op_helper.c | 1 +
target-sh4/translate.c | 1 +
target-sparc/cpu-qom.h | 38 +-----
target-sparc/cpu.c | 1 +
target-sparc/cpu.h | 40 +++++-
target-sparc/gdbstub.c | 1 +
target-sparc/helper.c | 1 +
target-sparc/ldst_helper.c | 1 +
target-sparc/machine.c | 6 +
target-sparc/mmu_helper.c | 1 +
target-sparc/translate.c | 1 +
target-tilegx/cpu.c | 1 +
target-tilegx/cpu.h | 2 -
target-tilegx/helper.c | 1 +
target-tilegx/translate.c | 1 +
target-tricore/cpu-qom.h | 28 +---
target-tricore/cpu.c | 1 +
target-tricore/cpu.h | 32 ++++-
target-tricore/helper.c | 1 +
target-tricore/op_helper.c | 1 +
target-tricore/translate.c | 1 +
target-unicore32/cpu-qom.h | 30 +----
target-unicore32/cpu.c | 1 +
target-unicore32/cpu.h | 32 ++++-
target-unicore32/helper.c | 1 +
target-unicore32/op_helper.c | 1 +
target-unicore32/softmmu.c | 1 +
target-unicore32/translate.c | 1 +
target-xtensa/cpu-qom.h | 194 ++++++++++++++++++++++-----
target-xtensa/cpu.c | 1 +
target-xtensa/cpu.h | 195 +++++-----------------------
target-xtensa/gdbstub.c | 2 +
target-xtensa/op_helper.c | 1 +
target-xtensa/translate.c | 1 +
tcg/optimize.c | 3 +-
tcg/tcg-common.c | 2 +
tcg/tcg-op.c | 3 +
tcg/tcg.c | 7 +-
tcg/tcg.h | 23 ++++
tests/ide-test.c | 1 +
tests/libqos/malloc.c | 1 +
translate-all.c | 1 +
translate-common.c | 1 +
ui/vnc-ws.c | 1 +
user-exec.c | 1 +
util/buffer.c | 1 +
util/log.c | 11 +-
vl.c | 2 +
xen-hvm.c | 8 +-
478 files changed, 2249 insertions(+), 1730 deletions(-)
create mode 100644 include/exec/tb-context.h
rename {hw => include/hw}/s390x/css.h (76%)
rename {target-s390x => include/hw/s390x}/ioinst.h (87%)
create mode 100644 include/migration/cpu.hSignature · 1 line
1.8.3.1
PATCH 1/49 include: move CPU-related definitions out of qemu-common.h
--- hw/core/qdev-properties.c | 1 + include/qemu-common.h | 24 ------------------------ include/qemu/timer.h | 1 + include/qom/cpu.h | 9 +++++++++ include/sysemu/cpus.h | 13 +++++++++++++ stubs/cpu-get-icount.c | 1 + translate-common.c | 1 + vl.c | 1 + 8 files changed, 27 insertions(+), 24 deletions(-)
hw/core/qdev-properties.c +1 -0
@@ -7,6 +7,7 @@#include "qemu/error-report.h" #include "sysemu/block-backend.h" #include "hw/block/block.h" +#include "hw/pci/pci.h" #include "net/hub.h" #include "qapi/visitor.h" #include "sysemu/char.h"
include/qemu-common.h +0 -24
@@ -23,17 +23,6 @@#include "qemu/option.h" #include "qemu/host-utils.h" -void cpu_ticks_init (void ); - -/* icount */ -void configure_icount (QemuOpts *opts,Error **errp); -extern int use_icount; -extern int icount_align_option; -/* drift information for info jit command */ -extern int64_t max_delay; -extern int64_t max_advance; -void dump_drift_info (FILE *f,fprintf_function cpu_fprintf); -#include "qemu/bswap.h" /* FIXME: Remove NEED_CPU_H. */
@@ -299,19 +288,6 @@ bool tcg_enabled(void);void cpu_exec_init_all (void ); -/* Unblock cpu */ -void qemu_cpu_kick_self (void ); - -/* work queue */ -struct qemu_work_item { -struct qemu_work_item *next; -void (*func)(void *data); -void *data; -int done; -bool free; -}; - -/** * Sends a (part of) iovec down a socket, yielding when the socket is full, or * Receives data into a (part of) iovec from a socket,
include/qemu/timer.h +1 -0
@@ -4,6 +4,7 @@#include "qemu-common.h" #include "qemu/notify.h" #include "qemu/host-utils.h" +#include "sysemu/cpus.h" #define NANOSECONDS_PER_SECOND 1000000000LL
include/qom/cpu.h +9 -0
@@ -223,6 +223,15 @@ struct kvm_run;#define TB_JMP_CACHE_BITS 12#define TB_JMP_CACHE_SIZE (1 << TB_JMP_CACHE_BITS) +/* work queue */ +struct qemu_work_item { +struct qemu_work_item *next; +void (*func)(void *data); +void *data; +int done; +bool free; +}; +/** * CPUState: * @cpu_index: CPU index (informative).
include/sysemu/cpus.h +13 -0
@@ -7,6 +7,19 @@ void qemu_init_cpu_loop(void);void resume_all_vcpus (void );void pause_all_vcpus (void );void cpu_stop_current (void ); +void cpu_ticks_init (void ); + +void configure_icount (QemuOpts *opts,Error **errp); +extern int use_icount; +extern int icount_align_option; + +/* drift information for info jit command */ +extern int64_t max_delay; +extern int64_t max_advance; +void dump_drift_info (FILE *f,fprintf_function cpu_fprintf); + +/* Unblock cpu */ +void qemu_cpu_kick_self (void );void cpu_synchronize_all_states (void );void cpu_synchronize_all_post_reset (void );
stubs/cpu-get-icount.c +1 -0
@@ -1,6 +1,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/timer.h" +#include "sysemu/cpus.h" int use_icount;
translate-common.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "qom/cpu.h" +#include "sysemu/cpus.h" uintptr_t qemu_real_host_page_size;intptr_t qemu_real_host_page_mask;
vl.c +1 -0
@@ -86,6 +86,7 @@ int main(int argc, char **argv)#include "sysemu/dma.h" #include "audio/audio.h" #include "migration/migration.h" +#include "sysemu/cpus.h" #include "sysemu/kvm.h" #include "qapi/qmp/qjson.h" #include "qemu/option.h"
Signature · 1 line
1.8.3.1
PATCH 2/49 log: do not use CONFIG_USER_ONLY
In reply to Paolo BonziniThis decouples logging further from config-target.h
--- bsd-user/main.c | 1 + include/qemu/log.h | 17 ++--------------- linux-user/main.c | 1 + util/log.c | 11 +++++++++-- 4 files changed, 13 insertions(+), 17 deletions(-)
bsd-user/main.c +1 -0
@@ -848,6 +848,7 @@ int main(int argc, char **argv) }/* init debug */ +qemu_log_needs_buffers ();qemu_set_log_filename (log_file);if (log_mask) {int mask;
include/qemu/log.h +2 -15
@@ -99,21 +99,8 @@ typedef struct QEMULogItem {extern const QEMULogItem qemu_log_items[]; -/* This is the function that actually does the work of -* changing the log level; it should only be accessed via -* the qemu_set_log() wrapper. -*/ -void do_qemu_set_log (int log_flags,bool use_own_buffers); - -static inline void qemu_set_log (int log_flags) -{ -#ifdef CONFIG_USER_ONLY -do_qemu_set_log (log_flags, true); -#else -do_qemu_set_log (log_flags, false); -#endif -} - +void qemu_set_log (int log_flags); +void qemu_log_needs_buffers (void );void qemu_set_log_filename (const char *filename);int qemu_str_to_log_mask (const char *str);
linux-user/main.c +1 -0
@@ -3752,6 +3752,7 @@ static void handle_arg_log(const char *arg)qemu_print_log_usage (stdout);exit (EXIT_FAILURE ); } +qemu_log_needs_buffers ();qemu_set_log (mask); }
util/log.c +9 -2
@@ -49,8 +49,10 @@ void qemu_log_mask(int mask, const char *fmt, ...)va_end (ap); } +static bool log_uses_own_buffers; +/* enable or disable low levels log */ -void do_qemu_set_log (int log_flags,bool use_own_buffers) +void qemu_set_log (int log_flags) { qemu_loglevel = log_flags;#ifdef CONFIG_TRACE_LOG
@@ -77,7 +79,7 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers) qemu_logfile = stderr; }/* must avoid mmap() usage of glibc by setting a buffer "by hand" */ -if (use_own_buffers) { +if (log_uses_own_buffers) {static char logfile_buf[4096 ];setvbuf (qemu_logfile, logfile_buf, _IOLBF,sizeof (logfile_buf));
@@ -97,6 +99,11 @@ void do_qemu_set_log(int log_flags, bool use_own_buffers) } } +void qemu_log_needs_buffers (void ) +{ + log_uses_own_buffers = true; +} +void qemu_set_log_filename (const char *filename) {g_free (logfilename);
Signature · 1 line
1.8.3.1
PATCH 3/49 hw: explicitly include qemu-common.h and cpu.h
In reply to Paolo Bonzini--- hw/alpha/dp264.c | 2 ++ hw/alpha/pci.c | 2 ++ hw/arm/allwinner-a10.c | 2 ++ hw/arm/armv7m.c | 2 ++ hw/arm/bcm2836.c | 2 ++ hw/arm/cubieboard.c | 2 ++ hw/arm/digic_boards.c | 2 ++ hw/arm/exynos4210.c | 2 ++ hw/arm/exynos4_boards.c | 2 ++ hw/arm/fsl-imx25.c | 2 ++ hw/arm/fsl-imx31.c | 2 ++ hw/arm/imx25_pdk.c | 2 ++ hw/arm/integratorcp.c | 2 ++ hw/arm/kzm.c | 2 ++ hw/arm/musicpal.c | 2 ++ hw/arm/omap1.c | 2 ++ hw/arm/omap2.c | 2 ++ hw/arm/pxa2xx.c | 2 ++ hw/arm/pxa2xx_pic.c | 2 ++ hw/arm/raspi.c | 2 ++ hw/arm/realview.c | 2 ++ hw/arm/stm32f205_soc.c | 2 ++ hw/arm/strongarm.c | 1 + hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 2 ++ hw/arm/xilinx_zynq.c | 2 ++ hw/arm/xlnx-ep108.c | 2 ++ hw/arm/xlnx-zynqmp.c | 2 ++ hw/char/spapr_vty.c | 2 ++ hw/cris/axis_dev88.c | 2 ++ hw/cris/boot.c | 2 ++ hw/display/sm501.c | 2 ++ hw/display/tcx.c | 1 + hw/i386/multiboot.c | 2 ++ hw/intc/armv7m_nvic.c | 1 + hw/intc/sh_intc.c | 2 ++ hw/intc/xics.c | 2 ++ hw/intc/xics_kvm.c | 2 ++ hw/isa/lpc_ich9.c | 1 + hw/lm32/lm32_boards.c | 2 ++ hw/lm32/milkymist.c | 2 ++ hw/m68k/an5206.c | 2 ++ hw/m68k/dummy_m68k.c | 2 ++ hw/m68k/mcf5206.c | 2 ++ hw/m68k/mcf5208.c | 2 ++ hw/m68k/mcf_intc.c | 2 ++ hw/microblaze/boot.c | 2 ++ hw/microblaze/petalogix_ml605_mmu.c | 2 ++ hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 ++ hw/mips/mips_malta.c | 2 ++ hw/mips/mips_mipssim.c | 2 ++ hw/mips/mips_r4k.c | 2 ++ hw/moxie/moxiesim.c | 2 ++ hw/net/milkymist-minimac2.c | 2 ++ hw/net/spapr_llan.c | 2 ++ hw/net/xilinx_ethlite.c | 2 ++ hw/nvram/spapr_nvram.c | 2 ++ hw/openrisc/openrisc_sim.c | 2 ++ hw/ppc/mpc8544_guts.c | 2 ++ hw/ppc/ppc.c | 2 ++ hw/ppc/ppc405_boards.c | 2 ++ hw/ppc/ppc405_uc.c | 2 ++ hw/ppc/ppc_booke.c | 2 ++ hw/ppc/spapr_drc.c | 2 ++ hw/ppc/spapr_pci.c | 2 ++ hw/ppc/spapr_pci_vfio.c | 2 ++ hw/ppc/spapr_rng.c | 2 ++ hw/s390x/s390-pci-bus.c | 2 ++ hw/s390x/s390-pci-inst.c | 2 ++ hw/s390x/s390-virtio-ccw.c | 2 ++ hw/scsi/spapr_vscsi.c | 2 ++ hw/sh4/r2d.c | 2 ++ hw/sh4/shix.c | 2 ++ hw/sparc/leon3.c | 2 ++ hw/sparc/sun4m.c | 2 ++ hw/sparc64/sun4u.c | 2 ++ hw/timer/ds1338.c | 1 + hw/timer/mc146818rtc.c | 1 + hw/tricore/tricore_testboard.c | 2 ++ hw/unicore32/puv3.c | 2 ++ hw/virtio/virtio.c | 3 ++- hw/xtensa/sim.c | 2 ++ hw/xtensa/xtfpga.c | 2 ++ 83 files changed, 160 insertions(+), 1 deletion(-)
hw/alpha/dp264.c +2 -0
@@ -7,6 +7,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "elf.h" #include "hw/loader.h"
hw/alpha/pci.c +2 -0
@@ -7,6 +7,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "alpha_sys.h" #include "qemu/log.h" #include "sysemu/sysemu.h"
hw/arm/allwinner-a10.c +2 -0
@@ -17,6 +17,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/devices.h" #include "hw/arm/allwinner-a10.h"
hw/arm/armv7m.c +2 -0
@@ -9,6 +9,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/arm.h" #include "hw/loader.h"
hw/arm/bcm2836.c +2 -0
@@ -10,6 +10,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/bcm2836.h" #include "hw/arm/raspi_platform.h" #include "hw/sysbus.h"
hw/arm/cubieboard.c +2 -0
@@ -17,6 +17,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/devices.h" #include "hw/boards.h"
hw/arm/digic_boards.c +2 -0
@@ -25,6 +25,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/boards.h" #include "exec/address-spaces.h" #include "qemu/error-report.h"
hw/arm/exynos4210.c +2 -0
@@ -23,6 +23,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/boards.h" #include "sysemu/sysemu.h" #include "hw/sysbus.h"
hw/arm/exynos4_boards.c +2 -0
@@ -22,6 +22,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "sysemu/sysemu.h" #include "sysemu/qtest.h" #include "hw/sysbus.h"
hw/arm/fsl-imx25.c +2 -0
@@ -24,6 +24,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/fsl-imx25.h" #include "sysemu/sysemu.h" #include "exec/address-spaces.h"
hw/arm/fsl-imx31.c +2 -0
@@ -21,6 +21,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/fsl-imx31.h" #include "sysemu/sysemu.h" #include "exec/address-spaces.h"
hw/arm/imx25_pdk.c +2 -0
@@ -25,6 +25,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/fsl-imx25.h" #include "hw/boards.h" #include "qemu/error-report.h"
hw/arm/integratorcp.c +2 -0
@@ -9,6 +9,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/devices.h" #include "hw/boards.h"
hw/arm/kzm.c +2 -0
@@ -15,6 +15,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/fsl-imx31.h" #include "hw/boards.h" #include "qemu/error-report.h"
hw/arm/musicpal.c +2 -0
@@ -11,6 +11,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/arm.h" #include "hw/devices.h"
hw/arm/omap1.c +2 -0
@@ -19,6 +19,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/boards.h" #include "hw/hw.h" #include "hw/arm/arm.h"
hw/arm/omap2.c +2 -0
@@ -20,6 +20,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "hw/boards.h"
hw/arm/pxa2xx.c +2 -0
@@ -9,6 +9,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/pxa.h" #include "sysemu/sysemu.h"
hw/arm/pxa2xx_pic.c +2 -0
@@ -9,6 +9,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/arm/pxa.h" #include "hw/sysbus.h"
hw/arm/raspi.c +2 -0
@@ -10,6 +10,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/bcm2836.h" #include "qemu/error-report.h" #include "hw/boards.h"
hw/arm/realview.c +2 -0
@@ -9,6 +9,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/arm.h" #include "hw/arm/primecell.h"
hw/arm/stm32f205_soc.c +2 -0
@@ -24,6 +24,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/arm.h" #include "exec/address-spaces.h" #include "hw/arm/stm32f205_soc.h"
hw/arm/strongarm.c +1 -0
@@ -28,6 +28,7 @@*/ #include "qemu/osdep.h" +#include "cpu.h" #include "hw/boards.h" #include "hw/sysbus.h" #include "strongarm.h"
hw/arm/versatilepb.c +2 -0
@@ -9,6 +9,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/arm.h" #include "hw/devices.h"
hw/arm/vexpress.c +2 -0
@@ -23,6 +23,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/arm.h" #include "hw/arm/primecell.h"
hw/arm/xilinx_zynq.c +2 -0
@@ -17,6 +17,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/arm/arm.h" #include "net/net.h"
hw/arm/xlnx-ep108.c +2 -0
@@ -17,6 +17,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/xlnx-zynqmp.h" #include "hw/boards.h" #include "qemu/error-report.h"
hw/arm/xlnx-zynqmp.c +2 -0
@@ -17,6 +17,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/arm/xlnx-zynqmp.h" #include "hw/intc/arm_gic_common.h" #include "exec/address-spaces.h"
hw/char/spapr_vty.c +2 -0
@@ -1,5 +1,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/qdev.h" #include "sysemu/char.h" #include "hw/ppc/spapr.h"
hw/cris/axis_dev88.c +2 -0
@@ -24,6 +24,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "net/net.h" #include "hw/block/flash.h"
hw/cris/boot.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/loader.h" #include "elf.h"
hw/display/sm501.c +2 -0
@@ -24,6 +24,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/char/serial.h" #include "ui/console.h"
hw/display/tcx.c +1 -0
@@ -25,6 +25,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "cpu.h" /* FIXME shouldn't use TARGET_PAGE_SIZE */ #include "ui/console.h" #include "ui/pixel_ops.h" #include "hw/loader.h"
hw/i386/multiboot.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/nvram/fw_cfg.h" #include "multiboot.h"
hw/intc/armv7m_nvic.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" #include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/arm/arm.h"
hw/intc/sh_intc.c +2 -0
@@ -9,6 +9,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sh4/sh_intc.h" #include "hw/hw.h" #include "hw/sh4/sh.h"
hw/intc/xics.c +2 -0
@@ -27,6 +27,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "trace.h" #include "qemu/timer.h"
hw/intc/xics_kvm.c +2 -0
@@ -26,6 +26,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "trace.h" #include "hw/ppc/spapr.h"
hw/isa/lpc_ich9.c +1 -0
@@ -29,6 +29,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "qapi/visitor.h" #include "qemu/range.h"
hw/lm32/lm32_boards.c +2 -0
@@ -18,6 +18,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" #include "hw/block/flash.h"
hw/lm32/milkymist.c +2 -0
@@ -18,6 +18,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" #include "hw/block/flash.h"
hw/m68k/an5206.c +2 -0
@@ -8,6 +8,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/m68k/mcf.h" #include "hw/boards.h"
hw/m68k/dummy_m68k.c +2 -0
@@ -7,6 +7,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/loader.h"
hw/m68k/mcf5206.c +2 -0
@@ -6,6 +6,8 @@* This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/m68k/mcf.h" #include "qemu/timer.h"
hw/m68k/mcf5208.c +2 -0
@@ -7,6 +7,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/m68k/mcf.h" #include "qemu/timer.h"
hw/m68k/mcf_intc.c +2 -0
@@ -6,6 +6,8 @@* This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/m68k/mcf.h" #include "exec/address-spaces.h"
hw/microblaze/boot.c +2 -0
@@ -25,6 +25,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/error-report.h"
hw/microblaze/petalogix_ml605_mmu.c +2 -0
@@ -27,6 +27,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" #include "net/net.h"
hw/microblaze/petalogix_s3adsp1800_mmu.c +2 -0
@@ -25,6 +25,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" #include "net/net.h"
hw/mips/mips_malta.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h"
hw/mips/mips_mipssim.c +2 -0
@@ -26,6 +26,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h"
hw/mips/mips_r4k.c +2 -0
@@ -9,6 +9,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/mips/mips.h" #include "hw/mips/cpudevs.h"
hw/moxie/moxiesim.c +2 -0
@@ -26,6 +26,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" #include "hw/i386/pc.h"
hw/net/milkymist-minimac2.c +2 -0
@@ -24,6 +24,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" /* FIXME: why does this use TARGET_PAGE_ALIGN? */ #include "hw/hw.h" #include "hw/sysbus.h" #include "trace.h"
hw/net/spapr_llan.c +2 -0
@@ -25,6 +25,8 @@* */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "net/net.h" #include "hw/qdev.h"
hw/net/xilinx_ethlite.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" /* FIXME should not use tswap* */ #include "hw/sysbus.h" #include "hw/hw.h" #include "net/net.h"
hw/nvram/spapr_nvram.c +2 -0
@@ -24,6 +24,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include <libfdt.h> #include "sysemu/block-backend.h"
hw/openrisc/openrisc_sim.c +2 -0
@@ -20,6 +20,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "elf.h"
hw/ppc/mpc8544_guts.c +2 -0
@@ -18,6 +18,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "sysemu/sysemu.h" #include "hw/sysbus.h"
hw/ppc/ppc.c +2 -0
@@ -22,6 +22,8 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" #include "hw/ppc/ppc_e500.h"
hw/ppc/ppc405_boards.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" #include "ppc405.h"
hw/ppc/ppc405_uc.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" #include "hw/boards.h"
hw/ppc/ppc_booke.c +2 -0
@@ -22,6 +22,8 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" #include "qemu/timer.h"
hw/ppc/spapr_drc.c +2 -0
@@ -12,6 +12,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/ppc/spapr_drc.h" #include "qom/object.h" #include "hw/qdev.h"
hw/ppc/spapr_pci.c +2 -0
@@ -24,6 +24,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/sysbus.h" #include "hw/pci/pci.h"
hw/ppc/spapr_pci_vfio.c +2 -0
@@ -19,6 +19,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/ppc/spapr.h" #include "hw/pci-host/spapr.h" #include "hw/pci/msix.h"
hw/ppc/spapr_rng.c +2 -0
@@ -19,6 +19,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "qemu/error-report.h" #include "sysemu/sysemu.h" #include "sysemu/device_tree.h"
hw/s390x/s390-pci-bus.c +2 -0
@@ -12,6 +12,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "s390-pci-bus.h" #include <hw/pci/pci_bus.h> #include <hw/pci/msi.h>
hw/s390x/s390-pci-inst.c +2 -0
@@ -12,6 +12,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "s390-pci-inst.h" #include "s390-pci-bus.h" #include <exec/memory-internal.h>
hw/s390x/s390-virtio-ccw.c +2 -0
@@ -11,6 +11,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/boards.h" #include "exec/address-spaces.h" #include "s390-virtio.h"
hw/scsi/spapr_vscsi.c +2 -0
@@ -32,6 +32,8 @@* - Maybe do autosense (PAPR seems to mandate it, linux doesn't care) */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/scsi/scsi.h" #include "block/scsi.h"
hw/sh4/r2d.c +2 -0
@@ -25,6 +25,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" #include "hw/sh4/sh.h"
hw/sh4/shix.c +2 -0
@@ -29,6 +29,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/sh4/sh.h" #include "sysemu/sysemu.h"
hw/sparc/leon3.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "qemu/timer.h" #include "hw/ptimer.h"
hw/sparc/sun4m.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "qemu/error-report.h" #include "qemu/timer.h"
hw/sparc64/sun4u.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/pci-host/apb.h"
hw/timer/ds1338.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" #include "hw/i2c/i2c.h" /* Size of NVRAM including both the user-accessible area and the
hw/timer/mc146818rtc.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "config-target.h" #include "hw/hw.h" #include "qemu/timer.h" #include "sysemu/sysemu.h"
hw/tricore/tricore_testboard.c +2 -0
@@ -20,6 +20,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/devices.h" #include "net/net.h"
hw/unicore32/puv3.c +2 -0
@@ -12,6 +12,8 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "cpu.h" +#include "qemu-common.h" #include "ui/console.h" #include "elf.h" #include "exec/address-spaces.h"
hw/virtio/virtio.c +2 -1
@@ -13,7 +13,8 @@#include "qemu/osdep.h" #include "qapi/error.h" - +#include "qemu-common.h" +#include "cpu.h" #include "trace.h" #include "exec/address-spaces.h" #include "qemu/error-report.h"
hw/xtensa/sim.c +2 -0
@@ -27,6 +27,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "sysemu/sysemu.h" #include "hw/boards.h" #include "hw/loader.h"
hw/xtensa/xtfpga.c +2 -0
@@ -27,6 +27,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "sysemu/sysemu.h" #include "hw/boards.h" #include "hw/loader.h"
Signature · 1 line
1.8.3.1
PATCH 4/49 cpu: make cpu-qom.h only include-able from cpu.h
In reply to Paolo BonziniMake cpu-qom.h so that it is only included from cpu.h. Then there is no need for it to include cpu.h again.
Later we will make cpu-qom.h target independent and we will _want_ to include it from elsewhere, but for now reduce the number of cases to handle.
--- target-alpha/cpu-qom.h | 1 - target-arm/psci.c | 1 - target-i386/cpu-qom.h | 1 - target-lm32/cpu-qom.h | 1 - target-ppc/cpu-qom.h | 1 - target-s390x/cpu-qom.h | 1 - target-sparc/cpu-qom.h | 1 - target-unicore32/cpu-qom.h | 1 - target-xtensa/cpu-qom.h | 1 - 9 files changed, 9 deletions(-)
target-alpha/cpu-qom.h +0 -1
@@ -21,7 +21,6 @@#define QEMU_ALPHA_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #define TYPE_ALPHA_CPU "alpha-cpu"
target-arm/psci.c +0 -1
@@ -17,7 +17,6 @@*/ #include "qemu/osdep.h" #include <cpu.h> -#include <cpu-qom.h> #include <exec/helper-proto.h> #include <kvm-consts.h> #include <sysemu/sysemu.h>
target-i386/cpu-qom.h +0 -1
@@ -21,7 +21,6 @@#define QEMU_I386_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #include "qemu/notify.h" #ifdef TARGET_X86_64
target-lm32/cpu-qom.h +0 -1
@@ -21,7 +21,6 @@#define QEMU_LM32_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #define TYPE_LM32_CPU "lm32-cpu"
target-ppc/cpu-qom.h +0 -1
@@ -21,7 +21,6 @@#define QEMU_PPC_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #ifdef TARGET_PPC64 #define TYPE_POWERPC_CPU "powerpc64-cpu"
target-s390x/cpu-qom.h +0 -1
@@ -21,7 +21,6 @@#define QEMU_S390_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #define TYPE_S390_CPU "s390-cpu"
target-sparc/cpu-qom.h +0 -1
@@ -21,7 +21,6 @@#define QEMU_SPARC_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #ifdef TARGET_SPARC64 #define TYPE_SPARC_CPU "sparc64-cpu"
target-unicore32/cpu-qom.h +0 -1
@@ -12,7 +12,6 @@#define QEMU_UC32_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #define TYPE_UNICORE32_CPU "unicore32-cpu"
target-xtensa/cpu-qom.h +0 -1
@@ -30,7 +30,6 @@#define QEMU_XTENSA_CPU_QOM_H #include "qom/cpu.h" -#include "cpu.h" #define TYPE_XTENSA_CPU "xtensa-cpu"
Signature · 1 line
1.8.3.1
PATCH 5/49 target-alpha: make cpu-qom.h not target specific
In reply to Paolo BonziniMake AlphaCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-alpha/cpu-qom.h | 40 +--------------------------------------- target-alpha/cpu.h | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 40 deletions(-)
target-alpha/cpu-qom.h +1 -39
@@ -47,44 +47,6 @@ typedef struct AlphaCPUClass { void (*parent_reset)(CPUState *cpu); } AlphaCPUClass; -/** -* AlphaCPU: -* @env: #CPUAlphaState -* -* An Alpha CPU. -*/ -typedef struct AlphaCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUAlphaState env; - -/* This alarm doesn't exist in real hardware; we wish it did. */ -QEMUTimer *alarm_timer; -}AlphaCPU ; - -static inline AlphaCPU *alpha_env_get_cpu (CPUAlphaState *env) -{ -return container_of (env, AlphaCPU, env); -} - -#define ENV_GET_CPU (e) CPU(alpha_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(AlphaCPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_alpha_cpu; -#endif - -void alpha_cpu_do_interrupt (CPUState *cpu); -bool alpha_cpu_exec_interrupt (CPUState *cpu,int int_req); -void alpha_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); -hwaddr alpha_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int alpha_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int alpha_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -void alpha_cpu_do_unaligned_access (CPUState *cpu,vaddr addr, -int is_write,int is_user,uintptr_t retaddr); +typedef struct AlphaCPU AlphaCPU ;#endif
target-alpha/cpu.h +41 -1
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 6/49 target-arm: make cpu-qom.h not target specific
In reply to Paolo BonziniMake ARMCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-arm/cpu-qom.h | 178 +------------------------------------------------- target-arm/cpu.h | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 179 insertions(+), 178 deletions(-)
target-arm/cpu-qom.h +3 -175
@@ -22,6 +22,8 @@#include "qom/cpu.h" +struct arm_boot_info ; +#define TYPE_ARM_CPU "arm-cpu"#define ARM_CPU_CLASS (klass) \
@@ -47,145 +49,7 @@ typedef struct ARMCPUClass {void (*parent_reset)(CPUState *cpu); } ARMCPUClass; -/** -* ARMCPU: -* @env: #CPUARMState -* -* An ARM CPU core. -*/ -typedef struct ARMCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUARMState env; - -/* Coprocessor information */ -GHashTable *cp_regs; -/* For marshalling (mostly coprocessor) register state between the -* kernel and QEMU (for KVM) and between two QEMUs (for migration), -* we use these arrays. -*/ -/* List of register indexes managed via these arrays; (full KVM style -* 64 bit indexes, not CPRegInfo 32 bit indexes) -*/ -uint64_t *cpreg_indexes; -/* Values of the registers (cpreg_indexes[i]'s value is cpreg_values[i]) */ -uint64_t *cpreg_values; -/* Length of the indexes, values, reset_values arrays */ -int32_t cpreg_array_len; -/* These are used only for migration: incoming data arrives in -* these fields and is sanity checked in post_load before copying -* to the working data structures above. -*/ -uint64_t *cpreg_vmstate_indexes; -uint64_t *cpreg_vmstate_values; -int32_t cpreg_vmstate_array_len; - -/* Timers used by the generic (architected) timer */ -QEMUTimer *gt_timer[NUM_GTIMERS ]; -/* GPIO outputs for generic timer */ -qemu_irq gt_timer_outputs[NUM_GTIMERS ]; - -/* MemoryRegion to use for secure physical accesses */ -MemoryRegion *secure_memory; - -/* 'compatible' string for this CPU for Linux device trees */ -const char *dtb_compatible; - -/* PSCI version for this CPU -* Bits[31:16] = Major Version -* Bits[15:0] = Minor Version -*/ -uint32_t psci_version; - -/* Should CPU start in PSCI powered-off state? */ -bool start_powered_off; -/* CPU currently in PSCI powered-off state */ -bool powered_off; -/* CPU has security extension */ -bool has_el3; - -/* CPU has memory protection unit */ -bool has_mpu; -/* PMSAv7 MPU number of supported regions */ -uint32_t pmsav7_dregion; - -/* PSCI conduit used to invoke PSCI methods -* 0 - disabled, 1 - smc, 2 - hvc -*/ -uint32_t psci_conduit; - -/* [QEMU_]KVM_ARM_TARGET_* constant for this CPU, or -* QEMU_KVM_ARM_TARGET_NONE if the kernel doesn't support this CPU type. -*/ -uint32_t kvm_target; - -/* KVM init features for this CPU */ -uint32_t kvm_init_features[7 ]; - -/* Uniprocessor system with MP extensions */ -bool mp_is_up; - -/* The instance init functions for implementation-specific subclasses -* set these fields to specify the implementation-dependent values of -* various constant registers and reset values of non-constant -* registers. -* Some of these might become QOM properties eventually. -* Field names match the official register names as defined in the -* ARMv7AR ARM Architecture Reference Manual. A reset_ prefix -* is used for reset values of non-constant registers; no reset_ -* prefix means a constant register. -*/ -uint32_t midr; -uint32_t revidr; -uint32_t reset_fpsid; -uint32_t mvfr0; -uint32_t mvfr1; -uint32_t mvfr2; -uint32_t ctr; -uint32_t reset_sctlr; -uint32_t id_pfr0; -uint32_t id_pfr1; -uint32_t id_dfr0; -uint32_t pmceid0; -uint32_t pmceid1; -uint32_t id_afr0; -uint32_t id_mmfr0; -uint32_t id_mmfr1; -uint32_t id_mmfr2; -uint32_t id_mmfr3; -uint32_t id_mmfr4; -uint32_t id_isar0; -uint32_t id_isar1; -uint32_t id_isar2; -uint32_t id_isar3; -uint32_t id_isar4; -uint32_t id_isar5; -uint64_t id_aa64pfr0; -uint64_t id_aa64pfr1; -uint64_t id_aa64dfr0; -uint64_t id_aa64dfr1; -uint64_t id_aa64afr0; -uint64_t id_aa64afr1; -uint64_t id_aa64isar0; -uint64_t id_aa64isar1; -uint64_t id_aa64mmfr0; -uint64_t id_aa64mmfr1; -uint32_t dbgdidr; -uint32_t clidr; -uint64_t mp_affinity;/* MP ID without feature bits */ -/* The elements of this array are the CCSIDR values for each cache, -* in the order L1DCache, L1ICache, L2DCache, L2ICache, etc. -*/ -uint32_t ccsidr[16 ]; -uint64_t reset_cbar; -uint32_t reset_auxcr; -bool reset_hivecs; -/* DCZ blocksize, in log_2(words), ie low 4 bits of DCZID_EL0 */ -uint32_t dcz_blocksize; -uint64_t rvbar; -}ARMCPU ; +typedef struct ARMCPU ARMCPU ;#define TYPE_AARCH64_CPU "aarch64-cpu"#define AARCH64_CPU_CLASS (klass) \
@@ -199,40 +63,9 @@ typedef struct AArch64CPUClass {/*< public >*/ } AArch64CPUClass; -static inline ARMCPU *arm_env_get_cpu (CPUARMState *env) -{ -return container_of (env,ARMCPU , env); -} - -#define ENV_GET_CPU (e) CPU(arm_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(ARMCPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_arm_cpu; -#endif -void register_cp_regs_for_features (ARMCPU *cpu);void init_cpreg_list (ARMCPU *cpu); -void arm_cpu_do_interrupt (CPUState *cpu); -void arm_v7m_cpu_do_interrupt (CPUState *cpu); -bool arm_cpu_exec_interrupt (CPUState *cpu,int int_req); - -void arm_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); - -hwaddr arm_cpu_get_phys_page_attrs_debug (CPUState *cpu,vaddr addr, -MemTxAttrs *attrs); - -int arm_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int arm_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); - -int arm_cpu_write_elf64_note (WriteCoreDumpFunction f,CPUState *cs, -int cpuid,void *opaque); -int arm_cpu_write_elf32_note (WriteCoreDumpFunction f,CPUState *cs, -int cpuid,void *opaque); -/* Callback functions for the generic timer's timers. */ void arm_gt_ptimer_cb (void *opaque);void arm_gt_vtimer_cb (void *opaque);
@@ -252,9 +85,4 @@ void arm_gt_stimer_cb(void *opaque);#define ARM64_AFFINITY_MASK \ (ARM_AFF0_MASK|ARM_AFF1_MASK|ARM_AFF2_MASK|ARM_AFF3_MASK) -#ifdef TARGET_AARCH64 -int aarch64_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int aarch64_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -#endif -#endif
target-arm/cpu.h +176 -3
197 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 7/49 target-cris: make cpu-qom.h not target specific
In reply to Paolo BonziniMake CRISCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-cris/cpu-qom.h | 40 +--------------------------------------- target-cris/cpu.h | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 40 deletions(-)
target-cris/cpu-qom.h +1 -39
@@ -50,44 +50,6 @@ typedef struct CRISCPUClass { uint32_t vr; } CRISCPUClass; -/** -* CRISCPU: -* @env: #CPUCRISState -* -* A CRIS CPU. -*/ -typedef struct CRISCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUCRISState env; -}CRISCPU ; - -static inline CRISCPU *cris_env_get_cpu (CPUCRISState *env) -{ -return container_of (env,CRISCPU , env); -} - -#define ENV_GET_CPU (e) CPU(cris_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(CRISCPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_cris_cpu; -#endif - -void cris_cpu_do_interrupt (CPUState *cpu); -void crisv10_cpu_do_interrupt (CPUState *cpu); -bool cris_cpu_exec_interrupt (CPUState *cpu,int int_req); - -void cris_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); - -hwaddr cris_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); - -int crisv10_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int cris_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int cris_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); +typedef struct CRISCPU CRISCPU ;#endif
target-cris/cpu.h +40 -1
53 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 8/49 target-i386: make cpu-qom.h not target specific
In reply to Paolo BonziniMake X86CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-i386/cpu-qom.h | 97 +------------------------------------------------- target-i386/cpu.h | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 97 deletions(-)
target-i386/cpu-qom.h +1 -96
@@ -67,101 +67,6 @@ typedef struct X86CPUClass { void (*parent_reset)(CPUState *cpu); } X86CPUClass; -/** -* X86CPU: -* @env: #CPUX86State -* @migratable: If set, only migratable flags will be accepted when "enforce" -* mode is used, and only migratable flags will be included in the "host" -* CPU model. -* -* An x86 CPU. -*/ -typedef struct X86CPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUX86State env; - -bool hyperv_vapic; -bool hyperv_relaxed_timing; -int hyperv_spinlock_attempts; -char *hyperv_vendor_id; -bool hyperv_time; -bool hyperv_crash; -bool hyperv_reset; -bool hyperv_vpindex; -bool hyperv_runtime; -bool hyperv_synic; -bool hyperv_stimer; -bool check_cpuid; -bool enforce_cpuid; -bool expose_kvm; -bool migratable; -bool host_features; -int64_t apic_id; - -/* if true the CPUID code directly forward host cache leaves to the guest */ -bool cache_info_passthrough; - -/* Features that were filtered out because of missing host capabilities */ -uint32_t filtered_features[FEATURE_WORDS ]; - -/* Enable PMU CPUID bits. This can't be enabled by default yet because -* it doesn't have ABI stability guarantees, as it passes all PMU CPUID -* bits returned by GET_SUPPORTED_CPUID (that depend on host CPU and kernel -* capabilities) directly to the guest. -*/ -bool enable_pmu; - -/* in order to simplify APIC support, we leave this pointer to the -user */ -struct DeviceState *apic_state; -struct MemoryRegion *cpu_as_root, *cpu_as_mem, *smram; -Notifier machine_done; -}X86CPU ; - -static inline X86CPU *x86_env_get_cpu (CPUX86State *env) -{ -return container_of (env,X86CPU , env); -} - -#define ENV_GET_CPU (e) CPU(x86_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(X86CPU, env) - -#ifndef CONFIG_USER_ONLY -extern struct VMStateDescription vmstate_x86_cpu; -#endif - -/** -* x86_cpu_do_interrupt: -* @cpu: vCPU the interrupt is to be handled by. -*/ -void x86_cpu_do_interrupt (CPUState *cpu); -bool x86_cpu_exec_interrupt (CPUState *cpu,int int_req); - -int x86_cpu_write_elf64_note (WriteCoreDumpFunction f,CPUState *cpu, -int cpuid,void *opaque); -int x86_cpu_write_elf32_note (WriteCoreDumpFunction f,CPUState *cpu, -int cpuid,void *opaque); -int x86_cpu_write_elf64_qemunote (WriteCoreDumpFunction f,CPUState *cpu, -void *opaque); -int x86_cpu_write_elf32_qemunote (WriteCoreDumpFunction f,CPUState *cpu, -void *opaque); - -void x86_cpu_get_memory_mapping (CPUState *cpu,MemoryMappingList *list, -Error **errp); - -void x86_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf, -int flags); - -hwaddr x86_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); - -int x86_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int x86_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); - -void x86_cpu_exec_enter (CPUState *cpu); -void x86_cpu_exec_exit (CPUState *cpu); +typedef struct X86CPU X86CPU ;#endif
target-i386/cpu.h +97 -1
110 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 9/49 target-lm32: make cpu-qom.h not target specific
In reply to Paolo BonziniMake LM32CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-lm32/cpu-qom.h | 41 +---------------------------------------- target-lm32/cpu.h | 44 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 42 deletions(-)
target-lm32/cpu-qom.h +1 -40
@@ -47,45 +47,6 @@ typedef struct LM32CPUClass { void (*parent_reset)(CPUState *cpu); } LM32CPUClass; -/** -* LM32CPU: -* @env: #CPULM32State -* -* A LatticeMico32 CPU. -*/ -typedef struct LM32CPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPULM32State env; - -uint32_t revision; -uint8_t num_interrupts; -uint8_t num_breakpoints; -uint8_t num_watchpoints; -uint32_t features; -}LM32CPU ; - -static inline LM32CPU *lm32_env_get_cpu (CPULM32State *env) -{ -return container_of (env,LM32CPU , env); -} - -#define ENV_GET_CPU (e) CPU(lm32_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(LM32CPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_lm32_cpu; -#endif - -void lm32_cpu_do_interrupt (CPUState *cpu); -bool lm32_cpu_exec_interrupt (CPUState *cs,int int_req); -void lm32_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); -hwaddr lm32_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int lm32_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int lm32_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); +typedef struct LM32CPU LM32CPU ;#endif
target-lm32/cpu.h +42 -2
62 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 10/49 target-m68k: make cpu-qom.h not target specific
In reply to Paolo BonziniMake M68KCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-m68k/cpu-qom.h | 34 +--------------------------------- target-m68k/cpu.h | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 35 deletions(-)
target-m68k/cpu-qom.h +1 -33
@@ -47,38 +47,6 @@ typedef struct M68kCPUClass { void (*parent_reset)(CPUState *cpu); } M68kCPUClass; -/** -* M68kCPU: -* @env: #CPUM68KState -* -* A Motorola 68k CPU. -*/ -typedef struct M68kCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUM68KState env; -}M68kCPU ; - -static inline M68kCPU *m68k_env_get_cpu (CPUM68KState *env) -{ -return container_of (env, M68kCPU, env); -} - -#define ENV_GET_CPU (e) CPU(m68k_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(M68kCPU, env) - -void m68k_cpu_do_interrupt (CPUState *cpu); -bool m68k_cpu_exec_interrupt (CPUState *cpu,int int_req); -void m68k_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); -hwaddr m68k_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int m68k_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int m68k_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); - -void m68k_cpu_exec_enter (CPUState *cs); -void m68k_cpu_exec_exit (CPUState *cs); +typedef struct M68kCPU M68kCPU ;#endif
target-m68k/cpu.h +34 -2
@@ -26,7 +26,7 @@#include "qemu-common.h" #include "exec/cpu-defs.h" - +#include "cpu-qom.h" #include "fpu/softfloat.h" #define MAX_QREGS 32
@@ -109,7 +109,39 @@ typedef struct CPUM68KState {uint32_t features; } CPUM68KState; -#include "cpu-qom.h" +/** +* M68kCPU: +* @env: #CPUM68KState +* +* A Motorola 68k CPU. +*/ +struct M68kCPU { +/*< private >*/ +CPUState parent_obj; +/*< public >*/ + +CPUM68KState env; +}; + +static inline M68kCPU *m68k_env_get_cpu (CPUM68KState *env) +{ +return container_of (env, M68kCPU, env); +} + +#define ENV_GET_CPU (e) CPU(m68k_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(M68kCPU, env) + +void m68k_cpu_do_interrupt (CPUState *cpu); +bool m68k_cpu_exec_interrupt (CPUState *cpu,int int_req); +void m68k_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, +int flags); +hwaddr m68k_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); +int m68k_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); +int m68k_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); + +void m68k_cpu_exec_enter (CPUState *cs); +void m68k_cpu_exec_exit (CPUState *cs);void m68k_tcg_init (void );void m68k_cpu_init_gdb (M68kCPU *cpu);
Signature · 1 line
1.8.3.1
PATCH 11/49 target-microblaze: make cpu-qom.h not target specific
In reply to Paolo BonziniMake MicroBlazeCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-microblaze/cpu-qom.h | 44 +------------------------------------------- target-microblaze/cpu.h | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 44 deletions(-)
target-microblaze/cpu-qom.h +1 -43
@@ -47,48 +47,6 @@ typedef struct MicroBlazeCPUClass { void (*parent_reset)(CPUState *cpu); } MicroBlazeCPUClass; -/** -* MicroBlazeCPU: -* @env: #CPUMBState -* -* A MicroBlaze CPU. -*/ -typedef struct MicroBlazeCPU { -/*< private >*/ -CPUState parent_obj; - -/*< public >*/ - -/* Microblaze Configuration Settings */ -struct { -bool stackprot; -uint32_t base_vectors; -uint8_t use_fpu; -bool use_mmu; -bool dcache_writeback; -bool endi; -char *version; -uint8_t pvr; - } cfg; - -CPUMBState env; -}MicroBlazeCPU ; - -static inline MicroBlazeCPU *mb_env_get_cpu (CPUMBState *env) -{ -return container_of (env, MicroBlazeCPU, env); -} - -#define ENV_GET_CPU (e) CPU(mb_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(MicroBlazeCPU, env) - -void mb_cpu_do_interrupt (CPUState *cs); -bool mb_cpu_exec_interrupt (CPUState *cs,int int_req); -void mb_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); -hwaddr mb_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int mb_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int mb_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); +typedef struct MicroBlazeCPU MicroBlazeCPU ;#endif
target-microblaze/cpu.h +44 -1
57 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 12/49 target-mips: make cpu-qom.h not target specific
In reply to Paolo BonziniMake MIPSCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-mips/cpu-qom.h | 37 +------------------------------------ target-mips/cpu.h | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 37 deletions(-)
target-mips/cpu-qom.h +1 -36
@@ -51,41 +51,6 @@ typedef struct MIPSCPUClass { void (*parent_reset)(CPUState *cpu); } MIPSCPUClass; -/** -* MIPSCPU: -* @env: #CPUMIPSState -* -* A MIPS CPU. -*/ -typedef struct MIPSCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUMIPSState env; -}MIPSCPU ; - -static inline MIPSCPU *mips_env_get_cpu (CPUMIPSState *env) -{ -return container_of (env,MIPSCPU , env); -} - -#define ENV_GET_CPU (e) CPU(mips_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(MIPSCPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_mips_cpu; -#endif - -void mips_cpu_do_interrupt (CPUState *cpu); -bool mips_cpu_exec_interrupt (CPUState *cpu,int int_req); -void mips_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); -hwaddr mips_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int mips_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int mips_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -void mips_cpu_do_unaligned_access (CPUState *cpu,vaddr addr, -int is_write,int is_user,uintptr_t retaddr); +typedef struct MIPSCPU MIPSCPU ;#endif
target-mips/cpu.h +37 -1
@@ -8,6 +8,7 @@#define CPUArchState struct CPUMIPSState#include "qemu-common.h" +#include "cpu-qom.h" #include "mips-defs.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h"
@@ -601,7 +602,42 @@ struct CPUMIPSState {QEMUTimer *timer;/* Internal timer */ }; -#include "cpu-qom.h" +/** +* MIPSCPU: +* @env: #CPUMIPSState +* +* A MIPS CPU. +*/ +struct MIPSCPU { +/*< private >*/ +CPUState parent_obj; +/*< public >*/ + +CPUMIPSState env; +}; + +static inline MIPSCPU *mips_env_get_cpu (CPUMIPSState *env) +{ +return container_of (env,MIPSCPU , env); +} + +#define ENV_GET_CPU (e) CPU(mips_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(MIPSCPU, env) + +#ifndef CONFIG_USER_ONLY +extern const struct VMStateDescription vmstate_mips_cpu; +#endif + +void mips_cpu_do_interrupt (CPUState *cpu); +bool mips_cpu_exec_interrupt (CPUState *cpu,int int_req); +void mips_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, +int flags); +hwaddr mips_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); +int mips_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); +int mips_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); +void mips_cpu_do_unaligned_access (CPUState *cpu,vaddr addr, +int is_write,int is_user,uintptr_t retaddr);#if !defined(CONFIG_USER_ONLY ) int no_mmu_map_address (CPUMIPSState *env, hwaddr *physical, int *prot,
Signature · 1 line
1.8.3.1
PATCH 13/49 target-ppc: do not use target_ulong in cpu-qom.h
In reply to Paolo BonziniUsing vaddr makes the cpu-qom.h file target independent
--- target-ppc/cpu-qom.h | 3 +-- target-ppc/mmu-hash32.c | 2 +- target-ppc/mmu-hash32.h | 2 +- target-ppc/mmu-hash64.c | 2 +- target-ppc/mmu-hash64.h | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-)
target-ppc/cpu-qom.h +1 -2
@@ -73,8 +73,7 @@ typedef struct PowerPCCPUClass {void (*init_proc)(CPUPPCState *env);int (*check_pow)(CPUPPCState *env);#if defined(CONFIG_SOFTMMU ) -int (*handle_mmu_fault)(PowerPCCPU *cpu,target_ulong eaddr,int rwx, -int mmu_idx); +int (*handle_mmu_fault)(PowerPCCPU *cpu,vaddr eaddr,int rwx,int mmu_idx);#endif bool (*interrupts_big_endian)(PowerPCCPU *cpu); } PowerPCCPUClass;
target-ppc/mmu-hash32.c +1 -1
@@ -383,7 +383,7 @@ static hwaddr ppc_hash32_pte_raddr(target_ulong sr, ppc_hash_pte32_t pte,return (rpn & ~mask) | (eaddr & mask); } -int ppc_hash32_handle_mmu_fault (PowerPCCPU *cpu,target_ulong eaddr,int rwx, +int ppc_hash32_handle_mmu_fault (PowerPCCPU *cpu,vaddr eaddr,int rwx,int mmu_idx) {CPUState *cs =CPU (cpu);
target-ppc/mmu-hash32.h +1 -1
@@ -5,7 +5,7 @@hwaddr get_pteg_offset32 (PowerPCCPU *cpu,hwaddr hash);hwaddr ppc_hash32_get_phys_page_debug (PowerPCCPU *cpu,target_ulong addr); -int ppc_hash32_handle_mmu_fault (PowerPCCPU *cpu,target_ulong address,int rw, +int ppc_hash32_handle_mmu_fault (PowerPCCPU *cpu,vaddr address,int rw,int mmu_idx);/*
target-ppc/mmu-hash64.c +1 -1
@@ -549,7 +549,7 @@ unsigned ppc_hash64_hpte_page_shift_noslb(PowerPCCPU *cpu,return 0 ; } -int ppc_hash64_handle_mmu_fault (PowerPCCPU *cpu,target_ulong eaddr, +int ppc_hash64_handle_mmu_fault (PowerPCCPU *cpu,vaddr eaddr,int rwx,int mmu_idx) {CPUState *cs =CPU (cpu);
target-ppc/mmu-hash64.h +1 -1
@@ -9,7 +9,7 @@ void dump_slb(FILE *f, fprintf_function cpu_fprintf, PowerPCCPU *cpu);int ppc_store_slb (PowerPCCPU *cpu,target_ulong slot,target_ulong esid,target_ulong vsid);hwaddr ppc_hash64_get_phys_page_debug (PowerPCCPU *cpu,target_ulong addr); -int ppc_hash64_handle_mmu_fault (PowerPCCPU *cpu,target_ulong address,int rw, +int ppc_hash64_handle_mmu_fault (PowerPCCPU *cpu,vaddr address,int rw,int mmu_idx);void ppc_hash64_store_hpte (PowerPCCPU *cpu,target_ulong index,target_ulong pte0,target_ulong pte1);
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH 13/49] target-ppc: do not use target_ulong in cpu-qom.h
Quoted 1 line · Paolo Bonzini
Using vaddr makes the
cpu-qom.hfile target independent
Also brings the PowerPCCPUClass handle_mmu_fault method type into line with the one in CPUState.
(Speaking of which, target-ppc/translate_init.c defines a cpu_ppc_handle_mmu_fault() which takes a target_ulong address and then assigns it to the cc->handle_mmu_fault pointer, which is wrong.)
thanks
-- PMM
PATCH 14/49 target-ppc: make cpu-qom.h not target specific
In reply to Paolo BonziniMake PowerPCCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-ppc/cpu-qom.h | 155 ++++++++++++++++++++++++++++++++---------------- target-ppc/cpu.h | 162 +++++++++++++++++---------------------------------- 2 files changed, 157 insertions(+), 160 deletions(-)
target-ppc/cpu-qom.h +105 -50
@@ -38,6 +38,111 @@ OBJECT_GET_CLASS(PowerPCCPUClass, (obj), TYPE_POWERPC_CPU)typedef struct PowerPCCPU PowerPCCPU ; +typedef struct CPUPPCState CPUPPCState ; +typedef struct ppc_tb_t ppc_tb_t ; +typedef struct ppc_dcr_t ppc_dcr_t ; + +/*****************************************************************************/ +/* MMU model */ +typedef enum powerpc_mmu_t powerpc_mmu_t ; +enum powerpc_mmu_t { +POWERPC_MMU_UNKNOWN =0x00000000 , +/* Standard 32 bits PowerPC MMU */ +POWERPC_MMU_32B =0x00000001 , +/* PowerPC 6xx MMU with software TLB */ + POWERPC_MMU_SOFT_6xx =0x00000002 , +/* PowerPC 74xx MMU with software TLB */ + POWERPC_MMU_SOFT_74xx =0x00000003 , +/* PowerPC 4xx MMU with software TLB */ + POWERPC_MMU_SOFT_4xx =0x00000004 , +/* PowerPC 4xx MMU with software TLB and zones protections */ + POWERPC_MMU_SOFT_4xx_Z =0x00000005 , +/* PowerPC MMU in real mode only */ +POWERPC_MMU_REAL =0x00000006 , +/* Freescale MPC8xx MMU model */ + POWERPC_MMU_MPC8xx =0x00000007 , +/* BookE MMU model */ +POWERPC_MMU_BOOKE =0x00000008 , +/* BookE 2.06 MMU model */ +POWERPC_MMU_BOOKE206 =0x00000009 , +/* PowerPC 601 MMU model (specific BATs format) */ +POWERPC_MMU_601 =0x0000000A , +#define POWERPC_MMU_64 0x00010000 +#define POWERPC_MMU_1TSEG 0x00020000 +#define POWERPC_MMU_AMR 0x00040000 +/* 64 bits PowerPC MMU */ +POWERPC_MMU_64B =POWERPC_MMU_64 |0x00000001 , +/* Architecture 2.03 and later (has LPCR) */ +POWERPC_MMU_2_03 =POWERPC_MMU_64 |0x00000002 , +/* Architecture 2.06 variant */ +POWERPC_MMU_2_06 =POWERPC_MMU_64 |POWERPC_MMU_1TSEG + |POWERPC_MMU_AMR |0x00000003 , +/* Architecture 2.06 "degraded" (no 1T segments) */ + POWERPC_MMU_2_06a =POWERPC_MMU_64 |POWERPC_MMU_AMR + |0x00000003 , +/* Architecture 2.07 variant */ +POWERPC_MMU_2_07 =POWERPC_MMU_64 |POWERPC_MMU_1TSEG + |POWERPC_MMU_AMR |0x00000004 , +/* Architecture 2.07 "degraded" (no 1T segments) */ + POWERPC_MMU_2_07a =POWERPC_MMU_64 |POWERPC_MMU_AMR + |0x00000004 , +}; + +/*****************************************************************************/ +/* Exception model */ +typedef enum powerpc_excp_t powerpc_excp_t ; +enum powerpc_excp_t { +POWERPC_EXCP_UNKNOWN =0 , +/* Standard PowerPC exception model */ +POWERPC_EXCP_STD , +/* PowerPC 40x exception model */ + POWERPC_EXCP_40x, +/* PowerPC 601 exception model */ +POWERPC_EXCP_601 , +/* PowerPC 602 exception model */ +POWERPC_EXCP_602 , +/* PowerPC 603 exception model */ +POWERPC_EXCP_603 , +/* PowerPC 603e exception model */ +POWERPC_EXCP_603E , +/* PowerPC G2 exception model */ +POWERPC_EXCP_G2 , +/* PowerPC 604 exception model */ +POWERPC_EXCP_604 , +/* PowerPC 7x0 exception model */ + POWERPC_EXCP_7x0, +/* PowerPC 7x5 exception model */ + POWERPC_EXCP_7x5, +/* PowerPC 74xx exception model */ + POWERPC_EXCP_74xx, +/* BookE exception model */ +POWERPC_EXCP_BOOKE , +/* PowerPC 970 exception model */ +POWERPC_EXCP_970 , +/* POWER7 exception model */ +POWERPC_EXCP_POWER7 , +}; + +/*****************************************************************************/ +/* Input pins model */ +typedef enum powerpc_input_t powerpc_input_t ; +enum powerpc_input_t { +PPC_FLAGS_INPUT_UNKNOWN =0 , +/* PowerPC 6xx bus */ + PPC_FLAGS_INPUT_6xx, +/* BookE bus */ + PPC_FLAGS_INPUT_BookE, +/* PowerPC 405 bus */ +PPC_FLAGS_INPUT_405 , +/* PowerPC 970 bus */ +PPC_FLAGS_INPUT_970 , +/* PowerPC POWER7 bus */ +PPC_FLAGS_INPUT_POWER7 , +/* PowerPC 401 bus */ +PPC_FLAGS_INPUT_401 , +/* Freescale RCPU bus */ +PPC_FLAGS_INPUT_RCPU , +};/** * PowerPCCPUClass:
@@ -78,57 +183,7 @@ typedef struct PowerPCCPUClass {bool (*interrupts_big_endian)(PowerPCCPU *cpu); } PowerPCCPUClass; -/** -* PowerPCCPU: -* @env: #CPUPPCState -* @cpu_dt_id: CPU index used in the device tree. KVM uses this index too -* @max_compat: Maximal supported logical PVR from the command line -* @cpu_version: Current logical PVR, zero if in "raw" mode -* -* A PowerPC CPU. -*/ -struct PowerPCCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUPPCState env; -int cpu_dt_id; -uint32_t max_compat; -uint32_t cpu_version; -}; - -static inline PowerPCCPU *ppc_env_get_cpu (CPUPPCState *env) -{ -return container_of (env, PowerPCCPU, env); -} - -#define ENV_GET_CPU (e) CPU(ppc_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(PowerPCCPU, env) - -PowerPCCPUClass *ppc_cpu_class_by_pvr (uint32_t pvr); -PowerPCCPUClass *ppc_cpu_class_by_pvr_mask (uint32_t pvr); - -void ppc_cpu_do_interrupt (CPUState *cpu); -bool ppc_cpu_exec_interrupt (CPUState *cpu,int int_req); -void ppc_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); -void ppc_cpu_dump_statistics (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); -int ppc_cpu_get_monitor_def (CPUState *cs,const char *name, -uint64_t *pval); -hwaddr ppc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int ppc_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int ppc_cpu_gdb_read_register_apple (CPUState *cpu,uint8_t *buf,int reg); -int ppc_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -int ppc_cpu_gdb_write_register_apple (CPUState *cpu,uint8_t *buf,int reg); -int ppc64_cpu_write_elf64_note (WriteCoreDumpFunction f,CPUState *cs, -int cpuid,void *opaque); #ifndef CONFIG_USER_ONLY -void ppc_cpu_do_system_reset(CPUState *cs); -extern const struct VMStateDescription vmstate_ppc_cpu; - typedef struct PPCTimebase { uint64_t guest_timebase; int64_t time_of_the_day_ns;
target-ppc/cpu.h +52 -110
193 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 15/49 target-s390x: make cpu-qom.h not target specific
In reply to Paolo BonziniMake S390XCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-s390x/cpu-qom.h | 45 +-------------------------------------------- target-s390x/cpu.h | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 45 deletions(-)
target-s390x/cpu-qom.h +1 -44
@@ -55,49 +55,6 @@ typedef struct S390CPUClass { void (*initial_cpu_reset)(CPUState *cpu); } S390CPUClass; -/** -* S390CPU: -* @env: #CPUS390XState. -* -* An S/390 CPU. -*/ -typedef struct S390CPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUS390XState env; -int64_t id; -/* needed for live migration */ -void *irqstate; -uint32_t irqstate_saved_size; -}S390CPU ; - -static inline S390CPU *s390_env_get_cpu (CPUS390XState *env) -{ -return container_of (env,S390CPU , env); -} - -#define ENV_GET_CPU (e) CPU(s390_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(S390CPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_s390_cpu; -#endif - -void s390_cpu_do_interrupt (CPUState *cpu); -bool s390_cpu_exec_interrupt (CPUState *cpu,int int_req); -void s390_cpu_dump_state (CPUState *cpu,FILE *f,fprintf_function cpu_fprintf, -int flags); -int s390_cpu_write_elf64_note (WriteCoreDumpFunction f,CPUState *cs, -int cpuid,void *opaque); - -hwaddr s390_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -hwaddr s390_cpu_get_phys_addr_debug (CPUState *cpu,vaddr addr); -int s390_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int s390_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -void s390_cpu_gdb_init (CPUState *cs); -void s390x_cpu_debug_excp_handler (CPUState *cs); +typedef struct S390CPU S390CPU ;#endif
target-s390x/cpu.h +46 -1
59 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 16/49 target-sh4: make cpu-qom.h not target specific
In reply to Paolo BonziniMake SuperHCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-sh4/cpu-qom.h | 31 +------------------------------ target-sh4/cpu.h | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 31 deletions(-)
target-sh4/cpu-qom.h +1 -30
@@ -60,35 +60,6 @@ typedef struct SuperHCPUClass { uint32_t cvr; } SuperHCPUClass; -/** -* SuperHCPU: -* @env: #CPUSH4State -* -* A SuperH CPU. -*/ -typedef struct SuperHCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUSH4State env; -}SuperHCPU ; - -static inline SuperHCPU *sh_env_get_cpu (CPUSH4State *env) -{ -return container_of (env, SuperHCPU, env); -} - -#define ENV_GET_CPU (e) CPU(sh_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(SuperHCPU, env) - -void superh_cpu_do_interrupt (CPUState *cpu); -bool superh_cpu_exec_interrupt (CPUState *cpu,int int_req); -void superh_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); -hwaddr superh_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int superh_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int superh_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); +typedef struct SuperHCPU SuperHCPU ;#endif
target-sh4/cpu.h +31 -1
@@ -20,6 +20,7 @@#define _CPU_SH4_H#include "qemu-common.h" +#include "cpu-qom.h" #define TARGET_LONG_BITS 32
@@ -187,7 +188,36 @@ typedef struct CPUSH4State {memory_content **movcal_backup_tail; } CPUSH4State; -#include "cpu-qom.h" +/** +* SuperHCPU: +* @env: #CPUSH4State +* +* A SuperH CPU. +*/ +struct SuperHCPU { +/*< private >*/ +CPUState parent_obj; +/*< public >*/ + +CPUSH4State env; +}; + +static inline SuperHCPU *sh_env_get_cpu (CPUSH4State *env) +{ +return container_of (env, SuperHCPU, env); +} + +#define ENV_GET_CPU (e) CPU(sh_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(SuperHCPU, env) + +void superh_cpu_do_interrupt (CPUState *cpu); +bool superh_cpu_exec_interrupt (CPUState *cpu,int int_req); +void superh_cpu_dump_state (CPUState *cpu,FILE *f, +fprintf_function cpu_fprintf,int flags); +hwaddr superh_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); +int superh_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); +int superh_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);void sh4_translate_init (void );SuperHCPU *cpu_sh4_init (const char *cpu_model);
Signature · 1 line
1.8.3.1
PATCH 17/49 target-sparc: make cpu-qom.h not target specific
In reply to Paolo BonziniMake SPARCCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-sparc/cpu-qom.h | 37 +------------------------------------ target-sparc/cpu.h | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 37 deletions(-)
target-sparc/cpu-qom.h +1 -36
@@ -51,41 +51,6 @@ typedef struct SPARCCPUClass { void (*parent_reset)(CPUState *cpu); } SPARCCPUClass; -/** -* SPARCCPU: -* @env: #CPUSPARCState -* -* A SPARC CPU. -*/ -typedef struct SPARCCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUSPARCState env; -}SPARCCPU ; - -static inline SPARCCPU *sparc_env_get_cpu (CPUSPARCState *env) -{ -return container_of (env,SPARCCPU , env); -} - -#define ENV_GET_CPU (e) CPU(sparc_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(SPARCCPU, env) - -#ifndef CONFIG_USER_ONLY -extern const struct VMStateDescription vmstate_sparc_cpu; -#endif - -void sparc_cpu_do_interrupt (CPUState *cpu); -void sparc_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); -hwaddr sparc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int sparc_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int sparc_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cpu, -vaddr addr,int is_write, -int is_user,uintptr_t retaddr); +typedef struct SPARCCPU SPARCCPU ;#endif
target-sparc/cpu.h +37 -1
@@ -3,6 +3,7 @@#include "qemu-common.h" #include "qemu/bswap.h" +#include "cpu-qom.h" #define ALIGNED_ONLY
@@ -506,7 +507,42 @@ struct CPUSPARCState {uint32_t cache_control; }; -#include "cpu-qom.h" +/** +* SPARCCPU: +* @env: #CPUSPARCState +* +* A SPARC CPU. +*/ +struct SPARCCPU { +/*< private >*/ +CPUState parent_obj; +/*< public >*/ + +CPUSPARCState env; +}; + +static inline SPARCCPU *sparc_env_get_cpu (CPUSPARCState *env) +{ +return container_of (env,SPARCCPU , env); +} + +#define ENV_GET_CPU (e) CPU(sparc_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(SPARCCPU, env) + +#ifndef CONFIG_USER_ONLY +extern const struct VMStateDescription vmstate_sparc_cpu; +#endif + +void sparc_cpu_do_interrupt (CPUState *cpu); +void sparc_cpu_dump_state (CPUState *cpu,FILE *f, +fprintf_function cpu_fprintf,int flags); +hwaddr sparc_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); +int sparc_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); +int sparc_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); +void QEMU_NORETURN sparc_cpu_do_unaligned_access(CPUState *cpu, +vaddr addr,int is_write, +int is_user,uintptr_t retaddr);#ifndef NO_CPU_IO_DEFS /* cpu_init.c */
Signature · 1 line
1.8.3.1
PATCH 18/49 target-tricore: make cpu-qom.h not target specific
In reply to Paolo BonziniMake TriCoreCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-tricore/cpu-qom.h | 28 +--------------------------- target-tricore/cpu.h | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 28 deletions(-)
target-tricore/cpu-qom.h +1 -27
@@ -39,32 +39,6 @@ typedef struct TriCoreCPUClass { void (*parent_reset)(CPUState *cpu); } TriCoreCPUClass; -/** -* TriCoreCPU: -* @env: #CPUTriCoreState -* -* A TriCore CPU. -*/ -typedef struct TriCoreCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUTriCoreState env; -}TriCoreCPU ; - -static inline TriCoreCPU *tricore_env_get_cpu (CPUTriCoreState *env) -{ -return TRICORE_CPU (container_of (env, TriCoreCPU, env)); -} - -#define ENV_GET_CPU (e) CPU(tricore_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(TriCoreCPU, env) - -hwaddr tricore_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -void tricore_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); - +typedef struct TriCoreCPU TriCoreCPU ;#endif /*QEMU_TRICORE_CPU_QOM_H */
target-tricore/cpu.h +29 -1
@@ -21,6 +21,7 @@#include "tricore-defs.h" #include "qemu-common.h" +#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h"
@@ -199,6 +200,34 @@ struct CPUTriCoreState {struct QEMUTimer *timer;/* Internal timer */ }; +/** +* TriCoreCPU: +* @env: #CPUTriCoreState +* +* A TriCore CPU. +*/ +struct TriCoreCPU { +/*< private >*/ +CPUState parent_obj; +/*< public >*/ + +CPUTriCoreState env; +}; + +static inline TriCoreCPU *tricore_env_get_cpu (CPUTriCoreState *env) +{ +return TRICORE_CPU (container_of (env, TriCoreCPU, env)); +} + +#define ENV_GET_CPU (e) CPU(tricore_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(TriCoreCPU, env) + +hwaddr tricore_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); +void tricore_cpu_dump_state (CPUState *cpu,FILE *f, +fprintf_function cpu_fprintf,int flags); + +#define MASK_PCXI_PCPN 0xff000000#define MASK_PCXI_PIE 0x00800000#define MASK_PCXI_UL 0x00400000
@@ -339,7 +368,6 @@ enum {uint32_t psw_read (CPUTriCoreState *env);void psw_write (CPUTriCoreState *env,uint32_t val); -#include "cpu-qom.h" #define MMU_USER_IDX 2void tricore_cpu_list (FILE *f,fprintf_function cpu_fprintf);
Signature · 1 line
1.8.3.1
PATCH 19/49 target-unicore32: make cpu-qom.h not target specific
In reply to Paolo BonziniMake UniCore32CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-unicore32/cpu-qom.h | 29 +---------------------------- target-unicore32/cpu.h | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 29 deletions(-)
target-unicore32/cpu-qom.h +1 -28
@@ -36,33 +36,6 @@ typedef struct UniCore32CPUClass { DeviceRealize parent_realize; } UniCore32CPUClass; -/** -* UniCore32CPU: -* @env: #CPUUniCore32State -* -* A UniCore32 CPU. -*/ -typedef struct UniCore32CPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUUniCore32State env; -}UniCore32CPU ; - -static inline UniCore32CPU *uc32_env_get_cpu (CPUUniCore32State *env) -{ -return container_of (env, UniCore32CPU, env); -} - -#define ENV_GET_CPU (e) CPU(uc32_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(UniCore32CPU, env) - -void uc32_cpu_do_interrupt (CPUState *cpu); -bool uc32_cpu_exec_interrupt (CPUState *cpu,int int_req); -void uc32_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); -hwaddr uc32_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); +typedef struct UniCore32CPU UniCore32CPU ;#endif
target-unicore32/cpu.h +30 -1
@@ -20,6 +20,7 @@#define CPUArchState struct CPUUniCore32State#include "qemu-common.h" +#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h"
@@ -71,6 +72,35 @@ typedef struct CPUUniCore32State { } CPUUniCore32State; +/** +* UniCore32CPU: +* @env: #CPUUniCore32State +* +* A UniCore32 CPU. +*/ +struct UniCore32CPU { +/*< private >*/ +CPUState parent_obj; +/*< public >*/ + +CPUUniCore32State env; +}; + +static inline UniCore32CPU *uc32_env_get_cpu (CPUUniCore32State *env) +{ +return container_of (env, UniCore32CPU, env); +} + +#define ENV_GET_CPU (e) CPU(uc32_env_get_cpu(e)) + +#define ENV_OFFSET offsetof(UniCore32CPU, env) + +void uc32_cpu_do_interrupt (CPUState *cpu); +bool uc32_cpu_exec_interrupt (CPUState *cpu,int int_req); +void uc32_cpu_dump_state (CPUState *cpu,FILE *f, +fprintf_function cpu_fprintf,int flags); +hwaddr uc32_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); +#define ASR_M (0x1f)#define ASR_MODE_USER (0x10)#define ASR_MODE_INTR (0x12)
@@ -134,7 +164,6 @@ static inline int cpu_mmu_index(CPUUniCore32State *env, bool ifetch) }#include "exec/cpu-all.h" -#include "cpu-qom.h" #include "exec/exec-all.h" int uc32_cpu_exec (CPUState *s);
Signature · 1 line
1.8.3.1
PATCH 20/49 target-xtensa: make cpu-qom.h not target specific
In reply to Paolo BonziniMake XtensaCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers.
--- target-xtensa/cpu-qom.h | 193 ++++++++++++++++++++++++++++++++++++++--------- target-xtensa/cpu.h | 194 +++++++++--------------------------------------- 2 files changed, 194 insertions(+), 193 deletions(-)
target-xtensa/cpu-qom.h +158 -35
@@ -40,6 +40,163 @@#define XTENSA_CPU_GET_CLASS (obj) \ OBJECT_GET_CLASS(XtensaCPUClass, (obj), TYPE_XTENSA_CPU) +enum { +/* Additional instructions */ +XTENSA_OPTION_CODE_DENSITY , +XTENSA_OPTION_LOOP , +XTENSA_OPTION_EXTENDED_L32R , +XTENSA_OPTION_16_BIT_IMUL , +XTENSA_OPTION_32_BIT_IMUL , +XTENSA_OPTION_32_BIT_IMUL_HIGH , +XTENSA_OPTION_32_BIT_IDIV , +XTENSA_OPTION_MAC16 , +XTENSA_OPTION_MISC_OP_NSA , +XTENSA_OPTION_MISC_OP_MINMAX , +XTENSA_OPTION_MISC_OP_SEXT , +XTENSA_OPTION_MISC_OP_CLAMPS , +XTENSA_OPTION_COPROCESSOR , +XTENSA_OPTION_BOOLEAN , +XTENSA_OPTION_FP_COPROCESSOR , +XTENSA_OPTION_MP_SYNCHRO , +XTENSA_OPTION_CONDITIONAL_STORE , +XTENSA_OPTION_ATOMCTL , +XTENSA_OPTION_DEPBITS , + +/* Interrupts and exceptions */ +XTENSA_OPTION_EXCEPTION , +XTENSA_OPTION_RELOCATABLE_VECTOR , +XTENSA_OPTION_UNALIGNED_EXCEPTION , +XTENSA_OPTION_INTERRUPT , +XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT , +XTENSA_OPTION_TIMER_INTERRUPT , + +/* Local memory */ +XTENSA_OPTION_ICACHE , +XTENSA_OPTION_ICACHE_TEST , +XTENSA_OPTION_ICACHE_INDEX_LOCK , +XTENSA_OPTION_DCACHE , +XTENSA_OPTION_DCACHE_TEST , +XTENSA_OPTION_DCACHE_INDEX_LOCK , +XTENSA_OPTION_IRAM , +XTENSA_OPTION_IROM , +XTENSA_OPTION_DRAM , +XTENSA_OPTION_DROM , +XTENSA_OPTION_XLMI , +XTENSA_OPTION_HW_ALIGNMENT , +XTENSA_OPTION_MEMORY_ECC_PARITY , + +/* Memory protection and translation */ +XTENSA_OPTION_REGION_PROTECTION , +XTENSA_OPTION_REGION_TRANSLATION , +XTENSA_OPTION_MMU , +XTENSA_OPTION_CACHEATTR , + +/* Other */ +XTENSA_OPTION_WINDOWED_REGISTER , +XTENSA_OPTION_PROCESSOR_INTERFACE , +XTENSA_OPTION_MISC_SR , +XTENSA_OPTION_THREAD_POINTER , +XTENSA_OPTION_PROCESSOR_ID , +XTENSA_OPTION_DEBUG , +XTENSA_OPTION_TRACE_PORT , +}; + +#define MAX_NAREG 64 +#define MAX_NINTERRUPT 32 +#define MAX_NLEVEL 6 +#define MAX_NNMI 1 +#define MAX_NCCOMPARE 3 +#define MAX_TLB_WAY_SIZE 8 +#define MAX_NDBREAK 2 + +enum { +/* Static vectors */ +EXC_RESET , +EXC_MEMORY_ERROR , + +/* Dynamic vectors */ +EXC_WINDOW_OVERFLOW4 , +EXC_WINDOW_UNDERFLOW4 , +EXC_WINDOW_OVERFLOW8 , +EXC_WINDOW_UNDERFLOW8 , +EXC_WINDOW_OVERFLOW12 , +EXC_WINDOW_UNDERFLOW12 , +EXC_IRQ , +EXC_KERNEL , +EXC_USER , +EXC_DOUBLE , +EXC_DEBUG , +EXC_MAX +}; + +typedef enum { +INTTYPE_LEVEL , +INTTYPE_EDGE , +INTTYPE_NMI , +INTTYPE_SOFTWARE , +INTTYPE_TIMER , +INTTYPE_DEBUG , +INTTYPE_WRITE_ERR , +INTTYPE_PROFILING , +INTTYPE_MAX +}interrupt_type ; + +typedef struct xtensa_tlb { +unsigned nways; +const unsigned way_size[10 ]; +bool varway56; +unsigned nrefillentries; +}xtensa_tlb ; + +typedef struct XtensaGdbReg { +int targno; +int type; +int group; +unsigned size; +}XtensaGdbReg ; + +typedef struct XtensaGdbRegmap { +int num_regs; +int num_core_regs; +/* PC + a + ar + sr + ur */ +XtensaGdbReg reg[1 +16 +64 +256 +256 ]; +}XtensaGdbRegmap ; + +typedef struct XtensaConfig { +const char *name; +uint64_t options; +XtensaGdbRegmap gdb_regmap; +unsigned nareg; +int excm_level; +int ndepc; +uint32_t vecbase; +uint32_t exception_vector[EXC_MAX ]; +unsigned ninterrupt; +unsigned nlevel; +uint32_t interrupt_vector[MAX_NLEVEL +MAX_NNMI +1 ]; +uint32_t level_mask[MAX_NLEVEL +MAX_NNMI +1 ]; +uint32_t inttype_mask[INTTYPE_MAX ]; +struct { +uint32_t level; +interrupt_type inttype; + } interrupt[MAX_NINTERRUPT ]; +unsigned nccompare; +uint32_t timerint[MAX_NCCOMPARE ]; +unsigned nextint; +unsigned extint[MAX_NINTERRUPT ]; + +unsigned debug_level; +unsigned nibreak; +unsigned ndbreak; + +uint32_t configid[2 ]; + +uint32_t clock_freq_khz; + +xtensa_tlb itlb; +xtensa_tlb dtlb; +}XtensaConfig ; +/** * XtensaCPUClass: * @parent_realize: The parent class' realize handler.
@@ -59,40 +216,6 @@ typedef struct XtensaCPUClass { const XtensaConfig *config; } XtensaCPUClass; -/** -* XtensaCPU: -* @env: #CPUXtensaState -* -* An Xtensa CPU. -*/ -typedef struct XtensaCPU { -/*< private >*/ -CPUState parent_obj; -/*< public >*/ - -CPUXtensaState env; -}XtensaCPU ; - -static inline XtensaCPU *xtensa_env_get_cpu (const CPUXtensaState *env) -{ -return container_of (env, XtensaCPU, env); -} - -#define ENV_GET_CPU (e) CPU(xtensa_env_get_cpu(e)) - -#define ENV_OFFSET offsetof(XtensaCPU, env) - -void xtensa_cpu_do_interrupt (CPUState *cpu); -bool xtensa_cpu_exec_interrupt (CPUState *cpu,int interrupt_request); -void xtensa_cpu_do_unassigned_access (CPUState *cpu,hwaddr addr, -bool is_write,bool is_exec,int opaque, -unsigned size); -void xtensa_cpu_dump_state (CPUState *cpu,FILE *f, -fprintf_function cpu_fprintf,int flags); -hwaddr xtensa_cpu_get_phys_page_debug (CPUState *cpu,vaddr addr); -int xtensa_cpu_gdb_read_register (CPUState *cpu,uint8_t *buf,int reg); -int xtensa_cpu_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg); -void xtensa_cpu_do_unaligned_access (CPUState *cpu,vaddr addr, -int is_write,int is_user,uintptr_t retaddr); +typedef struct XtensaCPU XtensaCPU ;#endif
target-xtensa/cpu.h +36 -158
236 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 21/49 arm: include cpu-qom.h in files that require ARMCPU
In reply to Paolo Bonzini--- hw/arm/stm32f205_soc.c | 1 - hw/arm/strongarm.h | 1 + include/hw/arm/arm.h | 2 +- include/hw/arm/exynos4210.h | 1 + include/hw/arm/omap.h | 1 + include/hw/arm/pxa.h | 1 + 6 files changed, 5 insertions(+), 2 deletions(-)
hw/arm/stm32f205_soc.c +0 -1
@@ -25,7 +25,6 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" -#include "cpu.h" #include "hw/arm/arm.h" #include "exec/address-spaces.h" #include "hw/arm/stm32f205_soc.h"
hw/arm/strongarm.h +1 -0
@@ -2,6 +2,7 @@#define _STRONGARM_H#include "exec/memory.h" +#include "target-arm/cpu-qom.h" #define SA_CS0 0x00000000#define SA_CS1 0x08000000
include/hw/arm/arm.h +1 -1
@@ -12,9 +12,9 @@#define ARM_MISC_H 1#include "exec/memory.h" +#include "target-arm/cpu-qom.h" #include "hw/irq.h" #include "qemu/notify.h" -#include "cpu.h" typedef enum { ARM_ENDIANNESS_UNKNOWN = 0,
include/hw/arm/exynos4210.h +1 -0
@@ -28,6 +28,7 @@#include "qemu-common.h" #include "exec/memory.h" +#include "target-arm/cpu-qom.h" #define EXYNOS4210_NCPUS 2
include/hw/arm/omap.h +1 -0
@@ -20,6 +20,7 @@#include "exec/memory.h" # define hw_omap_h "omap.h"#include "hw/irq.h" +#include "target-arm/cpu-qom.h" # define OMAP_EMIFS_BASE 0x00000000# define OMAP2_Q0_BASE 0x00000000
include/hw/arm/pxa.h +1 -0
@@ -10,6 +10,7 @@# define PXA_H "pxa.h"#include "exec/memory.h" +#include "target-arm/cpu-qom.h" /* Interrupt numbers */ # define PXA2XX_PIC_SSP3 0
Signature · 1 line
1.8.3.1
PATCH 22/49 m68k: include cpu-qom.h in files that require M68KCPU
In reply to Paolo Bonzini--- include/hw/m68k/mcf.h | 2 ++ 1 file changed, 2 insertions(+)
include/hw/m68k/mcf.h +2 -0
@@ -2,6 +2,8 @@#define HW_MCF_H /* Motorola ColdFire device prototypes. */ +#include "target-m68k/cpu-qom.h" +struct MemoryRegion ;/* mcf_uart.c */
Signature · 1 line
1.8.3.1
PATCH 23/49 sh4: include cpu-qom.h in files that require SuperHCPU
In reply to Paolo Bonzini--- include/hw/sh4/sh.h | 1 + 1 file changed, 1 insertion(+)
include/hw/sh4/sh.h +1 -0
@@ -3,6 +3,7 @@/* Definitions for SH board emulation. */ #include "hw/sh4/sh_intc.h" +#include "target-sh4/cpu-qom.h" #define A7ADDR (x) ((x) & 0x1fffffff)#define P4ADDR (x) ((x) | 0xe0000000)
Signature · 1 line
1.8.3.1
PATCH 24/49 alpha: include cpu-qom.h in files that require AlphaCPU
In reply to Paolo Bonzini--- hw/alpha/alpha_sys.h | 1 + hw/alpha/pci.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
hw/alpha/alpha_sys.h +1 -0
@@ -3,6 +3,7 @@#ifndef HW_ALPHA_H #define HW_ALPHA_H 1 +#include "target-alpha/cpu-qom.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" #include "hw/ide.h"
hw/alpha/pci.c +0 -1
@@ -8,7 +8,6 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "cpu.h" #include "alpha_sys.h" #include "qemu/log.h" #include "sysemu/sysemu.h"
Signature · 1 line
1.8.3.1
PATCH 25/49 mips: use MIPSCPU instead of CPUMIPSState
In reply to Paolo BonziniThis changes a cpu.h dependency into a cpu-qom.h dependency.
--- hw/mips/cputimer.c | 4 +++- hw/mips/mips_fulong2e.c | 4 ++-- hw/mips/mips_int.c | 3 ++- hw/mips/mips_jazz.c | 4 ++-- hw/mips/mips_malta.c | 9 ++++----- hw/mips/mips_mipssim.c | 4 ++-- hw/mips/mips_r4k.c | 4 ++-- include/hw/mips/cpudevs.h | 7 +++++-- 8 files changed, 22 insertions(+), 17 deletions(-)
hw/mips/cputimer.c +3 -1
@@ -151,8 +151,10 @@ static void mips_timer_cb (void *opaque) env->CP0_Count--; } -void cpu_mips_clock_init (CPUMIPSState *env) +void cpu_mips_clock_init (MIPSCPU *cpu) { +CPUMIPSState *env = &cpu->env; +/* * If we're in KVM mode, don't create the periodic timer, that is handled in * kernel.
hw/mips/mips_fulong2e.c +2 -2
@@ -334,8 +334,8 @@ static void mips_fulong2e_init(MachineState *machine) }/* Init internal devices */ -cpu_mips_irq_init_cpu (env); -cpu_mips_clock_init (env); +cpu_mips_irq_init_cpu (cpu); +cpu_mips_clock_init (cpu);/* North bridge, Bonito --> IP2 */ pci_bus =bonito_init ((qemu_irq *)&(env->irq[2 ]));
hw/mips/mips_int.c +2 -1
@@ -58,8 +58,9 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level) } } -void cpu_mips_irq_init_cpu (CPUMIPSState *env) +void cpu_mips_irq_init_cpu (MIPSCPU *cpu) { +CPUMIPSState *env = &cpu->env;qemu_irq *qi;int i;
hw/mips/mips_jazz.c +2 -2
@@ -200,8 +200,8 @@ static void mips_jazz_init(MachineState *machine, }/* Init CPU internal devices */ -cpu_mips_irq_init_cpu (env); -cpu_mips_clock_init (env); +cpu_mips_irq_init_cpu (cpu); +cpu_mips_clock_init (cpu);/* Chipset */ rc4030 =rc4030_init (&dmas, &rc4030_dma_mr);
hw/mips/mips_malta.c +4 -5
@@ -977,11 +977,10 @@ void mips_malta_init(MachineState *machine)fprintf (stderr,"Unable to find CPU definition\n" );exit (1 ); } - env = &cpu->env;/* Init internal devices */ -cpu_mips_irq_init_cpu (env); -cpu_mips_clock_init (env); +cpu_mips_irq_init_cpu (cpu); +cpu_mips_clock_init (cpu);qemu_register_reset (main_cpu_reset, cpu); } cpu =MIPS_CPU (first_cpu);
@@ -1136,8 +1135,8 @@ void mips_malta_init(MachineState *machine)stl_p (memory_region_get_ram_ptr (bios_copy) +0x10 ,0x00000420 );/* Init internal devices */ -cpu_mips_irq_init_cpu (env); -cpu_mips_clock_init (env); +cpu_mips_irq_init_cpu (cpu); +cpu_mips_clock_init (cpu);/* * We have a circular dependency problem: pci_bus depends on isa_irq,
hw/mips/mips_mipssim.c +2 -2
@@ -216,8 +216,8 @@ mips_mipssim_init(MachineState *machine) }/* Init CPU internal devices. */ -cpu_mips_irq_init_cpu (env); -cpu_mips_clock_init (env); +cpu_mips_irq_init_cpu (cpu); +cpu_mips_clock_init (cpu);/* Register 64 KB of ISA IO space at 0x1fd00000. */ memory_region_init_alias(isa, NULL, "isa_mmio",
hw/mips/mips_r4k.c +2 -2
@@ -267,8 +267,8 @@ void mips_r4k_init(MachineState *machine) }/* Init CPU internal devices */ -cpu_mips_irq_init_cpu (env); -cpu_mips_clock_init (env); +cpu_mips_irq_init_cpu (cpu); +cpu_mips_clock_init (cpu);/* ISA bus: IO space at 0x14000000, mem space at 0x10000000 */ memory_region_init_alias(isa_io, NULL, "isa-io",
include/hw/mips/cpudevs.h +5 -2
@@ -1,5 +1,8 @@#ifndef HW_MIPS_CPUDEVS_H #define HW_MIPS_CPUDEVS_H + +#include "target-mips/cpu-qom.h" +/* Definitions for MIPS CPU internal devices. */ /* mips_addr.c */
@@ -9,9 +12,9 @@ uint64_t cpu_mips_kvm_um_phys_to_kseg0(void *opaque, uint64_t addr);/* mips_int.c */ -void cpu_mips_irq_init_cpu (CPUMIPSState *env); +void cpu_mips_irq_init_cpu (MIPSCPU *cpu);/* mips_timer.c */ -void cpu_mips_clock_init (CPUMIPSState *); +void cpu_mips_clock_init (MIPSCPU *cpu);#endif
Signature · 1 line
1.8.3.1
PATCH 26/49 ppc: use PowerPCCPU instead of CPUPPCState
In reply to Paolo BonziniThis changes a cpu.h dependency for hw/ppc/ppc.h into a cpu-qom.h dependency. For it to compile we also need to clean up a few unused definitions.
--- hw/ppc/ppc.c | 20 +++++----- include/hw/ppc/ppc.h | 24 +++++++----- target-ppc/translate_init.c | 92 +++++++++++++++++++-------------------------- 3 files changed, 63 insertions(+), 73 deletions(-)
hw/ppc/ppc.c +10 -10
@@ -164,9 +164,9 @@ static void ppc6xx_set_irq(void *opaque, int pin, int level) } } -void ppc6xx_irq_init (CPUPPCState *env) +void ppc6xx_irq_init (PowerPCCPU *cpu) { -PowerPCCPU *cpu =ppc_env_get_cpu (env); +CPUPPCState *env = &cpu->env; env->irq_inputs = (void **)qemu_allocate_irqs (&ppc6xx_set_irq, cpu, PPC6xx_INPUT_NB);
@@ -251,9 +251,9 @@ static void ppc970_set_irq(void *opaque, int pin, int level) } } -void ppc970_irq_init (CPUPPCState *env) +void ppc970_irq_init (PowerPCCPU *cpu) { -PowerPCCPU *cpu =ppc_env_get_cpu (env); +CPUPPCState *env = &cpu->env; env->irq_inputs = (void **)qemu_allocate_irqs (&ppc970_set_irq, cpu,PPC970_INPUT_NB );
@@ -287,9 +287,9 @@ static void power7_set_irq(void *opaque, int pin, int level) } } -void ppcPOWER7_irq_init (CPUPPCState *env) +void ppcPOWER7_irq_init (PowerPCCPU *cpu) { -PowerPCCPU *cpu =ppc_env_get_cpu (env); +CPUPPCState *env = &cpu->env; env->irq_inputs = (void **)qemu_allocate_irqs (&power7_set_irq, cpu,POWER7_INPUT_NB );
@@ -372,9 +372,9 @@ static void ppc40x_set_irq(void *opaque, int pin, int level) } } -void ppc40x_irq_init (CPUPPCState *env) +void ppc40x_irq_init (PowerPCCPU *cpu) { -PowerPCCPU *cpu =ppc_env_get_cpu (env); +CPUPPCState *env = &cpu->env; env->irq_inputs = (void **)qemu_allocate_irqs (&ppc40x_set_irq, cpu, PPC40x_INPUT_NB);
@@ -436,9 +436,9 @@ static void ppce500_set_irq(void *opaque, int pin, int level) } } -void ppce500_irq_init (CPUPPCState *env) +void ppce500_irq_init (PowerPCCPU *cpu) { -PowerPCCPU *cpu =ppc_env_get_cpu (env); +CPUPPCState *env = &cpu->env; env->irq_inputs = (void **)qemu_allocate_irqs (&ppce500_set_irq, cpu,PPCE500_INPUT_NB );
include/hw/ppc/ppc.h +15 -9
@@ -1,6 +1,8 @@#ifndef HW_PPC_H #define HW_PPC_H 1 +#include "target-ppc/cpu-qom.h" +void ppc_set_irq (PowerPCCPU *cpu,int n_IRQ,int level);/* PowerPC hardware exceptions management helpers */
@@ -64,17 +66,21 @@ clk_setup_cb ppc_40x_timers_init (CPUPPCState *env, uint32_t freq,void ppc40x_core_reset (PowerPCCPU *cpu);void ppc40x_chip_reset (PowerPCCPU *cpu);void ppc40x_system_reset (PowerPCCPU *cpu); -void PREP_debug_write (void *opaque,uint32_t addr,uint32_t val); - -extern CPUWriteMemoryFunc *const PPC_io_write[]; -extern CPUReadMemoryFunc *const PPC_io_read[];void PPC_debug_write (void *opaque,uint32_t addr,uint32_t val); -void ppc40x_irq_init (CPUPPCState *env); -void ppce500_irq_init (CPUPPCState *env); -void ppc6xx_irq_init (CPUPPCState *env); -void ppc970_irq_init (CPUPPCState *env); -void ppcPOWER7_irq_init (CPUPPCState *env); +#if defined(CONFIG_USER_ONLY ) +static inline void ppc40x_irq_init (PowerPCCPU *cpu) {} +static inline void ppc6xx_irq_init (PowerPCCPU *cpu) {} +static inline void ppc970_irq_init (PowerPCCPU *cpu) {} +static inline void ppcPOWER7_irq_init (PowerPCCPU *cpu) {} +static inline void ppce500_irq_init (PowerPCCPU *cpu) {} +#else +void ppc40x_irq_init (PowerPCCPU *cpu); +void ppce500_irq_init (PowerPCCPU *cpu); +void ppc6xx_irq_init (PowerPCCPU *cpu); +void ppc970_irq_init (PowerPCCPU *cpu); +void ppcPOWER7_irq_init (PowerPCCPU *cpu); +#endif /* PPC machines for OpenBIOS */ enum {
target-ppc/translate_init.c +38 -54
324 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 27/49 arm: remove useless cpu.h inclusion
In reply to Paolo Bonzini--- include/hw/arm/digic.h | 2 -- 1 file changed, 2 deletions(-)
include/hw/arm/digic.h +0 -2
@@ -18,8 +18,6 @@#ifndef HW_ARM_DIGIC_H #define HW_ARM_DIGIC_H -#include "cpu.h" -#include "hw/timer/digic-timer.h" #include "hw/char/digic-uart.h"
Signature · 1 line
1.8.3.1
PATCH 28/49 explicitly include qom/cpu.h
In reply to Paolo Bonzini--- hw/acpi/piix4.c | 1 + hw/arm/collie.c | 1 + hw/cpu/a9mpcore.c | 1 + hw/isa/lpc_ich9.c | 1 + include/hw/ppc/openpic.h | 1 + 5 files changed, 5 insertions(+)
hw/acpi/piix4.c +1 -0
@@ -39,6 +39,7 @@#include "hw/acpi/memory_hotplug.h" #include "hw/acpi/acpi_dev_interface.h" #include "hw/xen/xen.h" +#include "qom/cpu.h" //#define DEBUG
hw/arm/collie.c +1 -0
@@ -18,6 +18,7 @@#include "hw/block/flash.h" #include "sysemu/block-backend.h" #include "exec/address-spaces.h" +#include "qom/cpu.h" static struct arm_boot_info collie_binfo = { .loader_start =SA_SDCS0 ,
hw/cpu/a9mpcore.c +1 -0
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/cpu/a9mpcore.h" +#include "qom/cpu.h" static void a9mp_priv_set_irq (void *opaque,int irq,int level) {
hw/isa/lpc_ich9.c +1 -0
@@ -47,6 +47,7 @@#include "hw/pci/pci_bus.h" #include "exec/address-spaces.h" #include "sysemu/sysemu.h" +#include "qom/cpu.h" static int ich9_lpc_sci_irq (ICH9LPCState *lpc);
include/hw/ppc/openpic.h +1 -0
@@ -3,6 +3,7 @@#include "qemu-common.h" #include "hw/qdev.h" +#include "qom/cpu.h" #define TYPE_OPENPIC "openpic"
Signature · 1 line
1.8.3.1
PATCH 29/49 explicitly include hw/qdev-core.h
In reply to Paolo Bonzini--- bootdevice.c | 1 + 1 file changed, 1 insertion(+)
bootdevice.c +1 -0
@@ -28,6 +28,7 @@#include "qapi/visitor.h" #include "qemu/error-report.h" #include "hw/hw.h" +#include "hw/qdev-core.h" typedef struct FWBootEntry FWBootEntry ;
Signature · 1 line
1.8.3.1
PATCH 30/49 explicitly include linux/kvm.h
In reply to Paolo Bonzini--- hw/i386/kvm/i8254.c | 1 + hw/i386/kvm/pci-assign.c | 1 + hw/vfio/common.c | 3 +++ 3 files changed, 5 insertions(+)
hw/i386/kvm/i8254.c +1 -0
@@ -29,6 +29,7 @@#include "hw/timer/i8254.h" #include "hw/timer/i8254_internal.h" #include "sysemu/kvm.h" +#include "linux/kvm.h" #define KVM_PIT_REINJECT_BIT 0
hw/i386/kvm/pci-assign.c +1 -0
@@ -33,6 +33,7 @@#include "sysemu/sysemu.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" +#include "linux/kvm.h" #include "kvm_i386.h" #include "hw/pci/pci-assign.h"
hw/vfio/common.c +3 -0
@@ -30,6 +30,9 @@#include "hw/hw.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" +#ifdef CONFIG_KVM +#include "linux/kvm.h" +#endif #include "trace.h" struct vfio_group_head vfio_group_list =
Signature · 1 line
1.8.3.1
PATCH 31/49 apic: move target-dependent definitions to cpu.h
In reply to Paolo Bonzini--- hw/intc/ioapic.c | 1 + include/hw/i386/apic.h | 5 ----- target-i386/cpu.h | 7 +++++++ 3 files changed, 8 insertions(+), 5 deletions(-)
hw/intc/ioapic.c +1 -0
@@ -24,6 +24,7 @@#include "monitor/monitor.h" #include "hw/hw.h" #include "hw/i386/pc.h" +#include "hw/i386/apic.h" #include "hw/i386/ioapic.h" #include "hw/i386/ioapic_internal.h" #include "include/hw/pci/msi.h"
include/hw/i386/apic.h +0 -5
@@ -18,15 +18,10 @@ void cpu_set_apic_tpr(DeviceState *s, uint8_t val);uint8_t cpu_get_apic_tpr (DeviceState *s);void apic_init_reset (DeviceState *s);void apic_sipi (DeviceState *s); -void apic_handle_tpr_access_report (DeviceState *d,target_ulong ip, -TPRAccess access);void apic_poll_irq (DeviceState *d);void apic_designate_bsp (DeviceState *d,bool bsp);/* pc.c */ DeviceState *cpu_get_current_apic (void ); -/* cpu.c */ -bool cpu_is_bsp (X86CPU *cpu); -#endif
target-i386/cpu.h +7 -0
@@ -1451,7 +1451,11 @@ void do_interrupt_x86_hardirq(CPUX86State *env, int intno, int is_hw);void do_smm_enter (X86CPU *cpu);void cpu_smm_update (X86CPU *cpu); +/* apic.c */ void cpu_report_tpr_access (CPUX86State *env,TPRAccess access); +void apic_handle_tpr_access_report (DeviceState *d,target_ulong ip, +TPRAccess access); +/* Change the value of a KVM-specific default *
@@ -1477,4 +1481,7 @@ void enable_compat_apic_id_mode(void);void x86_cpu_dump_local_apic_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf,int flags); +/* cpu.c */ +bool cpu_is_bsp (X86CPU *cpu); +#endif /* CPU_I386_H */
Signature · 1 line
1.8.3.1
PATCH 32/49 include: poison symbols in osdep.h
In reply to Paolo BonziniEnsure that all target-independent files ignore poisoned symbols, and fix the fallout.
--- hw/core/Makefile.objs | 2 +- include/exec/cpu-common.h | 4 ---- include/exec/helper-head.h | 23 +++++++++++++---------- include/qemu/osdep.h | 2 ++ scripts/create_config | 2 +- 5 files changed, 17 insertions(+), 16 deletions(-)
hw/core/Makefile.objs +1 -1
@@ -4,7 +4,7 @@ common-obj-y += fw-path-provider.o # irq.o needed for qdev GPIO handling: common-obj-y += irq.o common-obj-y += hotplug.o -common-obj-y += nmi.o +obj-y += nmi.o common-obj-$(CONFIG_EMPTY_SLOT) += empty_slot.o common-obj-$(CONFIG_XILINX_AXI) += stream.o
include/exec/cpu-common.h +0 -4
@@ -7,10 +7,6 @@#include "exec/hwaddr.h" #endif -#ifndef NEED_CPU_H -#include "exec/poison.h" -#endif -#include "qemu/bswap.h" #include "qemu/queue.h" #include "qemu/fprintf-fn.h"
include/exec/helper-head.h +13 -10
@@ -33,17 +33,9 @@#define dh_alias_s64 i64#define dh_alias_f32 i32#define dh_alias_f64 i64 -#ifdef TARGET_LONG_BITS -# if TARGET_LONG_BITS ==32 -# define dh_alias_tl i32 -# else -# define dh_alias_tl i64 -# endif -#endif #define dh_alias_ptr ptr#define dh_alias_void void#define dh_alias_noreturn noreturn -#define dh_alias_env ptr#define dh_alias (t) glue(dh_alias_, t)#define dh_ctype_i32 uint32_t
@@ -53,13 +45,24 @@#define dh_ctype_s64 int64_t#define dh_ctype_f32 float32#define dh_ctype_f64 float64 -#define dh_ctype_tl target_ulong#define dh_ctype_ptr void *#define dh_ctype_void void#define dh_ctype_noreturn void QEMU_NORETURN -#define dh_ctype_env CPUArchState *#define dh_ctype (t) dh_ctype_##t +#ifdef NEED_CPU_H +# ifdef TARGET_LONG_BITS +# if TARGET_LONG_BITS ==32 +# define dh_alias_tl i32 +# else +# define dh_alias_tl i64 +# endif +# endif +# define dh_alias_env ptr +# define dh_ctype_tl target_ulong +# define dh_ctype_env CPUArchState * +#endif +/* We can't use glue() here because it falls foul of C preprocessor recursive expansion rules. */ #define dh_retvar_decl0_void void
include/qemu/osdep.h +2 -0
@@ -30,6 +30,8 @@#include "config-host.h" #ifdef NEED_CPU_H #include "config-target.h" +#else +#include "exec/poison.h" #endif #include "qemu/compiler.h"
scripts/create_config +1 -1
@@ -52,7 +52,7 @@ case $line in done echo " NULL" ;; - CONFIG_*=y) # configuration + CONFIG_*='$(CONFIG_SOFTMMU)'|CONFIG_*=y) # configuration name=${line%=*} echo "#define $name 1" ;;
Signature · 1 line
1.8.3.1
PATCH 33/49 hw: do not use VMSTATE_*TL
In reply to Paolo BonziniReserve this to CPU state serialization.
Luckily, they were only used by sPAPR devices and these are ppc64 only. So there is no change to migration format.
--- hw/net/spapr_llan.c | 8 ++++---- hw/ppc/spapr_vio.c | 2 +- include/hw/ppc/spapr_vio.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
hw/net/spapr_llan.c +4 -4
@@ -93,9 +93,9 @@ typedef struct VIOsPAPRVLANDevice {NICConf nicconf;NICState *nic;bool isopen; -target_ulong buf_list; +hwaddr buf_list;uint32_t add_buf_ptr, use_buf_ptr, rx_bufs; -target_ulong rxq_ptr; +hwaddr rxq_ptr; } VIOsPAPRVLANDevice;static int spapr_vlan_can_receive (NetClientState *nc)
@@ -522,11 +522,11 @@ static const VMStateDescription vmstate_spapr_llan = {VMSTATE_SPAPR_VIO (sdev, VIOsPAPRVLANDevice),/* LLAN state */ VMSTATE_BOOL (isopen, VIOsPAPRVLANDevice), -VMSTATE_UINTTL (buf_list, VIOsPAPRVLANDevice), +VMSTATE_UINT64 (buf_list, VIOsPAPRVLANDevice),VMSTATE_UINT32 (add_buf_ptr, VIOsPAPRVLANDevice),VMSTATE_UINT32 (use_buf_ptr, VIOsPAPRVLANDevice),VMSTATE_UINT32 (rx_bufs, VIOsPAPRVLANDevice), -VMSTATE_UINTTL (rxq_ptr, VIOsPAPRVLANDevice), +VMSTATE_UINT64 (rxq_ptr, VIOsPAPRVLANDevice),VMSTATE_END_OF_LIST () },
hw/ppc/spapr_vio.c +1 -1
@@ -584,7 +584,7 @@ const VMStateDescription vmstate_spapr_vio = {VMSTATE_UINT32_EQUAL (irq, VIOsPAPRDevice),/* General VIO device state */ -VMSTATE_UINTTL (signal_state, VIOsPAPRDevice), +VMSTATE_UINT64 (signal_state, VIOsPAPRDevice),VMSTATE_UINT64 (crq.qladdr, VIOsPAPRDevice),VMSTATE_UINT32 (crq.qsize, VIOsPAPRDevice), VMSTATE_UINT32(crq.qnext, VIOsPAPRDevice),
include/hw/ppc/spapr_vio.h +1 -1
@@ -61,7 +61,7 @@ struct VIOsPAPRDevice {DeviceState qdev;uint32_t reg;uint32_t irq; -target_ulong signal_state; +uint64_t signal_state;VIOsPAPR_CRQ crq;AddressSpace as;MemoryRegion mrroot;
Signature · 1 line
1.8.3.1
PATCH 34/49 hw: move CPU state serialization to migration/cpu.h
In reply to Paolo BonziniRemove usage of NEED_CPU_H from hw/hw.h.
--- include/hw/hw.h | 49 ----------------------------------------------- include/migration/cpu.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++ target-alpha/machine.c | 1 + target-arm/machine.c | 1 + target-cris/machine.c | 1 + target-i386/machine.c | 1 + target-lm32/machine.c | 1 + target-mips/machine.c | 2 +- target-moxie/machine.c | 1 + target-openrisc/machine.c | 1 + target-ppc/machine.c | 1 + target-sparc/machine.c | 1 + 12 files changed, 58 insertions(+), 50 deletions(-) create mode 100644 include/migration/cpu.h
include/hw/hw.h +0 -49
@@ -14,28 +14,6 @@#include "qemu/log.h" #include "qemu/module.h" -#ifdef NEED_CPU_H -#if TARGET_LONG_BITS ==64 -#define qemu_put_betl qemu_put_be64 -#define qemu_get_betl qemu_get_be64 -#define qemu_put_betls qemu_put_be64s -#define qemu_get_betls qemu_get_be64s -#define qemu_put_sbetl qemu_put_sbe64 -#define qemu_get_sbetl qemu_get_sbe64 -#define qemu_put_sbetls qemu_put_sbe64s -#define qemu_get_sbetls qemu_get_sbe64s -#else -#define qemu_put_betl qemu_put_be32 -#define qemu_get_betl qemu_get_be32 -#define qemu_put_betls qemu_put_be32s -#define qemu_get_betls qemu_get_be32s -#define qemu_put_sbetl qemu_put_sbe32 -#define qemu_get_sbetl qemu_get_sbe32 -#define qemu_put_sbetls qemu_put_sbe32s -#define qemu_get_sbetls qemu_get_sbe32s -#endif -#endif -typedef void QEMUResetHandler (void *opaque);void qemu_register_reset (QEMUResetHandler *func,void *opaque);
@@ -43,31 +21,4 @@ void qemu_unregister_reset(QEMUResetHandler *func, void *opaque); void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -#ifdef NEED_CPU_H -#if TARGET_LONG_BITS ==64 -#define VMSTATE_UINTTL_V (_f, _s, _v) \ - VMSTATE_UINT64_V(_f, _s, _v) -#define VMSTATE_UINTTL_EQUAL_V (_f, _s, _v) \ - VMSTATE_UINT64_EQUAL_V(_f, _s, _v) -#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_UINT64_ARRAY_V(_f, _s, _n, _v) -#define vmstate_info_uinttl vmstate_info_uint64 -#else -#define VMSTATE_UINTTL_V (_f, _s, _v) \ - VMSTATE_UINT32_V(_f, _s, _v) -#define VMSTATE_UINTTL_EQUAL_V (_f, _s, _v) \ - VMSTATE_UINT32_EQUAL_V(_f, _s, _v) -#define VMSTATE_UINTTL_ARRAY_V (_f, _s, _n, _v) \ - VMSTATE_UINT32_ARRAY_V(_f, _s, _n, _v) -#define vmstate_info_uinttl vmstate_info_uint32 -#endif -#define VMSTATE_UINTTL (_f, _s) \ - VMSTATE_UINTTL_V(_f, _s, 0) -#define VMSTATE_UINTTL_EQUAL (_f, _s) \ - VMSTATE_UINTTL_EQUAL_V(_f, _s, 0) -#define VMSTATE_UINTTL_ARRAY (_f, _s, _n) \ - VMSTATE_UINTTL_ARRAY_V(_f, _s, _n, 0) - -#endif -#endif
include/migration/cpu.h new file +48 -0
48 lines not on this page · raw message
target-alpha/machine.c +1 -0
@@ -1,6 +1,7 @@#include "qemu/osdep.h" #include "hw/hw.h" #include "hw/boards.h" +#include "migration/cpu.h" static int get_fpcr (QEMUFile *f,void *opaque,size_t size) {
target-arm/machine.c +1 -0
@@ -5,6 +5,7 @@#include "sysemu/kvm.h" #include "kvm_arm.h" #include "internals.h" +#include "migration/cpu.h" static bool vfp_needed (void *opaque) {
target-cris/machine.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "hw/hw.h" +#include "migration/cpu.h" static const VMStateDescription vmstate_tlbset = { .name ="cpu/tlbset" ,
target-i386/machine.c +1 -0
@@ -3,6 +3,7 @@#include "hw/boards.h" #include "hw/i386/pc.h" #include "hw/isa/isa.h" +#include "migration/cpu.h" #include "cpu.h" #include "sysemu/kvm.h"
target-lm32/machine.c +1 -0
@@ -1,6 +1,7 @@#include "qemu/osdep.h" #include "hw/hw.h" #include "hw/boards.h" +#include "migration/cpu.h" static const VMStateDescription vmstate_env = { .name ="env" ,
target-mips/machine.c +1 -1
@@ -1,7 +1,7 @@#include "qemu/osdep.h" #include "hw/hw.h" -#include "cpu.h" +#include "migration/cpu.h" static int cpu_post_load (void *opaque,int version_id) {
target-moxie/machine.c +1 -0
@@ -2,6 +2,7 @@#include "hw/hw.h" #include "hw/boards.h" #include "machine.h" +#include "migration/cpu.h" const VMStateDescription vmstate_moxie_cpu = { .name ="cpu" ,
target-openrisc/machine.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "hw/hw.h" #include "hw/boards.h" +#include "migration/cpu.h" static const VMStateDescription vmstate_env = { .name ="env" ,
target-ppc/machine.c +1 -0
@@ -4,6 +4,7 @@#include "sysemu/kvm.h" #include "helper_regs.h" #include "mmu-hash64.h" +#include "migration/cpu.h" static int cpu_load_old (QEMUFile *f,void *opaque,int version_id) {
target-sparc/machine.c +1 -0
@@ -4,6 +4,7 @@#include "qemu/timer.h" #include "cpu.h" +#include "migration/cpu.h" #ifdef TARGET_SPARC64 static const VMStateDescription vmstate_cpu_timer = {
Signature · 1 line
1.8.3.1
PATCH 35/49 hw: cannot include hw/hw.h from user emulation
In reply to Paolo BonziniAll qdev definitions are available from other headers, user-mode emulation does not need hw/hw.h.
By considering system emulation only, it is simpler to disentangle hw/hw.h from NEED_CPU_H.
--- exec.c | 21 +++++++++++---------- include/hw/hw.h | 5 +++-- include/hw/ppc/openpic.h | 2 +- kvm-stub.c | 1 - target-i386/cpu.c | 2 +- target-s390x/cpu.c | 3 ++- target-s390x/mem_helper.c | 3 +++ target-s390x/misc_helper.c | 2 +- 8 files changed, 22 insertions(+), 17 deletions(-)
exec.c +11 -10
@@ -25,23 +25,23 @@#include "qemu-common.h" #include "cpu.h" #include "tcg.h" -#include "hw/hw.h" +#include "hw/qdev-core.h" #if !defined(CONFIG_USER_ONLY )#include "hw/boards.h" #endif -#include "hw/qdev.h" #include "sysemu/kvm.h" #include "sysemu/sysemu.h" #include "hw/xen/xen.h" #include "qemu/timer.h" #include "qemu/config-file.h" #include "qemu/error-report.h" -#include "exec/memory.h" -#include "sysemu/dma.h" -#include "exec/address-spaces.h" #if defined(CONFIG_USER_ONLY )#include <qemu.h> #else /* !CONFIG_USER_ONLY */ +#include "hw/hw.h" +#include "exec/memory.h" +#include "sysemu/dma.h" +#include "exec/address-spaces.h" #include "sysemu/xen-mapcache.h" #include "trace.h" #endif
@@ -641,7 +641,6 @@ void cpu_exec_exit(CPUState *cpu)void cpu_exec_init (CPUState *cpu,Error **errp) {CPUClass *cc =CPU_GET_CLASS (cpu); -int cpu_index;Error *local_err =NULL ; cpu->as =NULL ;
@@ -668,7 +667,7 @@ void cpu_exec_init(CPUState *cpu, Error **errp)#if defined(CONFIG_USER_ONLY )cpu_list_lock ();#endif - cpu_index = cpu->cpu_index =cpu_get_free_index (&local_err); + cpu->cpu_index =cpu_get_free_index (&local_err);if (local_err) {error_propagate (errp, local_err);#if defined(CONFIG_USER_ONLY )
@@ -678,14 +677,16 @@ void cpu_exec_init(CPUState *cpu, Error **errp) }QTAILQ_INSERT_TAIL (&cpus, cpu, node);#if defined(CONFIG_USER_ONLY ) + (void ) cc;cpu_list_unlock (); -#endif +#else if (qdev_get_vmsd (DEVICE (cpu)) ==NULL ) { -vmstate_register (NULL , cpu_index, &vmstate_cpu_common, cpu); +vmstate_register (NULL , cpu->cpu_index, &vmstate_cpu_common, cpu); }if (cc->vmsd !=NULL ) { -vmstate_register (NULL , cpu_index, cc->vmsd, cpu); +vmstate_register (NULL , cpu->cpu_index, cc->vmsd, cpu); } +#endif }#if defined(CONFIG_USER_ONLY )
include/hw/hw.h +3 -2
@@ -3,10 +3,11 @@#define QEMU_HW_H -#if !defined(CONFIG_USER_ONLY ) && !defined(NEED_CPU_H ) -#include "exec/cpu-common.h" +#ifdef CONFIG_USER_ONLY +#error Cannot include hw/hw.h from user emulation#endif +#include "exec/cpu-common.h" #include "exec/ioport.h" #include "hw/irq.h" #include "block/aio.h"
include/hw/ppc/openpic.h +1 -1
@@ -2,7 +2,7 @@#define __OPENPIC_H__#include "qemu-common.h" -#include "hw/qdev.h" +#include "hw/qdev-core.h" #include "qom/cpu.h" #define TYPE_OPENPIC "openpic"
kvm-stub.c +0 -1
@@ -12,7 +12,6 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "hw/hw.h" #include "cpu.h" #include "sysemu/kvm.h"
target-i386/cpu.c +1 -1
@@ -33,7 +33,6 @@#include "qapi/visitor.h" #include "sysemu/arch_init.h" -#include "hw/hw.h" #if defined(CONFIG_KVM )#include <linux/kvm_para.h> #endif
@@ -42,6 +41,7 @@#include "hw/qdev-properties.h" #ifndef CONFIG_USER_ONLY #include "exec/address-spaces.h" +#include "hw/hw.h" #include "hw/xen/xen.h" #include "hw/i386/apic_internal.h" #endif
target-s390x/cpu.c +2 -1
@@ -29,10 +29,11 @@#include "qemu-common.h" #include "qemu/timer.h" #include "qemu/error-report.h" -#include "hw/hw.h" #include "trace.h" #include "qapi/visitor.h" +#include "migration/vmstate.h" #ifndef CONFIG_USER_ONLY +#include "hw/hw.h" #include "sysemu/arch_init.h" #include "sysemu/sysemu.h" #include "hw/s390x/sclp.h"
target-s390x/mem_helper.c +3 -0
@@ -22,7 +22,10 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" + +#if !defined(CONFIG_USER_ONLY )#include "hw/s390x/storage-keys.h" +#endif /*****************************************************************************/ /* Softmmu support */
target-s390x/misc_helper.c +1 -1
@@ -30,9 +30,9 @@#include <linux/kvm.h> #endif #include "exec/cpu_ldst.h" -#include "hw/watchdog/wdt_diag288.h" #if !defined(CONFIG_USER_ONLY ) +#include "hw/watchdog/wdt_diag288.h" #include "sysemu/cpus.h" #include "sysemu/sysemu.h" #include "hw/s390x/ebcdic.h"
Signature · 1 line
1.8.3.1
PATCH 36/49 cpu: move endian-dependent load/store functions to cpu-all.h
In reply to Paolo BonziniDisentangle cpu-common.h and memory.h from NEED_CPU_H. Prototypes are not defined for !NEED_CPU_H, so remove them from poison.h too. Only macros need poisoning.
--- include/exec/cpu-all.h | 25 +++++++++++++++++++++++++ include/exec/cpu-common.h | 10 ---------- include/exec/memory.h | 17 ----------------- include/exec/poison.h | 8 -------- 4 files changed, 25 insertions(+), 35 deletions(-)
include/exec/cpu-all.h +25 -0
@@ -165,6 +165,31 @@ extern unsigned long reserved_va;#define GUEST_ADDR_MAX (reserved_va ? reserved_va : \ (1ul << TARGET_VIRT_ADDR_SPACE_BITS) - 1) +#else + +#include "exec/hwaddr.h" +uint32_t lduw_phys (AddressSpace *as,hwaddr addr); +uint32_t ldl_phys (AddressSpace *as,hwaddr addr); +uint64_t ldq_phys (AddressSpace *as,hwaddr addr); +void stl_phys_notdirty (AddressSpace *as,hwaddr addr,uint32_t val); +void stw_phys (AddressSpace *as,hwaddr addr,uint32_t val); +void stl_phys (AddressSpace *as,hwaddr addr,uint32_t val); +void stq_phys (AddressSpace *as,hwaddr addr,uint64_t val); + +uint32_t address_space_lduw (AddressSpace *as,hwaddr addr, +MemTxAttrs attrs,MemTxResult *result); +uint32_t address_space_ldl (AddressSpace *as,hwaddr addr, +MemTxAttrs attrs,MemTxResult *result); +uint64_t address_space_ldq (AddressSpace *as,hwaddr addr, +MemTxAttrs attrs,MemTxResult *result); +void address_space_stl_notdirty (AddressSpace *as,hwaddr addr,uint32_t val, +MemTxAttrs attrs,MemTxResult *result); +void address_space_stw (AddressSpace *as,hwaddr addr,uint32_t val, +MemTxAttrs attrs,MemTxResult *result); +void address_space_stl (AddressSpace *as,hwaddr addr,uint32_t val, +MemTxAttrs attrs,MemTxResult *result); +void address_space_stq (AddressSpace *as,hwaddr addr,uint64_t val, +MemTxAttrs attrs,MemTxResult *result);#endif /* page related stuff */
include/exec/cpu-common.h +0 -10
@@ -109,16 +109,6 @@ void stl_be_phys(AddressSpace *as, hwaddr addr, uint32_t val);void stq_le_phys (AddressSpace *as,hwaddr addr,uint64_t val);void stq_be_phys (AddressSpace *as,hwaddr addr,uint64_t val); -#ifdef NEED_CPU_H -uint32_t lduw_phys (AddressSpace *as,hwaddr addr); -uint32_t ldl_phys (AddressSpace *as,hwaddr addr); -uint64_t ldq_phys (AddressSpace *as,hwaddr addr); -void stl_phys_notdirty (AddressSpace *as,hwaddr addr,uint32_t val); -void stw_phys (AddressSpace *as,hwaddr addr,uint32_t val); -void stl_phys (AddressSpace *as,hwaddr addr,uint32_t val); -void stq_phys (AddressSpace *as,hwaddr addr,uint64_t val); -#endif -void cpu_physical_memory_write_rom (AddressSpace *as,hwaddr addr,const uint8_t *buf,int len);void cpu_flush_icache_range (hwaddr start,int len);
include/exec/memory.h +0 -17
@@ -1292,23 +1292,6 @@ void address_space_stq_le(AddressSpace *as, hwaddr addr, uint64_t val,void address_space_stq_be (AddressSpace *as,hwaddr addr,uint64_t val,MemTxAttrs attrs,MemTxResult *result); -#ifdef NEED_CPU_H -uint32_t address_space_lduw (AddressSpace *as,hwaddr addr, -MemTxAttrs attrs,MemTxResult *result); -uint32_t address_space_ldl (AddressSpace *as,hwaddr addr, -MemTxAttrs attrs,MemTxResult *result); -uint64_t address_space_ldq (AddressSpace *as,hwaddr addr, -MemTxAttrs attrs,MemTxResult *result); -void address_space_stl_notdirty (AddressSpace *as,hwaddr addr,uint32_t val, -MemTxAttrs attrs,MemTxResult *result); -void address_space_stw (AddressSpace *as,hwaddr addr,uint32_t val, -MemTxAttrs attrs,MemTxResult *result); -void address_space_stl (AddressSpace *as,hwaddr addr,uint32_t val, -MemTxAttrs attrs,MemTxResult *result); -void address_space_stq (AddressSpace *as,hwaddr addr,uint64_t val, -MemTxAttrs attrs,MemTxResult *result); -#endif -/* address_space_translate: translate an address range into an address space * into a MemoryRegion and an address range into that section. Should be * called from an RCU critical section, to avoid that the last reference
include/exec/poison.h +0 -8
@@ -37,14 +37,6 @@#pragma GCC poison CPUArchState -#pragma GCC poison lduw_phys -#pragma GCC poison ldl_phys -#pragma GCC poison ldq_phys -#pragma GCC poison stl_phys_notdirty -#pragma GCC poison stw_phys -#pragma GCC poison stl_phys -#pragma GCC poison stq_phys -#pragma GCC poison CPU_INTERRUPT_HARD#pragma GCC poison CPU_INTERRUPT_EXITTB#pragma GCC poison CPU_INTERRUPT_HALT
Signature · 1 line
1.8.3.1
PATCH 37/49 qemu-common: stop including qemu/bswap.h from qemu-common.h
In reply to Paolo BonziniMove it to the actual users. There are still a few includes of qemu/bswap.h in headers; removing them is left for future work.
--- audio/mixeng.c | 1 + block/bochs.c | 1 + block/cloop.c | 1 + block/parallels.c | 1 + block/qcow.c | 1 + block/qcow2-cluster.c | 1 + block/qcow2-refcount.c | 1 + block/qcow2-snapshot.c | 1 + block/qcow2.c | 1 + block/qed-table.c | 1 + block/qed.c | 1 + block/vdi.c | 1 + block/vhdx-endian.c | 1 + block/vhdx-log.c | 1 + block/vhdx.c | 1 + block/vmdk.c | 1 + block/vpc.c | 1 + block/vvfat.c | 1 + device_tree.c | 1 + hw/arm/nseries.c | 1 + hw/block/hd-geometry.c | 1 + hw/bt/hci-csr.c | 1 + hw/bt/l2cap.c | 1 + include/qemu-common.h | 2 -- io/channel-websock.c | 1 + nbd/nbd-internal.h | 1 + qemu-nbd.c | 1 + tests/ide-test.c | 1 + ui/vnc-ws.c | 1 + 29 files changed, 28 insertions(+), 2 deletions(-)
audio/mixeng.c +1 -0
@@ -24,6 +24,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/bswap.h" #include "audio.h" #define AUDIO_CAP "mixeng"
block/bochs.c +1 -0
@@ -27,6 +27,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" +#include "qemu/bswap.h" /**************************************************************/
block/cloop.c +1 -0
@@ -26,6 +26,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include <zlib.h> /* Maximum compressed block size */
block/parallels.c +1 -0
@@ -32,6 +32,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "qemu/bitmap.h" #include "qapi/util.h"
block/qcow.c +1 -0
@@ -26,6 +26,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include <zlib.h> #include "qapi/qmp/qerror.h" #include "crypto/cipher.h"
block/qcow2-cluster.c +1 -0
@@ -29,6 +29,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "block/qcow2.h" +#include "qemu/bswap.h" #include "trace.h" int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size,
block/qcow2-refcount.c +1 -0
@@ -28,6 +28,7 @@#include "block/block_int.h" #include "block/qcow2.h" #include "qemu/range.h" +#include "qemu/bswap.h" static int64_t alloc_clusters_noref (BlockDriverState *bs,uint64_t size); static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
block/qcow2-snapshot.c +1 -0
@@ -27,6 +27,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "block/qcow2.h" +#include "qemu/bswap.h" #include "qemu/error-report.h" void qcow2_free_snapshots (BlockDriverState *bs)
block/qcow2.c +1 -0
@@ -35,6 +35,7 @@#include "qapi-event.h" #include "trace.h" #include "qemu/option_int.h" +#include "qemu/bswap.h" /* Differences with QCOW:
block/qed-table.c +1 -0
@@ -16,6 +16,7 @@#include "trace.h" #include "qemu/sockets.h" /* for EINPROGRESS on Windows */ #include "qed.h" +#include "qemu/bswap.h" typedef struct { GenericCB gencb;
block/qed.c +1 -0
@@ -15,6 +15,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/timer.h" +#include "qemu/bswap.h" #include "trace.h" #include "qed.h" #include "qapi/qmp/qerror.h"
block/vdi.c +1 -0
@@ -54,6 +54,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "migration/migration.h" #include "qemu/coroutine.h"
block/vhdx-endian.c +1 -0
@@ -18,6 +18,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "block/block_int.h" +#include "qemu/bswap.h" #include "block/vhdx.h" #include <uuid/uuid.h>
block/vhdx-log.c +1 -0
@@ -23,6 +23,7 @@#include "block/block_int.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "block/vhdx.h"
block/vhdx.c +1 -0
@@ -21,6 +21,7 @@#include "block/block_int.h" #include "qemu/module.h" #include "qemu/crc32c.h" +#include "qemu/bswap.h" #include "block/vhdx.h" #include "migration/migration.h"
block/vmdk.c +1 -0
@@ -30,6 +30,7 @@#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "migration/migration.h" #include <zlib.h> #include <glib.h>
block/vpc.c +1 -0
@@ -28,6 +28,7 @@#include "block/block_int.h" #include "qemu/module.h" #include "migration/migration.h" +#include "qemu/bswap.h" #if defined(CONFIG_UUID )#include <uuid/uuid.h> #endif
block/vvfat.c +1 -0
@@ -28,6 +28,7 @@#include "qemu-common.h" #include "block/block_int.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "migration/migration.h" #include "qapi/qmp/qint.h" #include "qapi/qmp/qbool.h"
device_tree.c +1 -0
@@ -20,6 +20,7 @@#include "qapi/error.h" #include "qemu-common.h" #include "qemu/error-report.h" +#include "qemu/bswap.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" #include "hw/loader.h"
hw/arm/nseries.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "qemu/bswap.h" #include "sysemu/sysemu.h" #include "hw/arm/omap.h" #include "hw/arm/arm.h"
hw/block/hd-geometry.c +1 -0
@@ -32,6 +32,7 @@#include "qemu/osdep.h" #include "sysemu/block-backend.h" +#include "qemu/bswap.h" #include "hw/block/block.h" #include "trace.h"
hw/bt/hci-csr.c +1 -0
@@ -22,6 +22,7 @@#include "qemu-common.h" #include "sysemu/char.h" #include "qemu/timer.h" +#include "qemu/bswap.h" #include "hw/irq.h" #include "sysemu/bt.h" #include "hw/bt.h"
hw/bt/l2cap.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/timer.h" +#include "qemu/bswap.h" #include "hw/bt.h" #define L2CAP_CID_MAX 0x100/* Between 0x40 and 0x10000 */
include/qemu-common.h +0 -2
@@ -23,8 +23,6 @@#include "qemu/option.h" #include "qemu/host-utils.h" -#include "qemu/bswap.h" -/* FIXME: Remove NEED_CPU_H. */ #ifdef NEED_CPU_H #include "cpu.h"
io/channel-websock.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/bswap.h" #include "io/channel-websock.h" #include "crypto/hash.h" #include "trace.h"
nbd/nbd-internal.h +1 -0
@@ -27,6 +27,7 @@#include <linux/fs.h> #endif +#include "qemu/bswap.h" #include "qemu/queue.h" #include "qemu/main-loop.h"
qemu-nbd.c +1 -0
@@ -25,6 +25,7 @@#include "qemu/main-loop.h" #include "qemu/error-report.h" #include "qemu/config-file.h" +#include "qemu/bswap.h" #include "block/snapshot.h" #include "qapi/util.h" #include "qapi/qmp/qstring.h"
tests/ide-test.c +1 -0
@@ -32,6 +32,7 @@#include "libqos/malloc-pc.h" #include "qemu-common.h" +#include "qemu/bswap.h" #include "hw/pci/pci_ids.h" #include "hw/pci/pci_regs.h"
ui/vnc-ws.c +1 -0
@@ -22,6 +22,7 @@#include "qapi/error.h" #include "vnc.h" #include "io/channel-websock.h" +#include "qemu/bswap.h" static void vncws_tls_handshake_done(Object *source, Error *err,
Signature · 1 line
1.8.3.1
PATCH 38/49 qemu-common: stop including qemu/host-utils.h from qemu-common.h
In reply to Paolo BonziniMove it to the actual users. There are some inclusions of qemu/host-utils.h in headers, but they are all necessary.
--- audio/noaudio.c | 1 + audio/wavaudio.c | 2 +- contrib/ivshmem-server/ivshmem-server.c | 1 + hw/acpi/core.c | 6 ++++++ hw/bt/sdp.c | 1 + hw/display/tc6393xb.c | 1 + include/exec/cpu-defs.h | 1 + include/hw/acpi/acpi.h | 7 ------- include/qemu-common.h | 1 - include/qemu/timer.h | 1 - page_cache.c | 1 + slirp/slirp.h | 1 + stubs/slirp.c | 1 + tests/libqos/malloc.c | 1 + util/buffer.c | 1 + 15 files changed, 17 insertions(+), 10 deletions(-)
audio/noaudio.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/host-utils.h" #include "audio.h" #include "qemu/timer.h"
audio/wavaudio.c +1 -1
@@ -22,7 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" -#include "hw/hw.h" +#include "qemu/host-utils.h" #include "qemu/timer.h" #include "audio.h"
contrib/ivshmem-server/ivshmem-server.c +1 -0
@@ -7,6 +7,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/host-utils.h" #include "qemu/sockets.h" #include <sys/mman.h>
hw/acpi/core.c +6 -0
@@ -491,6 +491,12 @@ void acpi_pm_tmr_update(ACPIREGS *ar, bool enable) } } +static inline int64_t acpi_pm_tmr_get_clock (void ) +{ +return muldiv64 (qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ),PM_TIMER_FREQUENCY , +get_ticks_per_sec ()); +} +void acpi_pm_tmr_calc_overflow_time (ACPIREGS *ar) {int64_t d =acpi_pm_tmr_get_clock ();
hw/bt/sdp.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/host-utils.h" #include "hw/bt.h" struct bt_l2cap_sdp_state_s {
hw/display/tc6393xb.c +1 -0
@@ -12,6 +12,7 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/host-utils.h" #include "hw/hw.h" #include "hw/devices.h" #include "hw/block/flash.h"
include/exec/cpu-defs.h +1 -0
@@ -23,6 +23,7 @@#error cpu.h included from common code#endif +#include "qemu/host-utils.h" #include "qemu/queue.h" #include "tcg-target.h" #ifndef CONFIG_USER_ONLY
include/hw/acpi/acpi.h +0 -7
@@ -150,13 +150,6 @@ void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci, MemoryRegion *parent);void acpi_pm_tmr_reset (ACPIREGS *ar); -#include "qemu/timer.h" -static inline int64_t acpi_pm_tmr_get_clock (void ) -{ -return muldiv64 (qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ),PM_TIMER_FREQUENCY , -get_ticks_per_sec ()); -} -/* PM1a_EVT: piix and ich9 don't implement PM1b. */ uint16_t acpi_pm1_evt_get_sts (ACPIREGS *ar);void acpi_pm1_evt_power_down (ACPIREGS *ar);
include/qemu-common.h +0 -1
@@ -21,7 +21,6 @@#define TFR (expr) do { if ((expr) != -1) break; } while (errno == EINTR)#include "qemu/option.h" -#include "qemu/host-utils.h" /* FIXME: Remove NEED_CPU_H. */ #ifdef NEED_CPU_H
include/qemu/timer.h +0 -1
@@ -3,7 +3,6 @@#include "qemu-common.h" #include "qemu/notify.h" -#include "qemu/host-utils.h" #include "sysemu/cpus.h" #define NANOSECONDS_PER_SECOND 1000000000LL
page_cache.c +1 -0
@@ -16,6 +16,7 @@#include <glib.h> #include "qemu-common.h" +#include "qemu/host-utils.h" #include "migration/page_cache.h" #ifdef DEBUG_CACHE
slirp/slirp.h +1 -0
@@ -1,6 +1,7 @@#ifndef __COMMON_H__#define __COMMON_H__ +#include "qemu/host-utils.h" #include "slirp_config.h" #ifdef _WIN32
stubs/slirp.c +1 -0
@@ -1,5 +1,6 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/host-utils.h" #include "slirp/slirp.h" void slirp_pollfds_fill (GArray *pollfds,uint32_t *timeout)
tests/libqos/malloc.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "libqos/malloc.h" #include "qemu-common.h" +#include "qemu/host-utils.h" #include <glib.h> typedef QTAILQ_HEAD(MemList, MemBlock) MemList;
util/buffer.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" +#include "qemu/host-utils.h" #include "qemu/buffer.h" #include "trace.h"
Signature · 1 line
1.8.3.1
PATCH 39/49 gdbstub: remove includes from gdbstub-xml.c
In reply to Paolo Bonzinigdbstub-xml.c defines a bunch of arrays of strings; there is no need to include anything.
--- scripts/feature_to_c.sh | 3 --- 1 file changed, 3 deletions(-)
scripts/feature_to_c.sh +0 -3
@@ -36,9 +36,6 @@ for input; do arrayname=xml_feature_`echo $input | sed 's,.*/,,; s/[-.]/_/g'` ${AWK:-awk} 'BEGIN { n = 0 - printf "#include \"qemu/osdep.h\"\n" - printf "#include \"qemu-common.h\"\n" - printf "#include \"exec/gdbstub.h\"\n" print "static const char '$arrayname'[] = {" for (i = 0; i < 255; i++) _ord_[sprintf("%c", i)] = i
Signature · 1 line
1.8.3.1
PATCH 40/49 dma: do not depend on kvm_enabled()
In reply to Paolo BonziniMemory barriers are needed also by Xen and, when the ioeventfd bugs are fixed, by TCG as well.
sysemu/kvm.h is not anymore needed in sysemu/dma.h, move it to the actual users.
--- hw/intc/arm_gicv2m.c | 1 + hw/ppc/e500plat.c | 1 + hw/ppc/spapr_hcall.c | 1 + hw/ppc/spapr_rtas.c | 1 + include/sysemu/dma.h | 5 +---- 5 files changed, 5 insertions(+), 4 deletions(-)
hw/intc/arm_gicv2m.c +1 -0
@@ -29,6 +29,7 @@#include "qapi/error.h" #include "hw/sysbus.h" #include "hw/pci/msi.h" +#include "sysemu/kvm.h" #define TYPE_ARM_GICV2M "arm-gicv2m"#define ARM_GICV2M (obj) OBJECT_CHECK(ARMGICv2mState, (obj), TYPE_ARM_GICV2M)
hw/ppc/e500plat.c +1 -0
@@ -14,6 +14,7 @@#include "e500.h" #include "hw/boards.h" #include "sysemu/device_tree.h" +#include "sysemu/kvm.h" #include "hw/pci/pci.h" #include "hw/ppc/openpic.h" #include "kvm_ppc.h"
hw/ppc/spapr_hcall.c +1 -0
@@ -7,6 +7,7 @@#include "mmu-hash64.h" #include "cpu-models.h" #include "trace.h" +#include "sysemu/kvm.h" #include "kvm_ppc.h" struct SPRSyncState {
hw/ppc/spapr_rtas.c +1 -0
@@ -31,6 +31,7 @@#include "hw/qdev.h" #include "sysemu/device_tree.h" #include "sysemu/cpus.h" +#include "sysemu/kvm.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_vio.h"
include/sysemu/dma.h +1 -4
@@ -15,7 +15,6 @@#include "hw/hw.h" #include "block/block.h" #include "block/accounting.h" -#include "sysemu/kvm.h" typedef struct ScatterGatherEntry ScatterGatherEntry ;
@@ -67,9 +66,7 @@ static inline void dma_barrier(AddressSpace *as, DMADirection dir)* use lighter barriers based on the direction of the * transfer, the DMA context, etc... */ -if (kvm_enabled ()) { -smp_mb (); - } +smp_mb (); }/* Checks that the given range of addresses is valid for DMA. This is
Signature · 1 line
1.8.3.1
PATCH 41/49 s390x: move stuff out of cpu.h
In reply to Paolo Bonzini---
hw/s390x/css.c | 4 +-
hw/s390x/s390-skeys.c | 1 +
hw/s390x/s390-virtio-ccw.c | 4 +-
hw/s390x/virtio-ccw.c | 5 +-
hw/s390x/virtio-ccw.h | 3 +-
{hw => include/hw}/s390x/css.h | 31 +++++++-
{target-s390x => include/hw/s390x}/ioinst.h | 16 +---
target-s390x/cpu.h | 117 ++++++----------------------
target-s390x/helper.c | 1 +
target-s390x/interrupt.c | 64 +++++++++++++++
target-s390x/ioinst.c | 2 +-
11 files changed, 131 insertions(+), 117 deletions(-)
rename {hw => include/hw}/s390x/css.h (76%)
rename {target-s390x => include/hw/s390x}/ioinst.h (87%)hw/s390x/css.c +2 -2
@@ -14,8 +14,8 @@#include "qemu/bitops.h" #include "exec/address-spaces.h" #include "cpu.h" -#include "ioinst.h" -#include "css.h" +#include "hw/s390x/ioinst.h" +#include "hw/s390x/css.h" #include "trace.h" #include "hw/s390x/s390_flic.h"
hw/s390x/s390-skeys.c +1 -0
@@ -15,6 +15,7 @@#include "migration/qemu-file.h" #include "hw/s390x/storage-keys.h" #include "qemu/error-report.h" +#include "sysemu/kvm.h" #define S390_SKEYS_BUFFER_SIZE 131072/* Room for 128k storage keys */ #define S390_SKEYS_SAVE_FLAG_EOS 0x01
hw/s390x/s390-virtio-ccw.c +2 -2
@@ -18,8 +18,8 @@#include "s390-virtio.h" #include "hw/s390x/sclp.h" #include "hw/s390x/s390_flic.h" -#include "ioinst.h" -#include "css.h" +#include "hw/s390x/ioinst.h" +#include "hw/s390x/css.h" #include "virtio-ccw.h" #include "qemu/config-file.h" #include "s390-pci-bus.h"
hw/s390x/virtio-ccw.c +3 -2
@@ -16,6 +16,7 @@#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "sysemu/sysemu.h" +#include "sysemu/kvm.h" #include "net/net.h" #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-serial.h"
@@ -28,8 +29,8 @@#include "hw/s390x/adapter.h" #include "hw/s390x/s390_flic.h" -#include "ioinst.h" -#include "css.h" +#include "hw/s390x/ioinst.h" +#include "hw/s390x/css.h" #include "virtio-ccw.h" #include "trace.h"
hw/s390x/virtio-ccw.h +2 -1
@@ -24,7 +24,8 @@#include <hw/virtio/virtio-rng.h> #include <hw/virtio/virtio-bus.h> -#include "css.h" +#include <hw/s390x/s390_flic.h> +#include <hw/s390x/css.h> #define VIRTUAL_CSSID 0xfe
include/hw/s390x/css.h renamed from hw/s390x/css.h +30 -1
@@ -14,7 +14,7 @@#include "hw/s390x/adapter.h" #include "hw/s390x/s390_flic.h" -#include "ioinst.h" +#include "hw/s390x/ioinst.h" /* Channel subsystem constants. */ #define MAX_SCHID 65535
@@ -67,6 +67,7 @@ typedef struct CMBE {uint32_t reserved[7 ]; }QEMU_PACKED CMBE ; +typedef struct SubchDev SubchDev ;struct SubchDev {/* channel-subsystem related things: */ uint8_t cssid;
@@ -123,4 +124,32 @@ void css_adapter_interrupt(uint8_t isc);#define CSS_IO_ADAPTER_VIRTIO 1int css_register_io_adapter (uint8_t type,uint8_t isc,bool swap,bool maskable,uint32_t *id); + +#ifndef CONFIG_USER_ONLY +SubchDev *css_find_subch (uint8_t m,uint8_t cssid,uint8_t ssid, +uint16_t schid); +bool css_subch_visible (SubchDev *sch); +void css_conditional_io_interrupt (SubchDev *sch); +int css_do_stsch (SubchDev *sch,SCHIB *schib); +bool css_schid_final (int m,uint8_t cssid,uint8_t ssid,uint16_t schid); +int css_do_msch (SubchDev *sch,const SCHIB *schib); +int css_do_xsch (SubchDev *sch); +int css_do_csch (SubchDev *sch); +int css_do_hsch (SubchDev *sch); +int css_do_ssch (SubchDev *sch,ORB *orb); +int css_do_tsch_get_irb (SubchDev *sch,IRB *irb,int *irb_len); +void css_do_tsch_update_subch (SubchDev *sch); +int css_do_stcrw (CRW *crw); +void css_undo_stcrw (CRW *crw); +int css_do_tpi (IOIntCode *int_code,int lowcore); +int css_collect_chp_desc (int m,uint8_t cssid,uint8_t f_chpid,uint8_t l_chpid, +int rfmt,void *buf); +void css_do_schm (uint8_t mbk,int update,int dct,uint64_t mbo); +int css_enable_mcsse (void ); +int css_enable_mss (void ); +int css_do_rsch (SubchDev *sch); +int css_do_rchp (uint8_t cssid,uint8_t chpid); +bool css_present (uint8_t cssid); +#endif +#endif
include/hw/s390x/ioinst.h renamed from target-s390x/ioinst.h +1 -15
@@ -11,6 +11,7 @@#ifndef IOINST_S390X_H #define IOINST_S390X_H +/* * Channel I/O related definitions, as defined in the Principles * Of Operation (and taken from the Linux implementation).
@@ -227,20 +228,5 @@ typedef struct IOIntCode {int ioinst_disassemble_sch_ident (uint32_t value,int *m,int *cssid,int *ssid,int *schid); -void ioinst_handle_xsch (S390CPU *cpu,uint64_t reg1); -void ioinst_handle_csch (S390CPU *cpu,uint64_t reg1); -void ioinst_handle_hsch (S390CPU *cpu,uint64_t reg1); -void ioinst_handle_msch (S390CPU *cpu,uint64_t reg1,uint32_t ipb); -void ioinst_handle_ssch (S390CPU *cpu,uint64_t reg1,uint32_t ipb); -void ioinst_handle_stcrw (S390CPU *cpu,uint32_t ipb); -void ioinst_handle_stsch (S390CPU *cpu,uint64_t reg1,uint32_t ipb); -int ioinst_handle_tsch (S390CPU *cpu,uint64_t reg1,uint32_t ipb); -void ioinst_handle_chsc (S390CPU *cpu,uint32_t ipb); -int ioinst_handle_tpi (S390CPU *cpu,uint32_t ipb); -void ioinst_handle_schm (S390CPU *cpu,uint64_t reg1,uint64_t reg2, -uint32_t ipb); -void ioinst_handle_rsch (S390CPU *cpu,uint64_t reg1); -void ioinst_handle_rchp (S390CPU *cpu,uint64_t reg1); -void ioinst_handle_sal (S390CPU *cpu,uint64_t reg1);#endif
target-s390x/cpu.h +24 -93
142 lines not on this page · raw message
target-s390x/helper.c +1 -0
@@ -24,6 +24,7 @@#include "exec/gdbstub.h" #include "qemu/timer.h" #include "exec/cpu_ldst.h" +#include "hw/s390x/ioinst.h" #ifndef CONFIG_USER_ONLY #include "sysemu/sysemu.h" #endif
target-s390x/interrupt.c +64 -0
76 lines not on this page · raw message
target-s390x/ioinst.c +1 -1
@@ -12,7 +12,7 @@#include "qemu/osdep.h" #include "cpu.h" -#include "ioinst.h" +#include "hw/s390x/ioinst.h" #include "trace.h" #include "hw/s390x/s390-pci-bus.h"
Signature · 1 line
1.8.3.1
PATCH 42/49 qemu-common: push cpu.h inclusion out of qemu-common.h
In reply to Paolo Bonzini--- arch_init.c | 2 ++ cpus.c | 3 ++- exec.c | 2 +- gdbstub.c | 1 + hw/arm/nseries.c | 1 + hw/arm/pxa2xx_gpio.c | 1 + hw/core/nmi.c | 5 +++++ hw/display/cg3.c | 1 + hw/i386/kvm/apic.c | 2 ++ hw/i386/kvm/clock.c | 1 + hw/i386/kvmvapic.c | 2 ++ hw/intc/apic.c | 2 ++ hw/intc/apic_common.c | 2 ++ hw/intc/arm_gic_kvm.c | 2 ++ hw/intc/armv7m_nvic.c | 1 + hw/intc/openpic_kvm.c | 2 ++ hw/intc/s390_flic_kvm.c | 2 ++ hw/ppc/ppc4xx_devs.c | 1 + hw/ppc/prep.c | 1 + hw/ppc/virtex_ml507.c | 1 + hw/xtensa/pic_cpu.c | 1 + include/disas/disas.h | 2 ++ include/exec/gdbstub.h | 2 ++ include/exec/hwaddr.h | 2 ++ include/hw/arm/digic.h | 1 + include/hw/arm/virt-acpi-build.h | 1 + include/hw/arm/virt.h | 1 + include/hw/hw.h | 1 - include/hw/sd/sd.h | 2 ++ include/hw/xen/xen.h | 7 ++++--- include/qemu-common.h | 5 ----- include/sysemu/kvm.h | 1 + ioport.c | 2 ++ memory.c | 2 ++ migration/ram.c | 2 ++ migration/savevm.c | 1 + monitor.c | 2 ++ qtest.c | 2 ++ scripts/tracetool/format/tcg_helper_c.py | 1 + target-alpha/gdbstub.c | 1 + target-alpha/machine.c | 2 ++ target-arm/gdbstub.c | 1 + target-arm/gdbstub64.c | 1 + target-arm/kvm-stub.c | 1 + target-arm/kvm32.c | 2 +- target-arm/kvm64.c | 2 +- target-arm/machine.c | 2 ++ target-cris/gdbstub.c | 1 + target-cris/machine.c | 2 ++ target-i386/gdbstub.c | 1 + target-i386/kvm-stub.c | 1 + target-i386/kvm.c | 2 +- target-i386/machine.c | 2 ++ target-lm32/gdbstub.c | 1 + target-lm32/machine.c | 2 ++ target-m68k/gdbstub.c | 1 + target-microblaze/gdbstub.c | 1 + target-mips/cpu.h | 18 ++---------------- target-mips/gdbstub.c | 1 + target-mips/helper.c | 17 +++++++++++++++++ target-mips/kvm.c | 2 +- target-mips/machine.c | 2 ++ target-moxie/machine.c | 2 ++ target-openrisc/gdbstub.c | 1 + target-openrisc/machine.c | 2 ++ target-ppc/gdbstub.c | 1 + target-ppc/kvm-stub.c | 1 + target-ppc/kvm.c | 2 +- target-ppc/machine.c | 2 ++ target-s390x/gdbstub.c | 1 + target-s390x/kvm.c | 2 +- target-sh4/gdbstub.c | 1 + target-sparc/gdbstub.c | 1 + target-sparc/machine.c | 2 ++ target-xtensa/gdbstub.c | 1 + tcg/optimize.c | 3 +-- tcg/tcg-op.c | 2 ++ tcg/tcg.h | 1 + 78 files changed, 129 insertions(+), 35 deletions(-)
arch_init.c +2 -0
@@ -22,6 +22,8 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "sysemu/sysemu.h" #include "sysemu/arch_init.h" #include "hw/pci/pci.h"
cpus.c +2 -1
@@ -24,7 +24,8 @@/* Needed early for CONFIG_BSD etc. */ #include "qemu/osdep.h" - +#include "qemu-common.h" +#include "cpu.h" #include "monitor/monitor.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h"
exec.c +1 -1
@@ -28,10 +28,10 @@#include "hw/qdev-core.h" #if !defined(CONFIG_USER_ONLY )#include "hw/boards.h" +#include "hw/xen/xen.h" #endif #include "sysemu/kvm.h" #include "sysemu/sysemu.h" -#include "hw/xen/xen.h" #include "qemu/timer.h" #include "qemu/config-file.h" #include "qemu/error-report.h"
gdbstub.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "cpu.h" #ifdef CONFIG_USER_ONLY #include "qemu.h"
hw/arm/nseries.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "cpu.h" #include "qemu/bswap.h" #include "sysemu/sysemu.h" #include "hw/arm/omap.h"
hw/arm/pxa2xx_gpio.c +1 -0
@@ -8,6 +8,7 @@*/ #include "qemu/osdep.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/sysbus.h" #include "hw/arm/pxa.h"
hw/core/nmi.c +5 -0
@@ -20,11 +20,16 @@*/ #include "qemu/osdep.h" +#include "qom/cpu.h" #include "hw/nmi.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" #include "monitor/monitor.h" +#if defined(TARGET_I386 ) +#include "cpu.h" +#endif +struct do_nmi_s {int cpu_index;Error *err;
hw/display/cg3.c +1 -0
@@ -26,6 +26,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "cpu.h" #include "qemu/error-report.h" #include "ui/console.h" #include "hw/sysbus.h"
hw/i386/kvm/apic.c +2 -0
@@ -10,6 +10,8 @@* See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/i386/apic_internal.h" #include "hw/pci/msi.h" #include "sysemu/kvm.h"
hw/i386/kvm/clock.c +1 -0
@@ -15,6 +15,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "qemu/host-utils.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h"
hw/i386/kvmvapic.c +2 -0
@@ -9,6 +9,8 @@* top-level directory. */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "sysemu/sysemu.h" #include "sysemu/cpus.h" #include "sysemu/kvm.h"
hw/intc/apic.c +2 -0
@@ -17,6 +17,8 @@* License along with this library; if not, see <http://www.gnu.org/licenses/> */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "qemu/thread.h" #include "hw/i386/apic_internal.h" #include "hw/i386/apic.h"
hw/intc/apic_common.c +2 -0
@@ -19,6 +19,8 @@*/ #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/i386/apic.h" #include "hw/i386/apic_internal.h" #include "trace.h"
hw/intc/arm_gic_kvm.c +2 -0
@@ -20,6 +20,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "migration/migration.h" #include "sysemu/kvm.h"
hw/intc/armv7m_nvic.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "qemu-common.h" +#include "cpu.h" #include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/arm/arm.h"
hw/intc/openpic_kvm.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include <sys/ioctl.h> #include "exec/address-spaces.h" #include "hw/hw.h"
hw/intc/s390_flic_kvm.c +2 -0
@@ -11,6 +11,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include <sys/ioctl.h> #include "qemu/error-report.h" #include "hw/sysbus.h"
hw/ppc/ppc4xx_devs.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" #include "hw/ppc/ppc4xx.h"
hw/ppc/prep.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/timer/m48t59.h" #include "hw/i386/pc.h"
hw/ppc/virtex_ml507.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" +#include "cpu.h" #include "hw/sysbus.h" #include "hw/hw.h" #include "hw/char/serial.h"
hw/xtensa/pic_cpu.c +1 -0
@@ -26,6 +26,7 @@*/ #include "qemu/osdep.h" +#include "cpu.h" #include "hw/hw.h" #include "qemu/log.h" #include "qemu/timer.h"
include/disas/disas.h +2 -0
@@ -4,6 +4,8 @@#include "qemu-common.h" #ifdef NEED_CPU_H +#include "cpu.h" +/* Disassemble this for me please... (debugging). */ void disas (FILE *out,void *code,unsigned long size); void target_disas(FILE *out, CPUState *cpu, target_ulong code,
include/exec/gdbstub.h +2 -0
@@ -11,6 +11,8 @@#define GDB_WATCHPOINT_ACCESS 4#ifdef NEED_CPU_H +#include "cpu.h" +typedef void (*gdb_syscall_complete_cb )(CPUState *cpu,target_ulong ret,target_ulong err);
include/exec/hwaddr.h +2 -0
@@ -3,6 +3,8 @@#ifndef HWADDR_H #define HWADDR_H +#include <inttypes.h> +#define HWADDR_BITS 64/* hwaddr is the type of a physical address (its size can be different from 'target_ulong'). */
include/hw/arm/digic.h +1 -0
@@ -18,6 +18,7 @@#ifndef HW_ARM_DIGIC_H #define HW_ARM_DIGIC_H +#include "cpu.h" #include "hw/timer/digic-timer.h" #include "hw/char/digic-uart.h"
include/hw/arm/virt-acpi-build.h +1 -0
@@ -22,6 +22,7 @@#include "qemu-common.h" #include "hw/arm/virt.h" +#include "qemu/notify.h" #define ACPI_GICC_ENABLED 1
include/hw/arm/virt.h +1 -0
@@ -31,6 +31,7 @@#define QEMU_ARM_VIRT_H #include "qemu-common.h" +#include "exec/hwaddr.h" #define NUM_GICV2M_SPIS 64#define NUM_VIRTIO_TRANSPORTS 32
include/hw/hw.h +0 -1
@@ -2,7 +2,6 @@#ifndef QEMU_HW_H #define QEMU_HW_H -#ifdef CONFIG_USER_ONLY #error Cannot include hw/hw.h from user emulation#endif
include/hw/sd/sd.h +2 -0
@@ -29,6 +29,8 @@#ifndef __hw_sd_h#define __hw_sd_h 1 +#include "hw/qdev.h" +#define OUT_OF_RANGE (1 << 31)#define ADDRESS_ERROR (1 << 30)#define BLOCK_LEN_ERROR (1 << 29)
include/hw/xen/xen.h +4 -3
@@ -7,8 +7,10 @@* /usr/include/xen, so it can be included unconditionally. */ -#include "hw/irq.h" #include "qemu-common.h" +#include "qemu/typedefs.h" +#include "exec/cpu-common.h" +#include "hw/irq.h" /* xen-machine.c */ enum xen_mode {
@@ -37,12 +39,11 @@ qemu_irq *xen_interrupt_controller_init(void);void xenstore_store_pv_console_info (int i,struct CharDriverState *chr); -#if defined(NEED_CPU_H ) && !defined(CONFIG_USER_ONLY )void xen_hvm_init (PCMachineState *pcms,MemoryRegion **ram_memory); +void xen_ram_alloc (ram_addr_t ram_addr,ram_addr_t size,struct MemoryRegion *mr,Error **errp);void xen_modified_memory (ram_addr_t start,ram_addr_t length); -#endif void xen_register_framebuffer (struct MemoryRegion *mr);
include/qemu-common.h +0 -5
@@ -22,11 +22,6 @@#include "qemu/option.h" -/* FIXME: Remove NEED_CPU_H. */ -#ifdef NEED_CPU_H -#include "cpu.h" -#endif /* !defined(NEED_CPU_H) */ -/* main function, renamed */ #if defined(CONFIG_COCOA )int qemu_main (int argc,char **argv,char **envp);
include/sysemu/kvm.h +1 -0
@@ -218,6 +218,7 @@ int kvm_init_vcpu(CPUState *cpu);int kvm_cpu_exec (CPUState *cpu);#ifdef NEED_CPU_H +#include "cpu.h" void kvm_setup_guest_memory (void *start,size_t size);void kvm_flush_coalesced_mmio_buffer (void );
ioport.c +2 -0
@@ -26,6 +26,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "exec/ioport.h" #include "trace.h" #include "exec/memory.h"
memory.c +2 -0
@@ -15,6 +15,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "exec/memory.h" #include "exec/address-spaces.h" #include "exec/ioport.h"
migration/ram.c +2 -0
@@ -26,6 +26,8 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include <zlib.h> #include "qapi-event.h" #include "qemu/bitops.h"
migration/savevm.c +1 -0
@@ -28,6 +28,7 @@#include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "hw/boards.h" #include "hw/hw.h" #include "hw/qdev.h"
monitor.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" #include <dirent.h> +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "monitor/qdev.h" #include "hw/usb.h"
qtest.c +2 -0
@@ -13,6 +13,8 @@#include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu-common.h" +#include "cpu.h" #include "sysemu/qtest.h" #include "hw/qdev.h" #include "sysemu/char.h"
scripts/tracetool/format/tcg_helper_c.py +1 -0
@@ -48,6 +48,7 @@ def generate(events, backend): '', '#include "qemu/osdep.h"', '#include "qemu-common.h"', + '#include "cpu.h"', '#include "trace.h"', '#include "exec/helper-proto.h"', '',
target-alpha/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int alpha_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
target-alpha/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "migration/cpu.h"
target-arm/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" /* Old gdb always expect FPA registers. Newer (xml-aware) gdb only expect
target-arm/gdbstub64.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int aarch64_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
target-arm/kvm-stub.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "kvm_arm.h" bool write_kvmstate_to_list (ARMCPU *cpu)
target-arm/kvm32.c +1 -1
@@ -15,11 +15,11 @@#include <linux/kvm.h> #include "qemu-common.h" +#include "cpu.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "kvm_arm.h" -#include "cpu.h" #include "internals.h" #include "hw/arm/arm.h"
target-arm/kvm64.c +1 -1
@@ -18,6 +18,7 @@#include <linux/kvm.h> #include "qemu-common.h" +#include "cpu.h" #include "qemu/timer.h" #include "qemu/error-report.h" #include "qemu/host-utils.h"
@@ -25,7 +26,6 @@#include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "kvm_arm.h" -#include "cpu.h" #include "internals.h" #include "hw/arm/arm.h"
target-arm/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "qemu/error-report.h"
target-cris/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int crisv10_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
target-cris/machine.c +2 -0
@@ -19,6 +19,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "migration/cpu.h"
target-i386/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" #ifdef TARGET_X86_64
target-i386/kvm-stub.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "kvm_i386.h" bool kvm_allows_irq0_override (void )
target-i386/kvm.c +1 -1
@@ -22,10 +22,10 @@#include <linux/kvm_para.h> #include "qemu-common.h" +#include "cpu.h" #include "sysemu/sysemu.h" #include "sysemu/kvm_int.h" #include "kvm_i386.h" -#include "cpu.h" #include "hyperv.h" #include "exec/gdbstub.h"
target-i386/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/i386/pc.h"
target-lm32/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" #include "hw/lm32/lm32_pic.h"
target-lm32/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "migration/cpu.h"
target-m68k/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int m68k_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
target-microblaze/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int mb_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
target-mips/cpu.h +2 -16
@@ -1130,22 +1130,8 @@ static inline void cpu_mips_store_cause(CPUMIPSState *env, target_ulong val) }#endif -static inline void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, -uint32_t exception, -int error_code, -uintptr_t pc) -{ -CPUState *cs =CPU (mips_env_get_cpu (env)); - -if (exception <EXCP_SC ) { -qemu_log_mask (CPU_LOG_INT ,"%s: %d %d\n" , - __func__, exception, error_code); - } - cs->exception_index = exception; - env->error_code = error_code; - -cpu_loop_exit_restore (cs, pc); -} +void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exception, +int error_code,uintptr_t pc); static inline void QEMU_NORETURN do_raise_exception(CPUMIPSState *env, uint32_t exception,
target-mips/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int mips_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
target-mips/helper.c +17 -0
@@ -840,3 +840,20 @@ void r4k_invalidate_tlb (CPUMIPSState *env, int idx, int use_extra) } }#endif + +void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, +uint32_t exception, +int error_code, +uintptr_t pc) +{ +CPUState *cs =CPU (mips_env_get_cpu (env)); + +if (exception <EXCP_SC ) { +qemu_log_mask (CPU_LOG_INT ,"%s: %d %d\n" , + __func__, exception, error_code); + } + cs->exception_index = exception; + env->error_code = error_code; + +cpu_loop_exit_restore (cs, pc); +}
target-mips/kvm.c +1 -1
@@ -16,11 +16,11 @@#include <linux/kvm.h> #include "qemu-common.h" +#include "cpu.h" #include "qemu/error-report.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" -#include "cpu.h" #include "sysemu/cpus.h" #include "kvm_mips.h" #include "exec/memattrs.h"
target-mips/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "cpu.h" #include "migration/cpu.h"
target-moxie/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "machine.h"
target-openrisc/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int openrisc_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
target-openrisc/machine.c +2 -0
@@ -18,6 +18,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "migration/cpu.h"
target-ppc/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" static int ppc_gdb_register_len_apple (int n)
target-ppc/kvm-stub.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "hw/ppc/openpic.h" int kvm_openpic_connect_vcpu (DeviceState *d,CPUState *cs)
target-ppc/kvm.c +1 -1
@@ -24,11 +24,11 @@#include "qemu-common.h" #include "qemu/error-report.h" +#include "cpu.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "kvm_ppc.h" -#include "cpu.h" #include "sysemu/cpus.h" #include "sysemu/device_tree.h" #include "mmu-hash64.h"
target-ppc/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "sysemu/kvm.h"
target-s390x/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" #include "qemu/bitops.h"
target-s390x/kvm.c +1 -1
@@ -29,12 +29,12 @@#include <asm/ptrace.h> #include "qemu-common.h" +#include "cpu.h" #include "qemu/error-report.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "hw/hw.h" -#include "cpu.h" #include "sysemu/device_tree.h" #include "qapi/qmp/qjson.h" #include "exec/gdbstub.h"
target-sh4/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" /* Hint: Use "set architecture sh4" in GDB to see fpu registers */
target-sparc/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" #ifdef TARGET_ABI32
target-sparc/machine.c +2 -0
@@ -1,4 +1,6 @@#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "hw/hw.h" #include "hw/boards.h" #include "qemu/timer.h"
target-xtensa/gdbstub.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "qemu-common.h" +#include "cpu.h" #include "exec/gdbstub.h" int xtensa_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n)
tcg/optimize.c +1 -2
@@ -24,9 +24,8 @@*/ #include "qemu/osdep.h" - -#include "qemu-common.h" +#include "cpu.h" #include "tcg-op.h" #define CASE_OP_32_64 (x) \
tcg/tcg-op.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" #include "tcg.h" #include "tcg-op.h"
tcg/tcg.h +1 -0
@@ -26,6 +26,7 @@#define TCG_H #include "qemu-common.h" +#include "cpu.h" #include "qemu/bitops.h" #include "tcg-target.h"
Signature · 1 line
1.8.3.1
PATCH 43/49 arm: move arm_log_exception into .c file
In reply to Paolo BonziniAvoid need for qemu/log.h inclusion.
--- target-arm/helper.c | 14 ++++++++++++++ target-arm/internals.h | 15 +-------------- 2 files changed, 15 insertions(+), 14 deletions(-)
target-arm/helper.c +14 -0
@@ -5810,6 +5810,20 @@ static void do_v7m_exception_exit(CPUARMState *env)pointer. */ } +void arm_log_exception (int idx) +{ +if (qemu_loglevel_mask (CPU_LOG_INT )) { +const char *exc =NULL ; + +if (idx >=0 && idx <ARRAY_SIZE (excnames)) { + exc = excnames[idx]; + } +if (!exc) { + exc ="unknown" ; + } +qemu_log_mask (CPU_LOG_INT ,"Taking exception %d [%s]\n" , idx, exc); + } +}void arm_v7m_cpu_do_interrupt (CPUState *cs) {ARMCPU *cpu =ARM_CPU (cs);
target-arm/internals.h +1 -14
@@ -72,20 +72,7 @@ static const char * const excnames[] = { [EXCP_SEMIHOST] = "Semihosting call", }; -static inline void arm_log_exception (int idx) -{ -if (qemu_loglevel_mask (CPU_LOG_INT )) { -const char *exc =NULL ; - -if (idx >=0 && idx <ARRAY_SIZE (excnames)) { - exc = excnames[idx]; - } -if (!exc) { - exc ="unknown" ; - } -qemu_log_mask (CPU_LOG_INT ,"Taking exception %d [%s]\n" , idx, exc); - } -} +void arm_log_exception (int idx);/* Scale factor for generic timers, ie number of ns per tick. * This gives a 62.5MHz timer.
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH 43/49] arm: move arm_log_exception into .c file
Quoted 22 lines · Paolo Bonzini
Avoid need for
qemu/log.hinclusion.Signed-off-by Paolo Bonzini <[email protected]>--- target-arm/helper.c | 14 ++++++++++++++ target-arm/internals.h | 15 +-------------- 2 files changed, 15 insertions(+), 14 deletions(-)target-arm/helper.c +6
-0@@ -5810,6 +5810,20 @@ static void do_v7m_exception_exit(CPUARMState *env)pointer. */ } +void arm_log_exception (int idx) +{ +if (qemu_loglevel_mask (CPU_LOG_INT )) { +const char *exc =NULL ; + +if (idx >=0 && idx <ARRAY_SIZE (excnames)) {
target-arm/helper.c static void do_v7m_exception_exit(CPUARMState *env) · line 5828
Quoted 10 lines
target-arm/helper.c +8
-0+ exc = excnames[idx]; + } +if (!exc) { + exc ="unknown" ; + } +qemu_log_mask (CPU_LOG_INT ,"Taking exception %d [%s]\n" , idx, exc); + } +}void arm_v7m_cpu_do_interrupt (CPUState *cs) {
Missing blank line after '}'.
Also, arm_log_exception() is now only used in helper.c so you could just make it static in this file.
thanks
-- PMM
PATCH 44/49 mips: move CP0 functions out of cpu.h
In reply to Paolo BonziniThese are here for historical reasons: they are needed from both gdbstub.c and op_helper.c, and the latter was compiled with fixed AREG0. It is not needed anymore, so uninline them.
--- target-mips/cpu.h | 113 ++------------------------------------------------- target-mips/helper.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 109 deletions(-)
target-mips/cpu.h +4 -109
@@ -1020,115 +1020,10 @@ static inline void compute_hflags(CPUMIPSState *env) } } -#ifndef CONFIG_USER_ONLY -static inline void cpu_mips_tlb_flush (CPUMIPSState *env,int flush_global) -{ -MIPSCPU *cpu =mips_env_get_cpu (env); - -/* Flush qemu's TLB and discard all shadowed entries. */ -tlb_flush (CPU (cpu), flush_global); - env->tlb->tlb_in_use = env->tlb->nb_tlb; -} - -/* Called for updates to CP0_Status. */ -static inline void sync_c0_status (CPUMIPSState *env,CPUMIPSState *cpu,int tc) -{ -int32_t tcstatus, *tcst; -uint32_t v = cpu->CP0_Status; -uint32_t cu, mx, asid, ksu; -uint32_t mask = ((1 << CP0TCSt_TCU3) - | (1 << CP0TCSt_TCU2) - | (1 << CP0TCSt_TCU1) - | (1 << CP0TCSt_TCU0) - | (1 << CP0TCSt_TMX) - | (3 << CP0TCSt_TKSU) - | (0xff << CP0TCSt_TASID)); - - cu = (v >> CP0St_CU0) &0xf ; - mx = (v >> CP0St_MX) &0x1 ; - ksu = (v >> CP0St_KSU) &0x3 ; - asid = env->CP0_EntryHi &0xff ; - - tcstatus = cu << CP0TCSt_TCU0; - tcstatus |= mx << CP0TCSt_TMX; - tcstatus |= ksu << CP0TCSt_TKSU; - tcstatus |= asid; - -if (tc == cpu->current_tc) { - tcst = &cpu->active_tc.CP0_TCStatus; - }else { - tcst = &cpu->tcs[tc].CP0_TCStatus; - } - - *tcst &= ~mask; - *tcst |= tcstatus; -compute_hflags (cpu); -} - -static inline void cpu_mips_store_status (CPUMIPSState *env,target_ulong val) -{ -uint32_t mask = env->CP0_Status_rw_bitmask; -target_ulong old = env->CP0_Status; - -if (env->insn_flags &ISA_MIPS32R6 ) { -bool has_supervisor =extract32 (mask, CP0St_KSU,2 ) ==0x3 ; -#if defined(TARGET_MIPS64 ) -uint32_t ksux = (1 << CP0St_KX) & val; - ksux |= (ksux >>1 ) & val;/* KX = 0 forces SX to be 0 */ - ksux |= (ksux >>1 ) & val;/* SX = 0 forces UX to be 0 */ - val = (val & ~(7 << CP0St_UX)) | ksux; -#endif -if (has_supervisor &&extract32 (val, CP0St_KSU,2 ) ==0x3 ) { - mask &= ~(3 << CP0St_KSU); - } - mask &= ~(((1 << CP0St_SR) | (1 << CP0St_NMI)) & val); - } - - env->CP0_Status = (old & ~mask) | (val & mask); -#if defined(TARGET_MIPS64 ) -if ((env->CP0_Status ^ old) & (old & (7 << CP0St_UX))) { -/* Access to at least one of the 64-bit segments has been disabled */ -cpu_mips_tlb_flush (env,1 ); - } -#endif -if (env->CP0_Config3 & (1 <<CP0C3_MT )) { -sync_c0_status (env, env, env->current_tc); - }else { -compute_hflags (env); - } -} - -static inline void cpu_mips_store_cause (CPUMIPSState *env,target_ulong val) -{ -uint32_t mask =0x00C00300 ; -uint32_t old = env->CP0_Cause; -int i; - -if (env->insn_flags &ISA_MIPS32R2 ) { - mask |=1 << CP0Ca_DC; - } -if (env->insn_flags &ISA_MIPS32R6 ) { - mask &= ~((1 << CP0Ca_WP) & val); - } - - env->CP0_Cause = (env->CP0_Cause & ~mask) | (val & mask); - -if ((old ^ env->CP0_Cause) & (1 << CP0Ca_DC)) { -if (env->CP0_Cause & (1 << CP0Ca_DC)) { -cpu_mips_stop_count (env); - }else { -cpu_mips_start_count (env); - } - } - -/* Set/reset software interrupts */ -for (i =0 ; i <2 ; i++) { -if ((old ^ env->CP0_Cause) & (1 << (CP0Ca_IP + i))) { -cpu_mips_soft_irq (env, i, env->CP0_Cause & (1 << (CP0Ca_IP + i))); - } - } -} -#endif +void cpu_mips_tlb_flush (CPUMIPSState *env,int flush_global); +void sync_c0_status (CPUMIPSState *env,CPUMIPSState *cpu,int tc); +void cpu_mips_store_status (CPUMIPSState *env,target_ulong val); +void cpu_mips_store_cause (CPUMIPSState *env,target_ulong val); void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env, uint32_t exception,int error_code,uintptr_t pc);
target-mips/helper.c +108 -0
114 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 45/49 hw: explicitly include qemu/log.h
In reply to Paolo BonziniMove the inclusion out of hw/hw.h, most files do not need it.
--- hw/arm/nseries.c | 1 + hw/arm/pxa2xx_gpio.c | 1 + hw/arm/stellaris.c | 1 + hw/arm/strongarm.c | 1 + hw/arm/xlnx-ep108.c | 1 + hw/audio/pl041.c | 1 + hw/block/m25p80.c | 1 + hw/block/pflash_cfi01.c | 1 + hw/char/cadence_uart.c | 4 ++++ hw/char/digic-uart.c | 1 + hw/char/imx_serial.c | 1 + hw/char/pl011.c | 1 + hw/char/stm32f2xx_usart.c | 1 + hw/display/cg3.c | 1 + hw/display/pl110.c | 1 + hw/display/virtio-gpu.c | 1 + hw/dma/pl080.c | 1 + hw/dma/pl330.c | 1 + hw/dma/rc4030.c | 1 + hw/gpio/imx_gpio.c | 1 + hw/gpio/pl061.c | 1 + hw/i2c/imx_i2c.c | 1 + hw/i2c/versatile_i2c.c | 1 + hw/input/pl050.c | 1 + hw/intc/allwinner-a10-pic.c | 1 + hw/intc/arm_gic.c | 1 + hw/intc/arm_gicv2m.c | 1 + hw/intc/armv7m_nvic.c | 1 + hw/intc/bcm2835_ic.c | 1 + hw/intc/bcm2836_control.c | 1 + hw/intc/i8259.c | 1 + hw/intc/imx_avic.c | 1 + hw/intc/openpic.c | 1 + hw/intc/pl190.c | 1 + hw/misc/arm11scu.c | 1 + hw/misc/arm_integrator_debug.c | 1 + hw/misc/arm_l2x0.c | 1 + hw/misc/arm_sysctl.c | 1 + hw/misc/bcm2835_mbox.c | 1 + hw/misc/bcm2835_property.c | 1 + hw/misc/imx25_ccm.c | 1 + hw/misc/imx31_ccm.c | 1 + hw/misc/imx_ccm.c | 1 + hw/misc/macio/cuda.c | 1 + hw/misc/macio/mac_dbdma.c | 1 + hw/misc/stm32f2xx_syscfg.c | 1 + hw/misc/zynq-xadc.c | 1 + hw/misc/zynq_slcr.c | 1 + hw/net/allwinner_emac.c | 1 + hw/net/fsl_etsec/etsec.c | 1 + hw/net/fsl_etsec/rings.c | 2 +- hw/net/imx_fec.c | 1 + hw/net/lan9118.c | 1 + hw/net/spapr_llan.c | 1 + hw/pci-host/apb.c | 1 + hw/pci-host/versatile.c | 1 + hw/ppc/spapr.c | 1 + hw/ppc/spapr_hcall.c | 1 + hw/ppc/spapr_iommu.c | 1 + hw/ppc/spapr_rtas.c | 1 + hw/ppc/spapr_vio.c | 1 + hw/sd/pl181.c | 1 + hw/sd/sd.c | 1 + hw/sd/sdhci.c | 1 + hw/ssi/pl022.c | 1 + hw/timer/allwinner-a10-pit.c | 1 + hw/timer/arm_timer.c | 1 + hw/timer/digic-timer.c | 1 + hw/timer/imx_epit.c | 1 + hw/timer/imx_gpt.c | 1 + hw/timer/pl031.c | 1 + hw/timer/stm32f2xx_timer.c | 1 + hw/watchdog/wdt_diag288.c | 1 + include/hw/hw.h | 1 - monitor.c | 1 + vl.c | 1 + 76 files changed, 78 insertions(+), 2 deletions(-)
hw/arm/nseries.c +1 -0
@@ -37,6 +37,7 @@#include "hw/loader.h" #include "sysemu/block-backend.h" #include "hw/sysbus.h" +#include "qemu/log.h" #include "exec/address-spaces.h" /* Nokia N8x0 support */
hw/arm/pxa2xx_gpio.c +1 -0
@@ -12,6 +12,7 @@#include "hw/hw.h" #include "hw/sysbus.h" #include "hw/arm/pxa.h" +#include "qemu/log.h" #define PXA2XX_GPIO_BANKS 4
hw/arm/stellaris.c +1 -0
@@ -17,6 +17,7 @@#include "hw/i2c/i2c.h" #include "net/net.h" #include "hw/boards.h" +#include "qemu/log.h" #include "exec/address-spaces.h" #include "sysemu/sysemu.h"
hw/arm/strongarm.c +1 -0
@@ -37,6 +37,7 @@#include "sysemu/char.h" #include "sysemu/sysemu.h" #include "hw/ssi/ssi.h" +#include "qemu/log.h" //#define DEBUG
hw/arm/xlnx-ep108.c +1 -0
@@ -23,6 +23,7 @@#include "hw/boards.h" #include "qemu/error-report.h" #include "exec/address-spaces.h" +#include "qemu/log.h" typedef struct XlnxEP108 { XlnxZynqMPState soc;
hw/audio/pl041.c +1 -0
@@ -22,6 +22,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qemu/log.h" #include "pl041.h" #include "lm4549.h"
hw/block/m25p80.c +1 -0
@@ -26,6 +26,7 @@#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "hw/ssi/ssi.h" +#include "qemu/log.h" #ifndef M25P80_ERR_DEBUG #define M25P80_ERR_DEBUG 0
hw/block/pflash_cfi01.c +1 -0
@@ -45,6 +45,7 @@#include "qemu/bitops.h" #include "exec/address-spaces.h" #include "qemu/host-utils.h" +#include "qemu/log.h" #include "hw/sysbus.h" #define PFLASH_BUG (fmt, ...) \
hw/char/cadence_uart.c +4 -0
@@ -17,6 +17,10 @@*/ #include "qemu/osdep.h" +#include "hw/sysbus.h" +#include "sysemu/char.h" +#include "qemu/timer.h" +#include "qemu/log.h" #include "hw/char/cadence_uart.h" #ifdef CADENCE_UART_ERR_DEBUG
hw/char/digic-uart.c +1 -0
@@ -30,6 +30,7 @@#include "hw/hw.h" #include "hw/sysbus.h" #include "sysemu/char.h" +#include "qemu/log.h" #include "hw/char/digic-uart.h"
hw/char/imx_serial.c +1 -0
@@ -22,6 +22,7 @@#include "hw/char/imx_serial.h" #include "sysemu/sysemu.h" #include "sysemu/char.h" +#include "qemu/log.h" #ifndef DEBUG_IMX_UART #define DEBUG_IMX_UART 0
hw/char/pl011.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" #include "sysemu/char.h" +#include "qemu/log.h" #define TYPE_PL011 "pl011"#define PL011 (obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011)
hw/char/stm32f2xx_usart.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "hw/char/stm32f2xx_usart.h" +#include "qemu/log.h" #ifndef STM_USART_ERR_DEBUG #define STM_USART_ERR_DEBUG 0
hw/display/cg3.c +1 -0
@@ -31,6 +31,7 @@#include "ui/console.h" #include "hw/sysbus.h" #include "hw/loader.h" +#include "qemu/log.h" /* Change to 1 to enable debugging */ #define DEBUG_CG3 0
hw/display/pl110.c +1 -0
@@ -12,6 +12,7 @@#include "ui/console.h" #include "framebuffer.h" #include "ui/pixel_ops.h" +#include "qemu/log.h" #define PL110_CR_EN 0x001#define PL110_CR_BGR 0x100
hw/display/virtio-gpu.c +1 -0
@@ -19,6 +19,7 @@#include "hw/virtio/virtio.h" #include "hw/virtio/virtio-gpu.h" #include "hw/virtio/virtio-bus.h" +#include "qemu/log.h" static struct virtio_gpu_simple_resource *virtio_gpu_find_resource (VirtIOGPU *g,uint32_t resource_id);
hw/dma/pl080.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" #include "exec/address-spaces.h" +#include "qemu/log.h" #define PL080_MAX_CHANNELS 8#define PL080_CONF_E 0x1
hw/dma/pl330.c +1 -0
@@ -19,6 +19,7 @@#include "qapi/error.h" #include "qemu/timer.h" #include "sysemu/dma.h" +#include "qemu/log.h" #ifndef PL330_ERR_DEBUG #define PL330_ERR_DEBUG 0
hw/dma/rc4030.c +1 -0
@@ -27,6 +27,7 @@#include "hw/mips/mips.h" #include "hw/sysbus.h" #include "qemu/timer.h" +#include "qemu/log.h" #include "exec/address-spaces.h" #include "trace.h"
hw/gpio/imx_gpio.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "hw/gpio/imx_gpio.h" +#include "qemu/log.h" #ifndef DEBUG_IMX_GPIO #define DEBUG_IMX_GPIO 0
hw/gpio/pl061.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qemu/log.h" //#define DEBUG_PL061 1
hw/i2c/imx_i2c.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "hw/i2c/imx_i2c.h" #include "hw/i2c/i2c.h" +#include "qemu/log.h" #ifndef DEBUG_IMX_I2C #define DEBUG_IMX_I2C 0
hw/i2c/versatile_i2c.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" #include "bitbang_i2c.h" +#include "qemu/log.h" #define TYPE_VERSATILE_I2C "versatile_i2c"#define VERSATILE_I2C (obj) \
hw/input/pl050.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" #include "hw/input/ps2.h" +#include "qemu/log.h" #define TYPE_PL050 "pl050"#define PL050 (obj) OBJECT_CHECK(PL050State, (obj), TYPE_PL050)
hw/intc/allwinner-a10-pic.c +1 -0
@@ -20,6 +20,7 @@#include "hw/devices.h" #include "sysemu/sysemu.h" #include "hw/intc/allwinner-a10-pic.h" +#include "qemu/log.h" static void aw_a10_pic_update (AwA10PICState *s) {
hw/intc/arm_gic.c +1 -0
@@ -23,6 +23,7 @@#include "gic_internal.h" #include "qapi/error.h" #include "qom/cpu.h" +#include "qemu/log.h" //#define DEBUG_GIC
hw/intc/arm_gicv2m.c +1 -0
@@ -30,6 +30,7 @@#include "hw/sysbus.h" #include "hw/pci/msi.h" #include "sysemu/kvm.h" +#include "qemu/log.h" #define TYPE_ARM_GICV2M "arm-gicv2m"#define ARM_GICV2M (obj) OBJECT_CHECK(ARMGICv2mState, (obj), TYPE_ARM_GICV2M)
hw/intc/armv7m_nvic.c +1 -0
@@ -19,6 +19,7 @@#include "hw/arm/arm.h" #include "exec/address-spaces.h" #include "gic_internal.h" +#include "qemu/log.h" typedef struct { GICState gic;
hw/intc/bcm2835_ic.c +1 -0
@@ -14,6 +14,7 @@#include "qemu/osdep.h" #include "hw/intc/bcm2835_ic.h" +#include "qemu/log.h" #define GPU_IRQS 64#define ARM_IRQS 8
hw/intc/bcm2836_control.c +1 -0
@@ -15,6 +15,7 @@#include "qemu/osdep.h" #include "hw/intc/bcm2836_control.h" +#include "qemu/log.h" #define REG_GPU_ROUTE 0x0c#define REG_TIMERCONTROL 0x40
hw/intc/i8259.c +1 -0
@@ -27,6 +27,7 @@#include "hw/isa/isa.h" #include "monitor/monitor.h" #include "qemu/timer.h" +#include "qemu/log.h" #include "hw/isa/i8259_internal.h" /* debug PIC */
hw/intc/imx_avic.c +1 -0
@@ -17,6 +17,7 @@#include "qemu/osdep.h" #include "hw/intc/imx_avic.h" +#include "qemu/log.h" #ifndef DEBUG_IMX_AVIC #define DEBUG_IMX_AVIC 0
hw/intc/openpic.c +1 -0
@@ -44,6 +44,7 @@#include "qapi/error.h" #include "qemu/bitops.h" #include "qapi/qmp/qerror.h" +#include "qemu/log.h" //#define DEBUG_OPENPIC
hw/intc/pl190.c +1 -0
@@ -9,6 +9,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qemu/log.h" /* The number of virtual priority levels. 16 user vectors plus the unvectored IRQ. Chained interrupts would require an additional level
hw/misc/arm11scu.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "hw/misc/arm11scu.h" +#include "qemu/log.h" static uint64_t mpcore_scu_read (void *opaque,hwaddr offset,unsigned size)
hw/misc/arm_integrator_debug.c +1 -0
@@ -19,6 +19,7 @@#include "hw/sysbus.h" #include "exec/address-spaces.h" #include "hw/misc/arm_integrator_debug.h" +#include "qemu/log.h" #define INTEGRATOR_DEBUG (obj) \ OBJECT_CHECK(IntegratorDebugState, (obj), TYPE_INTEGRATOR_DEBUG)
hw/misc/arm_l2x0.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" +#include "qemu/log.h" /* L2C-310 r3p2 */ #define CACHE_ID 0x410000c8
hw/misc/arm_sysctl.c +1 -0
@@ -14,6 +14,7 @@#include "hw/sysbus.h" #include "hw/arm/primecell.h" #include "sysemu/sysemu.h" +#include "qemu/log.h" #define LOCK_VALUE 0xa05f
hw/misc/bcm2835_mbox.c +1 -0
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/misc/bcm2835_mbox.h" +#include "qemu/log.h" #define MAIL0_PEEK 0x90#define MAIL0_SENDER 0x94
hw/misc/bcm2835_property.c +1 -0
@@ -8,6 +8,7 @@#include "hw/misc/bcm2835_property.h" #include "hw/misc/bcm2835_mbox_defs.h" #include "sysemu/dma.h" +#include "qemu/log.h" /* https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface */
hw/misc/imx25_ccm.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "hw/misc/imx25_ccm.h" +#include "qemu/log.h" #ifndef DEBUG_IMX25_CCM #define DEBUG_IMX25_CCM 0
hw/misc/imx31_ccm.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "hw/misc/imx31_ccm.h" +#include "qemu/log.h" #define CKIH_FREQ 26000000/* 26MHz crystal input */
hw/misc/imx_ccm.c +1 -0
@@ -13,6 +13,7 @@#include "qemu/osdep.h" #include "hw/misc/imx_ccm.h" +#include "qemu/log.h" #ifndef DEBUG_IMX_CCM #define DEBUG_IMX_CCM 0
hw/misc/macio/cuda.c +1 -0
@@ -28,6 +28,7 @@#include "hw/input/adb.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" +#include "qemu/log.h" /* XXX: implement all timer modes */
hw/misc/macio/mac_dbdma.c +1 -0
@@ -41,6 +41,7 @@#include "hw/isa/isa.h" #include "hw/ppc/mac_dbdma.h" #include "qemu/main-loop.h" +#include "qemu/log.h" /* debug DBDMA */ //#define DEBUG_DBDMA
hw/misc/stm32f2xx_syscfg.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "hw/misc/stm32f2xx_syscfg.h" +#include "qemu/log.h" #ifndef STM_SYSCFG_ERR_DEBUG #define STM_SYSCFG_ERR_DEBUG 0
hw/misc/zynq-xadc.c +1 -0
@@ -18,6 +18,7 @@#include "hw/misc/zynq-xadc.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" +#include "qemu/log.h" enum {CFG =0x000 /4 ,
hw/misc/zynq_slcr.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/timer.h" #include "hw/sysbus.h" #include "sysemu/sysemu.h" +#include "qemu/log.h" #ifndef ZYNQ_SLCR_ERR_DEBUG #define ZYNQ_SLCR_ERR_DEBUG 0
hw/net/allwinner_emac.c +1 -0
@@ -21,6 +21,7 @@#include "net/net.h" #include "qemu/fifo8.h" #include "hw/net/allwinner_emac.h" +#include "qemu/log.h" #include <zlib.h> static uint8_t padding[60 ];
hw/net/fsl_etsec/etsec.c +1 -0
@@ -33,6 +33,7 @@#include "hw/ptimer.h" #include "etsec.h" #include "registers.h" +#include "qemu/log.h" /* #define HEX_DUMP */ /* #define DEBUG_REGISTER */
hw/net/fsl_etsec/rings.c +1 -1
@@ -23,7 +23,7 @@*/ #include "qemu/osdep.h" #include "net/checksum.h" - +#include "qemu/log.h" #include "etsec.h" #include "registers.h"
hw/net/imx_fec.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "hw/net/imx_fec.h" #include "sysemu/dma.h" +#include "qemu/log.h" /* For crc32 */ #include <zlib.h>
hw/net/lan9118.c +1 -0
@@ -16,6 +16,7 @@#include "hw/devices.h" #include "sysemu/sysemu.h" #include "hw/ptimer.h" +#include "qemu/log.h" /* For crc32 */ #include <zlib.h>
hw/net/spapr_llan.c +1 -0
@@ -28,6 +28,7 @@#include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" +#include "qemu/log.h" #include "net/net.h" #include "hw/qdev.h" #include "hw/ppc/spapr.h"
hw/pci-host/apb.c +1 -0
@@ -36,6 +36,7 @@#include "hw/pci-host/apb.h" #include "sysemu/sysemu.h" #include "exec/address-spaces.h" +#include "qemu/log.h" /* debug APB */ //#define DEBUG_APB
hw/pci-host/versatile.c +1 -0
@@ -13,6 +13,7 @@#include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" #include "exec/address-spaces.h" +#include "qemu/log.h" /* Old and buggy versions of QEMU used the wrong mapping from * PCI IRQs to system interrupt lines. Unfortunately the Linux
hw/ppc/spapr.c +1 -0
@@ -29,6 +29,7 @@#include "sysemu/sysemu.h" #include "sysemu/numa.h" #include "hw/hw.h" +#include "qemu/log.h" #include "hw/fw-path-provider.h" #include "elf.h" #include "net/net.h"
hw/ppc/spapr_hcall.c +1 -0
@@ -1,6 +1,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "sysemu/sysemu.h" +#include "qemu/log.h" #include "cpu.h" #include "helper_regs.h" #include "hw/ppc/spapr.h"
hw/ppc/spapr_iommu.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" #include "hw/hw.h" +#include "qemu/log.h" #include "sysemu/kvm.h" #include "hw/qdev.h" #include "kvm_ppc.h"
hw/ppc/spapr_rtas.c +1 -0
@@ -26,6 +26,7 @@*/ #include "qemu/osdep.h" #include "cpu.h" +#include "qemu/log.h" #include "sysemu/sysemu.h" #include "sysemu/char.h" #include "hw/qdev.h"
hw/ppc/spapr_vio.c +1 -0
@@ -22,6 +22,7 @@#include "qemu/osdep.h" #include "qapi/error.h" #include "hw/hw.h" +#include "qemu/log.h" #include "sysemu/sysemu.h" #include "hw/boards.h" #include "hw/loader.h"
hw/sd/pl181.c +1 -0
@@ -12,6 +12,7 @@#include "sysemu/blockdev.h" #include "hw/sysbus.h" #include "hw/sd/sd.h" +#include "qemu/log.h" //#define DEBUG_PL181 1
hw/sd/sd.c +1 -0
@@ -39,6 +39,7 @@#include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "qemu/timer.h" +#include "qemu/log.h" //#define DEBUG_SD 1
hw/sd/sdhci.c +1 -0
@@ -30,6 +30,7 @@#include "qemu/timer.h" #include "qemu/bitops.h" #include "sdhci-internal.h" +#include "qemu/log.h" /* host controller debug messages */ #ifndef SDHC_DEBUG
hw/ssi/pl022.c +1 -0
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "hw/sysbus.h" #include "hw/ssi/ssi.h" +#include "qemu/log.h" //#define DEBUG_PL022 1
hw/timer/allwinner-a10-pit.c +1 -0
@@ -19,6 +19,7 @@#include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/timer/allwinner-a10-pit.h" +#include "qemu/log.h" static void a10_pit_update_irq (AwA10PITState *s) {
hw/timer/arm_timer.c +1 -0
@@ -14,6 +14,7 @@#include "hw/qdev.h" #include "hw/ptimer.h" #include "qemu/main-loop.h" +#include "qemu/log.h" /* Common timer implementation. */
hw/timer/digic-timer.c +1 -0
@@ -30,6 +30,7 @@#include "hw/sysbus.h" #include "hw/ptimer.h" #include "qemu/main-loop.h" +#include "qemu/log.h" #include "hw/timer/digic-timer.h"
hw/timer/imx_epit.c +1 -0
@@ -16,6 +16,7 @@#include "hw/timer/imx_epit.h" #include "hw/misc/imx_ccm.h" #include "qemu/main-loop.h" +#include "qemu/log.h" #ifndef DEBUG_IMX_EPIT #define DEBUG_IMX_EPIT 0
hw/timer/imx_gpt.c +1 -0
@@ -16,6 +16,7 @@#include "hw/timer/imx_gpt.h" #include "hw/misc/imx_ccm.h" #include "qemu/main-loop.h" +#include "qemu/log.h" #ifndef DEBUG_IMX_GPT #define DEBUG_IMX_GPT 0
hw/timer/pl031.c +1 -0
@@ -15,6 +15,7 @@#include "hw/sysbus.h" #include "qemu/timer.h" #include "sysemu/sysemu.h" +#include "qemu/log.h" //#define DEBUG_PL031
hw/timer/stm32f2xx_timer.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "hw/timer/stm32f2xx_timer.h" +#include "qemu/log.h" #ifndef STM_TIMER_ERR_DEBUG #define STM_TIMER_ERR_DEBUG 0
hw/watchdog/wdt_diag288.c +1 -0
@@ -16,6 +16,7 @@#include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/watchdog/wdt_diag288.h" +#include "qemu/log.h" static WatchdogTimerModel model = { .wdt_name =TYPE_WDT_DIAG288 ,
include/hw/hw.h +0 -1
@@ -11,7 +11,6 @@#include "hw/irq.h" #include "block/aio.h" #include "migration/vmstate.h" -#include "qemu/log.h" #include "qemu/module.h" typedef void QEMUResetHandler (void *opaque);
monitor.c +1 -0
@@ -70,6 +70,7 @@#include "trace/simple.h" #endif #include "exec/memory.h" +#include "qemu/log.h" #include "qmp-commands.h" #include "hmp.h" #include "qemu/thread.h"
vl.c +1 -0
@@ -79,6 +79,7 @@ int main(int argc, char **argv)#include "qemu/timer.h" #include "sysemu/char.h" #include "qemu/bitmap.h" +#include "qemu/log.h" #include "sysemu/blockdev.h" #include "hw/block/block.h" #include "migration/block.h"
Signature · 1 line
1.8.3.1
PATCH 46/49 exec: extract exec/tb-context.h
In reply to Paolo BonziniTCG backends do not need most of exec-all.h; extract what they actually need to a separate file or move it directly to tcg.h. The next patch will stop including exec-all.h from everywhere.
--- include/exec/exec-all.h | 47 +---------------------------------------------- include/exec/tb-context.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ tcg/optimize.c | 2 +- tcg/tcg-common.c | 2 ++ tcg/tcg.h | 22 ++++++++++++++++++++++ 5 files changed, 72 insertions(+), 47 deletions(-) create mode 100644 include/exec/tb-context.h
include/exec/exec-all.h +1 -46
@@ -21,6 +21,7 @@#define _EXEC_ALL_H_#include "qemu-common.h" +#include "exec/tb-context.h" /* allow to see translation results - the slowdown should be negligible, so we leave it */ #define DEBUG_DISAS
@@ -40,30 +41,6 @@ typedef ram_addr_t tb_page_addr_t;#define DISAS_UPDATE 2/* cpu state was modified dynamically */ #define DISAS_TB_JUMP 3/* only pc was modified statically */ -struct TranslationBlock ; -typedef struct TranslationBlock TranslationBlock ; - -/* XXX: make safe guess about sizes */ -#define MAX_OP_PER_INSTR 266 - -#if HOST_LONG_BITS ==32 -#define MAX_OPC_PARAM_PER_ARG 2 -#else -#define MAX_OPC_PARAM_PER_ARG 1 -#endif -#define MAX_OPC_PARAM_IARGS 5 -#define MAX_OPC_PARAM_OARGS 1 -#define MAX_OPC_PARAM_ARGS (MAX_OPC_PARAM_IARGS + MAX_OPC_PARAM_OARGS) - -/* A Call op needs up to 4 + 2N parameters on 32-bit archs, -* and up to 4 + N parameters on 64-bit archs -* (N = number of input arguments + output arguments). */ -#define MAX_OPC_PARAM (4 + (MAX_OPC_PARAM_PER_ARG * MAX_OPC_PARAM_ARGS)) -#define OPC_BUF_SIZE 640 -#define OPC_MAX_SIZE (OPC_BUF_SIZE - MAX_OP_PER_INSTR) - -#define OPPARAM_BUF_SIZE (OPC_BUF_SIZE * MAX_OPC_PARAM) -#include "qemu/log.h" void gen_intermediate_code (CPUArchState *env,struct TranslationBlock *tb);
@@ -211,9 +188,6 @@ static inline void tlb_flush_by_mmuidx(CPUState *cpu, ...)#define CODE_GEN_ALIGN 16/* must be >= of the size of a icache line */ -#define CODE_GEN_PHYS_HASH_BITS 15 -#define CODE_GEN_PHYS_HASH_SIZE (1 << CODE_GEN_PHYS_HASH_BITS) -/* Estimated block size for TB allocation. */ /* ??? The following is based on a 2015 survey of x86_64 host output. Better would seem to be some sort of dynamically sized TB array,
@@ -273,25 +247,6 @@ struct TranslationBlock {struct TranslationBlock *jmp_first; }; -#include "qemu/thread.h" - -typedef struct TBContext TBContext ; - -struct TBContext { - -TranslationBlock *tbs; -TranslationBlock *tb_phys_hash[CODE_GEN_PHYS_HASH_SIZE ]; -int nb_tbs; -/* any access to the tbs or the page table must use this lock */ -QemuMutex tb_lock; - -/* statistics */ -int tb_flush_count; -int tb_phys_invalidate_count; - -int tb_invalidated_flag; -}; -void tb_free (TranslationBlock *tb);void tb_flush (CPUState *cpu);void tb_phys_invalidate (TranslationBlock *tb,tb_page_addr_t page_addr);
include/exec/tb-context.h new file +46 -0
46 lines not on this page · raw message
tcg/optimize.c +1 -1
@@ -25,7 +25,7 @@#include "qemu/osdep.h" #include "qemu-common.h" -#include "cpu.h" +#include "exec/cpu-common.h" #include "tcg-op.h" #define CASE_OP_32_64 (x) \
tcg/tcg-common.c +2 -0
@@ -23,6 +23,8 @@*/ #include "qemu/osdep.h" +#include "qemu-common.h" +#include "exec/cpu-common.h" #include "tcg/tcg.h" #if defined(CONFIG_TCG_INTERPRETER )
tcg/tcg.h +22 -0
@@ -27,9 +27,31 @@#include "qemu-common.h" #include "cpu.h" +#include "exec/tb-context.h" #include "qemu/bitops.h" #include "tcg-target.h" +/* XXX: make safe guess about sizes */ +#define MAX_OP_PER_INSTR 266 + +#if HOST_LONG_BITS ==32 +#define MAX_OPC_PARAM_PER_ARG 2 +#else +#define MAX_OPC_PARAM_PER_ARG 1 +#endif +#define MAX_OPC_PARAM_IARGS 5 +#define MAX_OPC_PARAM_OARGS 1 +#define MAX_OPC_PARAM_ARGS (MAX_OPC_PARAM_IARGS + MAX_OPC_PARAM_OARGS) + +/* A Call op needs up to 4 + 2N parameters on 32-bit archs, +* and up to 4 + N parameters on 64-bit archs +* (N = number of input arguments + output arguments). */ +#define MAX_OPC_PARAM (4 + (MAX_OPC_PARAM_PER_ARG * MAX_OPC_PARAM_ARGS)) +#define OPC_BUF_SIZE 640 +#define OPC_MAX_SIZE (OPC_BUF_SIZE - MAX_OP_PER_INSTR) + +#define OPPARAM_BUF_SIZE (OPC_BUF_SIZE * MAX_OPC_PARAM) +#define CPU_TEMP_BUF_NLONGS 128/* Default target word size to pointer size. */
Signature · 1 line
1.8.3.1
PATCH 47/49 cpu: move exec-all.h inclusion out of cpu.h
In reply to Paolo Bonziniexec-all.h contains TCG-specific definitions. It is not needed outside TCG-specific files such as translate.c, exec.c or *helper.c.
One generic function had snuck into include/exec/exec-all.h; move it to include/qom/cpu.h.
--- bsd-user/main.c | 1 + bsd-user/qemu.h | 1 + cpu-exec-common.c | 1 + cpu-exec.c | 1 + cpus.c | 1 + cputlb.c | 1 + disas/tci.c | 1 + exec.c | 1 + gdbstub.c | 1 + hw/i386/kvmvapic.c | 1 + hw/ppc/spapr_hcall.c | 1 + hw/sh4/sh7750.c | 1 + include/exec/exec-all.h | 9 --------- include/qom/cpu.h | 10 ++++++++++ linux-user/main.c | 1 + linux-user/qemu.h | 1 + monitor.c | 1 + target-alpha/cpu.c | 1 + target-alpha/cpu.h | 2 -- target-alpha/fpu_helper.c | 1 + target-alpha/helper.c | 1 + target-alpha/int_helper.c | 1 + target-alpha/mem_helper.c | 1 + target-alpha/sys_helper.c | 1 + target-alpha/translate.c | 1 + target-alpha/vax_helper.c | 1 + target-arm/arm_ldst.h | 1 + target-arm/cpu.c | 1 + target-arm/cpu.h | 2 -- target-arm/helper-a64.c | 1 + target-arm/helper.c | 1 + target-arm/op_helper.c | 1 + target-arm/psci.c | 1 + target-arm/translate-a64.c | 1 + target-arm/translate.c | 1 + target-cris/cpu.c | 1 + target-cris/cpu.h | 2 -- target-cris/helper.c | 1 + target-cris/mmu.c | 1 + target-cris/op_helper.c | 1 + target-cris/translate.c | 1 + target-i386/bpt_helper.c | 1 + target-i386/cpu.c | 1 + target-i386/cpu.h | 2 -- target-i386/excp_helper.c | 1 + target-i386/fpu_helper.c | 1 + target-i386/helper.c | 1 + target-i386/int_helper.c | 1 + target-i386/machine.c | 3 +++ target-i386/mem_helper.c | 1 + target-i386/misc_helper.c | 1 + target-i386/mpx_helper.c | 1 + target-i386/seg_helper.c | 1 + target-i386/svm_helper.c | 1 + target-i386/translate.c | 1 + target-lm32/cpu.c | 1 + target-lm32/cpu.h | 2 -- target-lm32/helper.c | 1 + target-lm32/op_helper.c | 1 + target-lm32/translate.c | 1 + target-m68k/cpu.c | 1 + target-m68k/cpu.h | 2 -- target-m68k/helper.c | 1 + target-m68k/m68k-semi.c | 1 + target-m68k/op_helper.c | 1 + target-m68k/translate.c | 1 + target-microblaze/cpu.c | 1 + target-microblaze/cpu.h | 2 -- target-microblaze/helper.c | 1 + target-microblaze/mmu.c | 1 + target-microblaze/op_helper.c | 1 + target-microblaze/translate.c | 1 + target-mips/cpu.c | 1 + target-mips/cpu.h | 2 -- target-mips/helper.c | 1 + target-mips/mips-semi.c | 1 + target-mips/msa_helper.c | 1 + target-mips/op_helper.c | 1 + target-mips/translate.c | 1 + target-moxie/cpu.c | 1 + target-moxie/cpu.h | 1 - target-openrisc/cpu.c | 1 + target-openrisc/cpu.h | 2 -- target-openrisc/exception.c | 1 + target-openrisc/interrupt.c | 1 + target-openrisc/interrupt_helper.c | 1 + target-openrisc/mmu.c | 1 + target-openrisc/mmu_helper.c | 1 + target-openrisc/sys_helper.c | 1 + target-ppc/cpu.h | 2 -- target-ppc/excp_helper.c | 1 + target-ppc/int_helper.c | 1 + target-ppc/machine.c | 2 ++ target-ppc/mem_helper.c | 2 ++ target-ppc/misc_helper.c | 1 + target-ppc/mmu-hash32.c | 1 + target-ppc/mmu-hash64.c | 1 + target-ppc/mmu_helper.c | 1 + target-ppc/timebase_helper.c | 1 + target-ppc/translate.c | 1 + target-s390x/cc_helper.c | 1 + target-s390x/cpu.c | 1 + target-s390x/cpu.h | 2 -- target-s390x/fpu_helper.c | 1 + target-s390x/gdbstub.c | 1 + target-s390x/helper.c | 1 + target-s390x/int_helper.c | 1 + target-s390x/mem_helper.c | 1 + target-s390x/misc_helper.c | 1 + target-s390x/translate.c | 1 + target-sh4/cpu.c | 1 + target-sh4/cpu.h | 2 -- target-sh4/helper.c | 1 + target-sh4/op_helper.c | 1 + target-sh4/translate.c | 1 + target-sparc/cpu.c | 1 + target-sparc/cpu.h | 2 -- target-sparc/helper.c | 1 + target-sparc/ldst_helper.c | 1 + target-sparc/machine.c | 3 +++ target-sparc/mmu_helper.c | 1 + target-sparc/translate.c | 1 + target-tilegx/cpu.c | 1 + target-tilegx/cpu.h | 2 -- target-tilegx/helper.c | 1 + target-tilegx/translate.c | 1 + target-tricore/cpu.c | 1 + target-tricore/cpu.h | 2 -- target-tricore/helper.c | 1 + target-tricore/op_helper.c | 1 + target-tricore/translate.c | 1 + target-unicore32/cpu.c | 1 + target-unicore32/cpu.h | 1 - target-unicore32/helper.c | 1 + target-unicore32/op_helper.c | 1 + target-unicore32/softmmu.c | 1 + target-unicore32/translate.c | 1 + target-xtensa/cpu.c | 1 + target-xtensa/cpu.h | 1 - target-xtensa/gdbstub.c | 1 + target-xtensa/op_helper.c | 1 + target-xtensa/translate.c | 1 + tcg/tcg-op.c | 1 + tcg/tcg.c | 7 +++++-- translate-all.c | 1 + user-exec.c | 1 + 146 files changed, 146 insertions(+), 44 deletions(-)
bsd-user/main.c +1 -0
@@ -24,6 +24,7 @@#include "qemu-common.h" /* For tb_lock */ #include "cpu.h" +#include "exec/exec-all.h" #include "tcg.h" #include "qemu/timer.h" #include "qemu/envlist.h"
bsd-user/qemu.h +1 -0
@@ -19,6 +19,7 @@#include "cpu.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #undef DEBUG_REMAP
cpu-exec-common.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "sysemu/cpus.h" +#include "exec/exec-all.h" #include "exec/memory-internal.h" bool exit_request;
cpu-exec.c +1 -0
@@ -20,6 +20,7 @@#include "cpu.h" #include "trace.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg.h" #include "qemu/atomic.h" #include "sysemu/qtest.h"
cpus.c +1 -0
@@ -34,6 +34,7 @@#include "sysemu/dma.h" #include "sysemu/kvm.h" #include "qmp-commands.h" +#include "exec/exec-all.h" #include "qemu/thread.h" #include "sysemu/cpus.h"
cputlb.c +1 -0
@@ -28,6 +28,7 @@#include "exec/memory-internal.h" #include "exec/ram_addr.h" +#include "exec/exec-all.h" #include "tcg/tcg.h" //#define DEBUG_TLB
disas/tci.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "disas/bfd.h" +#include "exec/exec-all.h" #include "tcg/tcg.h" /* Disassemble TCI bytecode. */
exec.c +1 -0
@@ -24,6 +24,7 @@#include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "tcg.h" #include "hw/qdev-core.h" #if !defined(CONFIG_USER_ONLY )
gdbstub.c +1 -0
@@ -36,6 +36,7 @@#include "qemu/sockets.h" #include "sysemu/kvm.h" #include "exec/semihost.h" +#include "exec/exec-all.h" #ifdef CONFIG_USER_ONLY #define GDB_ATTACHED "0"
hw/i386/kvmvapic.c +1 -0
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "sysemu/sysemu.h" #include "sysemu/cpus.h" #include "sysemu/kvm.h"
hw/ppc/spapr_hcall.c +1 -0
@@ -3,6 +3,7 @@#include "sysemu/sysemu.h" #include "qemu/log.h" #include "cpu.h" +#include "exec/exec-all.h" #include "helper_regs.h" #include "hw/ppc/spapr.h" #include "mmu-hash64.h"
hw/sh4/sh7750.c +1 -0
@@ -30,6 +30,7 @@#include "sh7750_regnames.h" #include "hw/sh4/sh_intc.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/address-spaces.h" #define NB_DEVICES 4
include/exec/exec-all.h +0 -9
@@ -80,15 +80,6 @@ void cpu_reloading_memory_map(void);* Note that with KVM only one address space is supported. */ void cpu_address_space_init (CPUState *cpu,AddressSpace *as,int asidx); -/** -* cpu_get_address_space: -* @cpu: CPU to get address space from -* @asidx: index identifying which address space to get -* -* Return the requested address space of this CPU. @asidx -* specifies which address space to read. -*/ -AddressSpace *cpu_get_address_space (CPUState *cpu,int asidx);/* cputlb.c */ /** * tlb_flush_page:
include/qom/cpu.h +10 -0
@@ -825,6 +825,16 @@ int cpu_watchpoint_remove(CPUState *cpu, vaddr addr,void cpu_watchpoint_remove_by_ref (CPUState *cpu,CPUWatchpoint *watchpoint);void cpu_watchpoint_remove_all (CPUState *cpu,int mask); +/** +* cpu_get_address_space: +* @cpu: CPU to get address space from +* @asidx: index identifying which address space to get +* +* Return the requested address space of this CPU. @asidx +* specifies which address space to read. +*/ +AddressSpace *cpu_get_address_space (CPUState *cpu,int asidx); + void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...) GCC_FMT_ATTR(2, 3); void cpu_exec_exit(CPUState *cpu);
linux-user/main.c +1 -0
@@ -24,6 +24,7 @@#include "qemu.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "tcg.h" #include "qemu/timer.h" #include "qemu/envlist.h"
linux-user/qemu.h +1 -0
@@ -3,6 +3,7 @@#include "cpu.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #undef DEBUG_REMAP
monitor.c +1 -0
@@ -70,6 +70,7 @@#include "trace/simple.h" #endif #include "exec/memory.h" +#include "exec/exec-all.h" #include "qemu/log.h" #include "qmp-commands.h" #include "hmp.h"
target-alpha/cpu.c +1 -0
@@ -24,6 +24,7 @@#include "cpu.h" #include "qemu-common.h" #include "migration/vmstate.h" +#include "exec/exec-all.h" static void alpha_cpu_set_pc (CPUState *cs,vaddr value)
target-alpha/cpu.h +0 -2
@@ -525,6 +525,4 @@ static inline void cpu_get_tb_cpu_state(CPUAlphaState *env, target_ulong *pc, *pflags = flags; } -#include "exec/exec-all.h" -#endif /* !defined (__CPU_ALPHA_H__) */
target-alpha/fpu_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h"
target-alpha/helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "fpu/softfloat.h" #include "exec/helper-proto.h"
target-alpha/int_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target-alpha/mem_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" /* Softmmu support */
target-alpha/sys_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "sysemu/sysemu.h" #include "qemu/timer.h"
target-alpha/translate.c +1 -0
@@ -21,6 +21,7 @@#include "cpu.h" #include "disas/disas.h" #include "qemu/host-utils.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h"
target-alpha/vax_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h"
target-arm/arm_ldst.h +1 -0
@@ -20,6 +20,7 @@#ifndef ARM_LDST_H #define ARM_LDST_H +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "qemu/bswap.h"
target-arm/cpu.c +1 -0
@@ -23,6 +23,7 @@#include "cpu.h" #include "internals.h" #include "qemu-common.h" +#include "exec/exec-all.h" #include "hw/qdev-properties.h" #if !defined(CONFIG_USER_ONLY )#include "hw/loader.h"
target-arm/cpu.h +0 -2
@@ -2341,8 +2341,6 @@ static inline void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, *cs_base =0 ; } -#include "exec/exec-all.h" -enum {QEMU_PSCI_CONDUIT_DISABLED =0 ,QEMU_PSCI_CONDUIT_SMC =1 ,
target-arm/helper-a64.c +1 -0
@@ -22,6 +22,7 @@#include "exec/gdbstub.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "qemu/log.h" #include "sysemu/sysemu.h" #include "qemu/bitops.h" #include "internals.h"
target-arm/helper.c +1 -0
@@ -8,6 +8,7 @@#include "sysemu/sysemu.h" #include "qemu/bitops.h" #include "qemu/crc32c.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "arm_ldst.h" #include <zlib.h> /* For crc32 */
target-arm/op_helper.c +1 -0
@@ -20,6 +20,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "internals.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #define SIGNBIT (uint32_t)0x80000000
target-arm/psci.c +1 -0
@@ -21,6 +21,7 @@#include <kvm-consts.h> #include <sysemu/sysemu.h> #include "internals.h" +#include "exec/exec-all.h" bool arm_is_psci_call (ARMCPU *cpu,int excp_type) {
target-arm/translate-a64.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "qemu/log.h" #include "arm_ldst.h"
target-arm/translate.c +1 -0
@@ -23,6 +23,7 @@#include "cpu.h" #include "internals.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "qemu/log.h" #include "qemu/bitops.h"
target-cris/cpu.c +1 -0
@@ -26,6 +26,7 @@#include "cpu.h" #include "qemu-common.h" #include "mmu.h" +#include "exec/exec-all.h" static void cris_cpu_set_pc (CPUState *cs,vaddr value)
target-cris/cpu.h +0 -2
@@ -300,6 +300,4 @@ static inline void cpu_get_tb_cpu_state(CPUCRISState *env, target_ulong *pc,#define cpu_list cris_cpu_listvoid cris_cpu_list (FILE *f,fprintf_function cpu_fprintf); -#include "exec/exec-all.h" -#endif
target-cris/helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "mmu.h" #include "qemu/host-utils.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h"
target-cris/mmu.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "mmu.h" #ifdef DEBUG
target-cris/op_helper.c +1 -0
@@ -23,6 +23,7 @@#include "mmu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" //#define CRIS_OP_HELPER_DEBUG
target-cris/translate.c +1 -0
@@ -26,6 +26,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/helper-proto.h" #include "mmu.h"
target-i386/bpt_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h"
target-i386/cpu.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "sysemu/kvm.h" #include "sysemu/cpus.h" #include "kvm_i386.h"
target-i386/cpu.h +0 -2
@@ -1358,8 +1358,6 @@ void tcg_x86_init(void);#include "hw/i386/apic.h" #endif -#include "exec/exec-all.h" -static inline void cpu_get_tb_cpu_state (CPUX86State *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-i386/excp_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/log.h" #include "sysemu/sysemu.h" #include "exec/helper-proto.h"
target-i386/fpu_helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #define FPU_RC_MASK 0xc00
target-i386/helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "sysemu/kvm.h" #include "kvm_i386.h" #ifndef CONFIG_USER_ONLY
target-i386/int_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h"
target-i386/machine.c +3 -0
@@ -1,13 +1,16 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/i386/pc.h" #include "hw/isa/isa.h" #include "migration/cpu.h" +#include "exec/exec-all.h" #include "cpu.h" +#include "exec/exec-all.h" #include "sysemu/kvm.h" #include "qemu/error-report.h"
target-i386/mem_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" /* broken thread support */
target-i386/misc_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/address-spaces.h"
target-i386/mpx_helper.c +1 -0
@@ -21,6 +21,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" +#include "exec/exec-all.h" void cpu_sync_bndcs_hflags (CPUX86State *env)
target-i386/seg_helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "qemu/log.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/log.h"
target-i386/svm_helper.c +1 -0
@@ -21,6 +21,7 @@#include "cpu.h" #include "exec/cpu-all.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" /* Secure Virtual Machine helpers */
target-i386/translate.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/host-utils.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h"
target-lm32/cpu.c +1 -0
@@ -22,6 +22,7 @@#include "qapi/error.h" #include "cpu.h" #include "qemu-common.h" +#include "exec/exec-all.h" static void lm32_cpu_set_pc (CPUState *cs,vaddr value)
target-lm32/cpu.h +0 -2
@@ -273,6 +273,4 @@ static inline void cpu_get_tb_cpu_state(CPULM32State *env, target_ulong *pc, *flags = 0; } -#include "exec/exec-all.h" -#endif
target-lm32/helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "sysemu/sysemu.h" #include "exec/semihost.h"
target-lm32/op_helper.c +1 -0
@@ -6,6 +6,7 @@#include "hw/lm32/lm32_pic.h" #include "hw/char/lm32_juart.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #ifndef CONFIG_USER_ONLY
target-lm32/translate.c +1 -0
@@ -21,6 +21,7 @@#include "cpu.h" #include "disas/disas.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h"
target-m68k/cpu.c +1 -0
@@ -23,6 +23,7 @@#include "cpu.h" #include "qemu-common.h" #include "migration/vmstate.h" +#include "exec/exec-all.h" static void m68k_cpu_set_pc (CPUState *cs,vaddr value)
target-m68k/cpu.h +0 -2
@@ -271,6 +271,4 @@ static inline void cpu_get_tb_cpu_state(CPUM68KState *env, target_ulong *pc, | ((env->macsr >> 4) & 0xf); /* Bits 0-3 */ } -#include "exec/exec-all.h" -#endif
target-m68k/helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/gdbstub.h" #include "exec/helper-proto.h"
target-m68k/m68k-semi.c +1 -0
@@ -28,6 +28,7 @@#include "exec/gdbstub.h" #include "exec/softmmu-semi.h" #endif +#include "qemu/log.h" #include "sysemu/sysemu.h" #define HOSTED_EXIT 0
target-m68k/op_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/semihost.h"
target-m68k/translate.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "qemu/log.h" #include "exec/cpu_ldst.h"
target-microblaze/cpu.c +1 -0
@@ -27,6 +27,7 @@#include "qemu-common.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "exec/exec-all.h" static const struct { const char *name;
target-microblaze/cpu.h +0 -2
@@ -379,6 +379,4 @@ void mb_cpu_unassigned_access(CPUState *cpu, hwaddr addr, unsigned size);#endif -#include "exec/exec-all.h" -#endif
target-microblaze/helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/log.h"
target-microblaze/mmu.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #define D (x)
target-microblaze/op_helper.c +1 -0
@@ -22,6 +22,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #define D (x)
target-microblaze/translate.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/helper-proto.h" #include "microblaze-decode.h"
target-mips/cpu.c +1 -0
@@ -24,6 +24,7 @@#include "kvm_mips.h" #include "qemu-common.h" #include "sysemu/kvm.h" +#include "exec/exec-all.h" static void mips_cpu_set_pc (CPUState *cs,vaddr value)
target-mips/cpu.h +0 -2
@@ -919,8 +919,6 @@ static inline int mips_vp_active(CPUMIPSState *env)return 1 ; } -#include "exec/exec-all.h" -static inline void compute_hflags (CPUMIPSState *env) { env->hflags &= ~(MIPS_HFLAG_COP1X | MIPS_HFLAG_64 | MIPS_HFLAG_CP0 |
target-mips/helper.c +1 -0
@@ -20,6 +20,7 @@#include "cpu.h" #include "sysemu/kvm.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/log.h"
target-mips/mips-semi.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "qemu/log.h" #include "exec/helper-proto.h" #include "exec/softmmu-semi.h" #include "exec/semihost.h"
target-mips/msa_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" /* Data format min and max values */
target-mips/op_helper.c +1 -0
@@ -20,6 +20,7 @@#include "cpu.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "sysemu/kvm.h"
target-mips/translate.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h"
target-moxie/cpu.c +1 -0
@@ -23,6 +23,7 @@#include "qemu-common.h" #include "migration/vmstate.h" #include "machine.h" +#include "exec/exec-all.h" static void moxie_cpu_set_pc (CPUState *cs,vaddr value) {
target-moxie/cpu.h +0 -1
@@ -129,7 +129,6 @@ static inline int cpu_mmu_index(CPUMoxieState *env, bool ifetch) }#include "exec/cpu-all.h" -#include "exec/exec-all.h" static inline void cpu_get_tb_cpu_state (CPUMoxieState *env,target_ulong *pc,target_ulong *cs_base,int *flags)
target-openrisc/cpu.c +1 -0
@@ -21,6 +21,7 @@#include "qapi/error.h" #include "cpu.h" #include "qemu-common.h" +#include "exec/exec-all.h" static void openrisc_cpu_set_pc (CPUState *cs,vaddr value) {
target-openrisc/cpu.h +0 -2
@@ -410,6 +410,4 @@ static inline int cpu_mmu_index(CPUOpenRISCState *env, bool ifetch)#define CPU_INTERRUPT_TIMER CPU_INTERRUPT_TGT_INT_0 -#include "exec/exec-all.h" -#endif /* CPU_OPENRISC_H */
target-openrisc/exception.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exception.h" void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp)
target-openrisc/interrupt.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu-common.h" #include "exec/gdbstub.h" #include "qemu/host-utils.h"
target-openrisc/interrupt_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" void HELPER (rfe )(CPUOpenRISCState *env)
target-openrisc/mmu.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu-common.h" #include "exec/gdbstub.h" #include "qemu/host-utils.h"
target-openrisc/mmu_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #ifndef CONFIG_USER_ONLY
target-openrisc/sys_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #define TO_SPR (group, number) (((group) << 11) + (number))
target-ppc/cpu.h +0 -2
@@ -2294,8 +2294,6 @@ static inline bool msr_is_64bit(CPUPPCState *env, target_ulong msr)extern void (*cpu_ppc_hypercall)(PowerPCCPU *); -#include "exec/exec-all.h" -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUPPCState *env);/**
target-ppc/excp_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "helper_regs.h"
target-ppc/int_helper.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "crypto/aes.h"
target-ppc/machine.c +2 -0
@@ -1,12 +1,14 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "hw/hw.h" #include "hw/boards.h" #include "sysemu/kvm.h" #include "helper_regs.h" #include "mmu-hash64.h" #include "migration/cpu.h" +#include "exec/exec-all.h" static int cpu_load_old (QEMUFile *f,void *opaque,int version_id) {
target-ppc/mem_helper.c +2 -0
@@ -18,10 +18,12 @@*/ #include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "helper_regs.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" //#define DEBUG_OP
target-ppc/misc_helper.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "helper_regs.h"
target-ppc/mmu-hash32.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "sysemu/kvm.h" #include "kvm_ppc.h"
target-ppc/mmu-hash64.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qemu/error-report.h" #include "sysemu/kvm.h"
target-ppc/mmu_helper.c +1 -0
@@ -23,6 +23,7 @@#include "kvm_ppc.h" #include "mmu-hash64.h" #include "mmu-hash32.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/log.h"
target-ppc/timebase_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "qemu/log.h" /*****************************************************************************/ /* SPR accesses */
target-ppc/translate.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "qemu/host-utils.h" #include "exec/cpu_ldst.h"
target-s390x/cc_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target-s390x/cpu.c +1 -0
@@ -32,6 +32,7 @@#include "trace.h" #include "qapi/visitor.h" #include "migration/vmstate.h" +#include "exec/exec-all.h" #ifndef CONFIG_USER_ONLY #include "hw/hw.h" #include "sysemu/arch_init.h"
target-s390x/cpu.h +0 -2
@@ -635,8 +635,6 @@ extern void subsystem_reset(void);void s390_cpu_list (FILE *f,fprintf_function cpu_fprintf);#define cpu_list s390_cpu_list -#include "exec/exec-all.h" -#define EXCP_EXT 1/* external interrupt */ #define EXCP_SVC 2/* supervisor call (syscall) */ #define EXCP_PGM 3/* program interruption */
target-s390x/fpu_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h"
target-s390x/gdbstub.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/gdbstub.h" #include "qemu/bitops.h"
target-s390x/helper.c +1 -0
@@ -23,6 +23,7 @@#include "cpu.h" #include "exec/gdbstub.h" #include "qemu/timer.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "hw/s390x/ioinst.h" #ifndef CONFIG_USER_ONLY
target-s390x/int_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h"
target-s390x/mem_helper.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #if !defined(CONFIG_USER_ONLY )
target-s390x/misc_helper.c +1 -0
@@ -29,6 +29,7 @@#ifdef CONFIG_KVM #include <linux/kvm.h> #endif +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #if !defined(CONFIG_USER_ONLY )
target-s390x/translate.c +1 -0
@@ -31,6 +31,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "qemu/log.h" #include "qemu/host-utils.h"
target-sh4/cpu.c +1 -0
@@ -24,6 +24,7 @@#include "cpu.h" #include "qemu-common.h" #include "migration/vmstate.h" +#include "exec/exec-all.h" static void superh_cpu_set_pc (CPUState *cs,vaddr value)
target-sh4/cpu.h +0 -2
@@ -389,6 +389,4 @@ static inline void cpu_get_tb_cpu_state(CPUSH4State *env, target_ulong *pc, | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 4 */ } -#include "exec/exec-all.h" -#endif /* _CPU_SH4_H */
target-sh4/helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/log.h" #if !defined(CONFIG_USER_ONLY )
target-sh4/op_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #ifndef CONFIG_USER_ONLY
target-sh4/translate.c +1 -0
@@ -22,6 +22,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h"
target-sparc/cpu.c +1 -0
@@ -21,6 +21,7 @@#include "qapi/error.h" #include "cpu.h" #include "qemu/error-report.h" +#include "exec/exec-all.h" //#define DEBUG_FEATURES
target-sparc/cpu.h +0 -2
@@ -768,6 +768,4 @@ static inline bool tb_am_enabled(int tb_flags) #endif } -#include "exec/exec-all.h" -#endif
target-sparc/helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "sysemu/sysemu.h"
target-sparc/ldst_helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" //#define DEBUG_MMU
target-sparc/machine.c +3 -0
@@ -1,12 +1,15 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "hw/hw.h" #include "hw/boards.h" #include "qemu/timer.h" #include "cpu.h" +#include "exec/exec-all.h" #include "migration/cpu.h" +#include "exec/exec-all.h" #ifdef TARGET_SPARC64 static const VMStateDescription vmstate_cpu_timer = {
target-sparc/mmu_helper.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "trace.h" #include "exec/address-spaces.h"
target-sparc/translate.c +1 -0
@@ -23,6 +23,7 @@#include "cpu.h" #include "disas/disas.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h"
target-tilegx/cpu.c +1 -0
@@ -25,6 +25,7 @@#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "linux-user/syscall_defs.h" +#include "exec/exec-all.h" static void tilegx_cpu_dump_state (CPUState *cs,FILE *f,fprintf_function cpu_fprintf,int flags)
target-tilegx/cpu.h +0 -2
@@ -176,6 +176,4 @@ static inline void cpu_get_tb_cpu_state(CPUTLGState *env, target_ulong *pc, *flags = 0; } -#include "exec/exec-all.h" -#endif
target-tilegx/helper.c +1 -0
@@ -20,6 +20,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "qemu-common.h" #include "exec/helper-proto.h" #include <zlib.h> /* For crc32 */
target-tilegx/translate.c +1 -0
@@ -23,6 +23,7 @@#include "qemu/log.h" #include "exec/log.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h" #include "linux-user/syscall_defs.h"
target-tricore/cpu.c +1 -0
@@ -21,6 +21,7 @@#include "qapi/error.h" #include "cpu.h" #include "qemu-common.h" +#include "exec/exec-all.h" static inline void set_feature (CPUTriCoreState *env,int feature) {
target-tricore/cpu.h +0 -2
@@ -420,6 +420,4 @@ int cpu_tricore_handle_mmu_fault(CPUState *cpu, target_ulong address, int rw, int mmu_idx);#define cpu_handle_mmu_fault cpu_tricore_handle_mmu_fault -#include "exec/exec-all.h" -#endif /*__TRICORE_CPU_H__ */
target-tricore/helper.c +1 -0
@@ -18,6 +18,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" enum {TLBRET_DIRTY =-4 ,
target-tricore/op_helper.c +1 -0
@@ -18,6 +18,7 @@#include "cpu.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include <zlib.h> /* for crc32 */
target-tricore/translate.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "exec/cpu_ldst.h"
target-unicore32/cpu.c +1 -0
@@ -17,6 +17,7 @@#include "cpu.h" #include "qemu-common.h" #include "migration/vmstate.h" +#include "exec/exec-all.h" static void uc32_cpu_set_pc (CPUState *cs,vaddr value) {
target-unicore32/cpu.h +0 -1
@@ -164,7 +164,6 @@ static inline int cpu_mmu_index(CPUUniCore32State *env, bool ifetch) }#include "exec/cpu-all.h" -#include "exec/exec-all.h" int uc32_cpu_exec (CPUState *s);
target-unicore32/helper.c +1 -0
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "cpu.h" +#include "exec/exec-all.h" #include "exec/gdbstub.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h"
target-unicore32/op_helper.c +1 -0
@@ -11,6 +11,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #define SIGNBIT (uint32_t)0x80000000
target-unicore32/softmmu.c +1 -0
@@ -14,6 +14,7 @@#include "qemu/osdep.h" #include <cpu.h> +#include "exec/exec-all.h" #undef DEBUG_UC32
target-unicore32/translate.c +1 -0
@@ -12,6 +12,7 @@#include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg-op.h" #include "qemu/log.h" #include "exec/cpu_ldst.h"
target-xtensa/cpu.c +1 -0
@@ -33,6 +33,7 @@#include "cpu.h" #include "qemu-common.h" #include "migration/vmstate.h" +#include "exec/exec-all.h" static void xtensa_cpu_set_pc (CPUState *cs,vaddr value)
target-xtensa/cpu.h +0 -1
@@ -427,6 +427,5 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState *env, target_ulong *pc, }#include "exec/cpu-all.h" -#include "exec/exec-all.h" #endif
target-xtensa/gdbstub.c +1 -0
@@ -21,6 +21,7 @@#include "qemu-common.h" #include "cpu.h" #include "exec/gdbstub.h" +#include "qemu/log.h" int xtensa_cpu_gdb_read_register (CPUState *cs,uint8_t *mem_buf,int n) {
target-xtensa/op_helper.c +1 -0
@@ -29,6 +29,7 @@#include "cpu.h" #include "exec/helper-proto.h" #include "qemu/host-utils.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/address-spaces.h" #include "qemu/timer.h"
target-xtensa/translate.c +1 -0
@@ -36,6 +36,7 @@#include "tcg-op.h" #include "qemu/log.h" #include "sysemu/sysemu.h" +#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/semihost.h"
tcg/tcg-op.c +1 -0
@@ -25,6 +25,7 @@#include "qemu/osdep.h" #include "qemu-common.h" #include "cpu.h" +#include "exec/exec-all.h" #include "tcg.h" #include "tcg-op.h"
tcg/tcg.c +5 -2
@@ -37,8 +37,6 @@#endif #include "qemu-common.h" -#include "qemu/host-utils.h" -#include "qemu/timer.h" /* Note: the long term plan is to reduce the dependencies on the QEMU CPU definitions. Currently they are used for qemu_ld/st
@@ -46,6 +44,11 @@#define NO_CPU_IO_DEFS #include "cpu.h" +#include "qemu/host-utils.h" +#include "qemu/timer.h" +#include "exec/cpu-common.h" +#include "exec/exec-all.h" +#include "tcg-op.h" #if UINTPTR_MAX ==UINT32_MAX
translate-all.c +1 -0
@@ -29,6 +29,7 @@#include "cpu.h" #include "trace.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg.h" #if defined(CONFIG_USER_ONLY )#include "qemu.h"
user-exec.c +1 -0
@@ -19,6 +19,7 @@#include "qemu/osdep.h" #include "cpu.h" #include "disas/disas.h" +#include "exec/exec-all.h" #include "tcg.h" #include "qemu/bitops.h" #include "exec/cpu_ldst.h"
Signature · 1 line
1.8.3.1
PATCH 48/49 hw: remove pio_addr_t
In reply to Paolo BonziniUsing uint32_t is enough and avoids the need to include ioport.h everywhere.
--- hw/core/sysbus.c | 4 ++-- include/exec/ioport.h | 15 ++++++--------- include/hw/sysbus.h | 4 ++-- ioport.c | 12 ++++++------ xen-hvm.c | 8 ++++---- 5 files changed, 20 insertions(+), 23 deletions(-)
hw/core/sysbus.c +2 -2
@@ -190,9 +190,9 @@ MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n)return dev->mmio[n].memory; } -void sysbus_init_ioports (SysBusDevice *dev,pio_addr_t ioport,pio_addr_t size) +void sysbus_init_ioports (SysBusDevice *dev,uint32_t ioport,uint32_t size) { -pio_addr_t i; +uint32_t i;for (i =0 ; i < size; i++) {assert (dev->num_pio <QDEV_MAX_PIO );
include/exec/ioport.h +6 -9
@@ -28,9 +28,6 @@#include "qom/object.h" #include "exec/memory.h" -typedef uint32_t pio_addr_t ; -#define FMT_pioaddr PRIx32 -#define MAX_IOPORTS (64 * 1024)#define IOPORTS_MASK (MAX_IOPORTS - 1)
@@ -49,12 +46,12 @@ typedef struct MemoryRegionPortio {extern const MemoryRegionOps unassigned_io_ops;#endif -void cpu_outb (pio_addr_t addr,uint8_t val); -void cpu_outw (pio_addr_t addr,uint16_t val); -void cpu_outl (pio_addr_t addr,uint32_t val); -uint8_t cpu_inb (pio_addr_t addr); -uint16_t cpu_inw (pio_addr_t addr); -uint32_t cpu_inl (pio_addr_t addr); +void cpu_outb (uint32_t addr,uint8_t val); +void cpu_outw (uint32_t addr,uint16_t val); +void cpu_outl (uint32_t addr,uint32_t val); +uint8_t cpu_inb (uint32_t addr); +uint16_t cpu_inw (uint32_t addr); +uint32_t cpu_inl (uint32_t addr); typedef struct PortioList { const struct MemoryRegionPortio *ports;
include/hw/sysbus.h +2 -2
@@ -72,7 +72,7 @@ struct SysBusDevice {MemoryRegion *memory; } mmio[QDEV_MAX_MMIO ];int num_pio; -pio_addr_t pio[QDEV_MAX_PIO ]; +uint32_t pio[QDEV_MAX_PIO ]; };typedef int FindSysbusDeviceFunc (SysBusDevice *sbdev,void *opaque);
@@ -81,7 +81,7 @@ void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory);MemoryRegion *sysbus_mmio_get_region (SysBusDevice *dev,int n);void sysbus_init_irq (SysBusDevice *dev,qemu_irq *p);void sysbus_pass_irq (SysBusDevice *dev,SysBusDevice *target); -void sysbus_init_ioports (SysBusDevice *dev,pio_addr_t ioport,pio_addr_t size); +void sysbus_init_ioports (SysBusDevice *dev,uint32_t ioport,uint32_t size);bool sysbus_has_irq (SysBusDevice *dev,int n);
ioport.c +6 -6
@@ -55,14 +55,14 @@ const MemoryRegionOps unassigned_io_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -void cpu_outb (pio_addr_t addr,uint8_t val) +void cpu_outb (uint32_t addr,uint8_t val) {trace_cpu_out (addr,'b' , val);address_space_write (&address_space_io, addr,MEMTXATTRS_UNSPECIFIED , &val,1 ); } -void cpu_outw (pio_addr_t addr,uint16_t val) +void cpu_outw (uint32_t addr,uint16_t val) {uint8_t buf[2 ];
@@ -72,7 +72,7 @@ void cpu_outw(pio_addr_t addr, uint16_t val) buf, 2); } -void cpu_outl (pio_addr_t addr,uint32_t val) +void cpu_outl (uint32_t addr,uint32_t val) {uint8_t buf[4 ];
@@ -82,7 +82,7 @@ void cpu_outl(pio_addr_t addr, uint32_t val) buf, 4); } -uint8_t cpu_inb (pio_addr_t addr) +uint8_t cpu_inb (uint32_t addr) {uint8_t val;
@@ -92,7 +92,7 @@ uint8_t cpu_inb(pio_addr_t addr)return val; } -uint16_t cpu_inw (pio_addr_t addr) +uint16_t cpu_inw (uint32_t addr) {uint8_t buf[2 ];uint16_t val;
@@ -103,7 +103,7 @@ uint16_t cpu_inw(pio_addr_t addr)return val; } -uint32_t cpu_inl (pio_addr_t addr) +uint32_t cpu_inl (uint32_t addr) {uint8_t buf[4 ];uint32_t val;
xen-hvm.c +4 -4
@@ -725,7 +725,7 @@ static ioreq_t *cpu_get_ioreq(XenIOState *state)return NULL ; } -static uint32_t do_inp (pio_addr_t addr,unsigned long size) +static uint32_t do_inp (uint32_t addr,unsigned long size) {switch (size) {case 1 :
@@ -735,11 +735,11 @@ static uint32_t do_inp(pio_addr_t addr, unsigned long size)case 4 :return cpu_inl (addr);default : -hw_error ("inp: bad size: %04" FMT_pioaddr" %lx" , addr, size); +hw_error ("inp: bad size: %04x %lx" , addr, size); } } -static void do_outp (pio_addr_t addr, +static void do_outp (uint32_t addr,unsigned long size,uint32_t val) {switch (size) {
@@ -750,7 +750,7 @@ static void do_outp(pio_addr_t addr,case 4 :return cpu_outl (addr, val);default : -hw_error ("outp: bad size: %04" FMT_pioaddr" %lx" , addr, size); +hw_error ("outp: bad size: %04x %lx" , addr, size); } }
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PATCH 48/49] hw: remove pio_addr_t
Quoted 3 lines · Paolo Bonzini
Using
uint32_tis enough and avoids the need to includeioport.heverywhere.Signed-off-by Paolo Bonzini <[email protected]>
I'm not hugely convinced by this patch -- I think it's nice to have a typedef that indicates that you're dealing with an IO port address (and not some other kind of address or number).
thanks
-- PMM
Re: [Qemu-devel] [PATCH 48/49] hw: remove pio_addr_t
Quoted 6 lines · Peter Maydell
Quoted 3 lines
Quoted 3 lines
Using
uint32_tis enough and avoids the need to includeioport.heverywhere.Signed-off-by Paolo Bonzini <[email protected]>I'm not hugely convinced by this patch -- I think it's nice to have a typedef that indicates that you're dealing with an IO port address (and not some other kind of address or number).
In theory I agree, but in practice it's just a burden. It's almost unused---on one hand that's also because these days I/O ports are simply accessed through the address space, on the other hand even portio_* functions use it.
cpu_{in,out}[bwl] are almost unused; monitor.c and xen-hvm.c could use address_space_read/write directly, since they have an integer size at hand. This leaves qtest as the only user of those functions, so we might as well inline them there.
The only interesting use of pio_addr_t thus is include/hw/sysbus.h. I guess I could move it there, but I don't see much benefit in that either.
Paolo
PATCH 49/49 hw: clean up hw/hw.h includes
In reply to Paolo BonziniInclude qom/object.h and exec/memory.h instead of exec/ioport.h; exec/ioport.h was almost everywhere required only for those two includes, not for the content of the header itself.
Remove block/aio.h, everybody is already including it through another path.
With this change, include/hw/hw.h is freed from qemu-common.h.
--- exec.c | 1 + include/exec/ioport.h | 4 ---- include/hw/hw.h | 4 ++-- include/hw/isa/isa.h | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-)
exec.c +1 -0
@@ -41,6 +41,7 @@#else /* !CONFIG_USER_ONLY */ #include "hw/hw.h" #include "exec/memory.h" +#include "exec/ioport.h" #include "sysemu/dma.h" #include "exec/address-spaces.h" #include "sysemu/xen-mapcache.h"
include/exec/ioport.h +0 -4
@@ -24,10 +24,6 @@#ifndef IOPORT_H #define IOPORT_H -#include "qemu-common.h" -#include "qom/object.h" -#include "exec/memory.h" -#define MAX_IOPORTS (64 * 1024)#define IOPORTS_MASK (MAX_IOPORTS - 1)
include/hw/hw.h +2 -2
@@ -7,9 +7,9 @@#endif #include "exec/cpu-common.h" -#include "exec/ioport.h" +#include "qom/object.h" +#include "exec/memory.h" #include "hw/irq.h" -#include "block/aio.h" #include "migration/vmstate.h" #include "qemu/module.h"
include/hw/isa/isa.h +1 -1
@@ -3,8 +3,8 @@/* ISA bus */ -#include "exec/ioport.h" #include "exec/memory.h" +#include "exec/ioport.h" #include "hw/qdev.h" #define ISA_NUM_IRQS 16
Signature · 1 line
1.8.3.1