Skip to content

Commit

Permalink
qemu-common: push cpu.h inclusion out of qemu-common.h
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
bonzini committed May 19, 2016
1 parent 35c5a52 commit 33c1187
Show file tree
Hide file tree
Showing 82 changed files with 133 additions and 36 deletions.
2 changes: 2 additions & 0 deletions arch_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/cutils.h"

#include "cpu.h"
#ifdef CONFIG_USER_ONLY
#include "qemu.h"
#else
Expand Down
1 change: 1 addition & 0 deletions hw/arm/nseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "cpu.h"
#include "qemu/cutils.h"
#include "qemu/bswap.h"
#include "sysemu/sysemu.h"
Expand Down
1 change: 1 addition & 0 deletions hw/arm/pxa2xx_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#include "qemu/osdep.h"
#include "cpu.h"
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "hw/arm/pxa.h"
Expand Down
5 changes: 5 additions & 0 deletions hw/core/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions hw/display/cg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions hw/i386/kvm/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions hw/i386/kvm/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions hw/i386/kvmvapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions hw/intc/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions hw/intc/apic_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions hw/intc/arm_gic_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
#include "hw/sysbus.h"
#include "migration/migration.h"
#include "sysemu/kvm.h"
Expand Down
1 change: 1 addition & 0 deletions hw/intc/armv7m_nvic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions hw/intc/openpic_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
#include <sys/ioctl.h>
#include "exec/address-spaces.h"
#include "hw/hw.h"
Expand Down
2 changes: 2 additions & 0 deletions hw/intc/s390_flic_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions hw/misc/mips_cpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "cpu.h"
#include "hw/sysbus.h"

#include "hw/misc/mips_cpc.h"
Expand Down
1 change: 1 addition & 0 deletions hw/misc/mips_itu.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "cpu.h"
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "sysemu/sysemu.h"
Expand Down
1 change: 1 addition & 0 deletions hw/ppc/ppc4xx_devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions hw/ppc/prep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions hw/ppc/virtex_ml507.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

#include "qemu/osdep.h"
#include "cpu.h"
#include "hw/sysbus.h"
#include "hw/hw.h"
#include "hw/char/serial.h"
Expand Down
1 change: 1 addition & 0 deletions hw/xtensa/pic_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include "qemu/osdep.h"
#include "cpu.h"
#include "hw/hw.h"
#include "qemu/log.h"
#include "qemu/timer.h"
Expand Down
2 changes: 2 additions & 0 deletions include/disas/disas.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions include/exec/gdbstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions include/exec/hwaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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'). */
Expand Down
1 change: 1 addition & 0 deletions include/hw/arm/digic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions include/hw/arm/fsl-imx6.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "hw/sd/sdhci.h"
#include "hw/ssi/imx_spi.h"
#include "exec/memory.h"
#include "cpu.h"

#define TYPE_FSL_IMX6 "fsl,imx6"
#define FSL_IMX6(obj) OBJECT_CHECK(FslIMX6State, (obj), TYPE_FSL_IMX6)
Expand Down
1 change: 1 addition & 0 deletions include/hw/arm/virt-acpi-build.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "qemu-common.h"
#include "hw/arm/virt.h"
#include "qemu/notify.h"

#define ACPI_GICC_ENABLED 1

Expand Down
1 change: 1 addition & 0 deletions include/hw/arm/virt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion include/hw/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions include/hw/sd/sd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions include/hw/xen/xen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);

Expand Down
5 changes: 0 additions & 5 deletions include/qemu-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions include/sysemu/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions ioport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions migration/ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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/cutils.h"
Expand Down
1 change: 1 addition & 0 deletions migration/savevm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/

#include "qemu/osdep.h"
#include "cpu.h"
#include "hw/boards.h"
#include "hw/hw.h"
#include "hw/qdev.h"
Expand Down
2 changes: 2 additions & 0 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions qtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions scripts/tracetool/format/tcg_helper_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"',
'',
Expand Down
1 change: 1 addition & 0 deletions target-alpha/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 33c1187

Please sign in to comment.