diff options
Diffstat (limited to 'include')
75 files changed, 524 insertions, 180 deletions
diff --git a/include/block/block.h b/include/block/block.h index 2025d7ed19..19b3ab9cb5 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -2,14 +2,12 @@ #define BLOCK_H #include "block/aio.h" +#include "qapi-types.h" #include "qemu/iov.h" -#include "qemu/option.h" #include "qemu/coroutine.h" #include "block/accounting.h" #include "block/dirty-bitmap.h" #include "block/blockjob.h" -#include "qapi/qmp/qobject.h" -#include "qapi-types.h" #include "qemu/hbitmap.h" /* block.c */ @@ -29,17 +27,6 @@ typedef struct BlockDriverInfo { */ bool unallocated_blocks_are_zero; /* - * True if the driver can optimize writing zeroes by unmapping - * sectors. This is equivalent to the BLKDISCARDZEROES ioctl in Linux - * with the difference that in qemu a discard is allowed to silently - * fail. Therefore we have to use bdrv_pwrite_zeroes with the - * BDRV_REQ_MAY_UNMAP flag for an optimized zero write with unmapping. - * After this call the driver has to guarantee that the contents read - * back as zero. It is additionally required that the block device is - * opened with BDRV_O_UNMAP flag for this to work. - */ - bool can_write_zeroes_with_unmap; - /* * True if this block driver only supports compressed writes */ bool needs_compressed_writes; diff --git a/include/block/block_int.h b/include/block/block_int.h index 99b9190627..5ea63f8fa8 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -26,12 +26,10 @@ #include "block/accounting.h" #include "block/block.h" -#include "qemu/option.h" #include "qemu/queue.h" #include "qemu/coroutine.h" #include "qemu/stats64.h" #include "qemu/timer.h" -#include "qapi-types.h" #include "qemu/hbitmap.h" #include "block/snapshot.h" #include "qemu/main-loop.h" diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index a591c27213..3da8486ab1 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -2,6 +2,7 @@ #define BLOCK_DIRTY_BITMAP_H #include "qemu-common.h" +#include "qapi-types.h" #include "qemu/hbitmap.h" BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, diff --git a/include/block/nbd.h b/include/block/nbd.h index ee74ec391a..fc50003003 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -21,8 +21,6 @@ #define NBD_H -#include "qemu-common.h" -#include "qemu/option.h" #include "io/channel-socket.h" #include "crypto/tlscreds.h" diff --git a/include/block/qapi.h b/include/block/qapi.h index 82ba4b63a0..83bdb098bd 100644 --- a/include/block/qapi.h +++ b/include/block/qapi.h @@ -25,7 +25,6 @@ #ifndef BLOCK_QAPI_H #define BLOCK_QAPI_H -#include "qapi-types.h" #include "block/block.h" #include "block/snapshot.h" diff --git a/include/block/snapshot.h b/include/block/snapshot.h index 9407799941..f73d1094af 100644 --- a/include/block/snapshot.h +++ b/include/block/snapshot.h @@ -25,8 +25,6 @@ #ifndef SNAPSHOT_H #define SNAPSHOT_H -#include "qemu-common.h" -#include "qemu/option.h" #define SNAPSHOT_OPT_BASE "snapshot." diff --git a/include/chardev/char.h b/include/chardev/char.h index d8941fcbb1..a381dc3df8 100644 --- a/include/chardev/char.h +++ b/include/chardev/char.h @@ -1,8 +1,6 @@ #ifndef QEMU_CHAR_H #define QEMU_CHAR_H -#include "qemu-common.h" -#include "qemu/option.h" #include "qemu/main-loop.h" #include "qemu/bitmap.h" #include "qom/object.h" diff --git a/include/crypto/random.h b/include/crypto/random.h index a07229ce96..8764ca0562 100644 --- a/include/crypto/random.h +++ b/include/crypto/random.h @@ -22,8 +22,6 @@ #define QCRYPTO_RANDOM_H #include "qemu-common.h" -#include "qapi/error.h" - /** * qcrypto_random_bytes: diff --git a/include/crypto/xts.h b/include/crypto/xts.h index da32ab82b6..3c8967ac6c 100644 --- a/include/crypto/xts.h +++ b/include/crypto/xts.h @@ -27,8 +27,6 @@ #define QCRYPTO_XTS_H #include "qemu-common.h" -#include "qapi/error.h" - #define XTS_BLOCK_SIZE 16 diff --git a/include/exec/tb-lookup.h b/include/exec/tb-lookup.h index 296138591a..492cb68289 100644 --- a/include/exec/tb-lookup.h +++ b/include/exec/tb-lookup.h @@ -7,8 +7,6 @@ #ifndef EXEC_TB_LOOKUP_H #define EXEC_TB_LOOKUP_H -#include "qemu/osdep.h" - #ifdef NEED_CPU_H #include "cpu.h" #else diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h index 39ff512129..c20ace0d0b 100644 --- a/include/hw/acpi/acpi.h +++ b/include/hw/acpi/acpi.h @@ -21,7 +21,6 @@ */ #include "qemu/notify.h" -#include "qemu/option.h" #include "exec/memory.h" #include "hw/irq.h" #include "hw/acpi/acpi_dev_interface.h" diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h index 3c2e4e95a5..dabf4c4fc9 100644 --- a/include/hw/acpi/acpi_dev_interface.h +++ b/include/hw/acpi/acpi_dev_interface.h @@ -2,7 +2,6 @@ #define ACPI_DEV_INTERFACE_H #include "qom/object.h" -#include "qapi-types.h" #include "hw/boards.h" /* These values are part of guest ABI, and can not be changed */ diff --git a/include/hw/block/block.h b/include/hw/block/block.h index 64b9298829..f532d10e35 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -12,6 +12,7 @@ #define HW_BLOCK_H #include "qemu-common.h" +#include "qapi-types.h" /* Configuration */ diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h index 1749dabf25..68a0c904ea 100644 --- a/include/hw/block/fdc.h +++ b/include/hw/block/fdc.h @@ -2,6 +2,7 @@ #define HW_FDC_H #include "qemu-common.h" +#include "qapi-types.h" /* fdc.c */ #define MAX_FD 2 diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index 31851b44d1..88212f59df 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -12,7 +12,6 @@ #include "sysemu/sysemu.h" #include "hw/block/block.h" #include "scsi/constants.h" -#include "qapi/error.h" /* debug IDE devices */ #define USE_DMA_CDROM diff --git a/include/hw/intc/imx_gpcv2.h b/include/hw/intc/imx_gpcv2.h new file mode 100644 index 0000000000..ed978b24bb --- /dev/null +++ b/include/hw/intc/imx_gpcv2.h @@ -0,0 +1,22 @@ +#ifndef IMX_GPCV2_H +#define IMX_GPCV2_H + +#include "hw/sysbus.h" + +enum IMXGPCv2Registers { + GPC_NUM = 0xE00 / sizeof(uint32_t), +}; + +typedef struct IMXGPCv2State { + /*< private >*/ + SysBusDevice parent_obj; + + /*< public >*/ + MemoryRegion iomem; + uint32_t regs[GPC_NUM]; +} IMXGPCv2State; + +#define TYPE_IMX_GPCV2 "imx-gpcv2" +#define IMX_GPCV2(obj) OBJECT_CHECK(IMXGPCv2State, (obj), TYPE_IMX_GPCV2) + +#endif /* IMX_GPCV2_H */ diff --git a/include/hw/intc/xlnx-pmu-iomod-intc.h b/include/hw/intc/xlnx-pmu-iomod-intc.h index 1fdba73b9f..01c9d040b8 100644 --- a/include/hw/intc/xlnx-pmu-iomod-intc.h +++ b/include/hw/intc/xlnx-pmu-iomod-intc.h @@ -25,7 +25,6 @@ #ifndef XLNX_PMU_IO_INTC_H #define XLNX_PMU_IO_INTC_H -#include "qemu/osdep.h" #include "hw/sysbus.h" #include "hw/register.h" diff --git a/include/hw/intc/xlnx-zynqmp-ipi.h b/include/hw/intc/xlnx-zynqmp-ipi.h index 4afa4ff313..866c719c6f 100644 --- a/include/hw/intc/xlnx-zynqmp-ipi.h +++ b/include/hw/intc/xlnx-zynqmp-ipi.h @@ -25,7 +25,6 @@ #ifndef XLNX_ZYNQMP_IPI_H #define XLNX_ZYNQMP_IPI_H -#include "qemu/osdep.h" #include "hw/sysbus.h" #include "hw/register.h" diff --git a/include/hw/loader-fit.h b/include/hw/loader-fit.h index 9e2a068a20..0284c3e02c 100644 --- a/include/hw/loader-fit.h +++ b/include/hw/loader-fit.h @@ -20,7 +20,7 @@ #ifndef HW_LOADER_FIT_H #define HW_LOADER_FIT_H -#include <exec/hwaddr.h> +#include "exec/hwaddr.h" struct fit_loader_match { const char *compatible; diff --git a/include/hw/loader.h b/include/hw/loader.h index 355fe0f5a2..5edbe02b1c 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -1,6 +1,5 @@ #ifndef LOADER_H #define LOADER_H -#include "qapi/qmp/qdict.h" #include "hw/nvram/fw_cfg.h" /* loader.c */ diff --git a/include/hw/misc/imx2_wdt.h b/include/hw/misc/imx2_wdt.h new file mode 100644 index 0000000000..8afc99a10e --- /dev/null +++ b/include/hw/misc/imx2_wdt.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017, Impinj, Inc. + * + * i.MX2 Watchdog IP block + * + * Author: Andrey Smirnov <andrew.smirnov@gmail.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef IMX2_WDT_H +#define IMX2_WDT_H + +#include "hw/sysbus.h" + +#define TYPE_IMX2_WDT "imx2.wdt" +#define IMX2_WDT(obj) OBJECT_CHECK(IMX2WdtState, (obj), TYPE_IMX2_WDT) + +enum IMX2WdtRegisters { + IMX2_WDT_WCR = 0x0000, + IMX2_WDT_REG_NUM = 0x0008 / sizeof(uint16_t) + 1, +}; + + +typedef struct IMX2WdtState { + /* <private> */ + SysBusDevice parent_obj; + + MemoryRegion mmio; +} IMX2WdtState; + +#endif /* IMX7_SNVS_H */ diff --git a/include/hw/misc/imx7_ccm.h b/include/hw/misc/imx7_ccm.h new file mode 100644 index 0000000000..9538f37d98 --- /dev/null +++ b/include/hw/misc/imx7_ccm.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2017, Impinj, Inc. + * + * i.MX7 CCM, PMU and ANALOG IP blocks emulation code + * + * Author: Andrey Smirnov <andrew.smirnov@gmail.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef IMX7_CCM_H +#define IMX7_CCM_H + +#include "hw/misc/imx_ccm.h" +#include "qemu/bitops.h" + +enum IMX7AnalogRegisters { + ANALOG_PLL_ARM, + ANALOG_PLL_ARM_SET, + ANALOG_PLL_ARM_CLR, + ANALOG_PLL_ARM_TOG, + ANALOG_PLL_DDR, + ANALOG_PLL_DDR_SET, + ANALOG_PLL_DDR_CLR, + ANALOG_PLL_DDR_TOG, + ANALOG_PLL_DDR_SS, + ANALOG_PLL_DDR_SS_SET, + ANALOG_PLL_DDR_SS_CLR, + ANALOG_PLL_DDR_SS_TOG, + ANALOG_PLL_DDR_NUM, + ANALOG_PLL_DDR_NUM_SET, + ANALOG_PLL_DDR_NUM_CLR, + ANALOG_PLL_DDR_NUM_TOG, + ANALOG_PLL_DDR_DENOM, + ANALOG_PLL_DDR_DENOM_SET, + ANALOG_PLL_DDR_DENOM_CLR, + ANALOG_PLL_DDR_DENOM_TOG, + ANALOG_PLL_480, + ANALOG_PLL_480_SET, + ANALOG_PLL_480_CLR, + ANALOG_PLL_480_TOG, + ANALOG_PLL_480A, + ANALOG_PLL_480A_SET, + ANALOG_PLL_480A_CLR, + ANALOG_PLL_480A_TOG, + ANALOG_PLL_480B, + ANALOG_PLL_480B_SET, + ANALOG_PLL_480B_CLR, + ANALOG_PLL_480B_TOG, + ANALOG_PLL_ENET, + ANALOG_PLL_ENET_SET, + ANALOG_PLL_ENET_CLR, + ANALOG_PLL_ENET_TOG, + ANALOG_PLL_AUDIO, + ANALOG_PLL_AUDIO_SET, + ANALOG_PLL_AUDIO_CLR, + ANALOG_PLL_AUDIO_TOG, + ANALOG_PLL_AUDIO_SS, + ANALOG_PLL_AUDIO_SS_SET, + ANALOG_PLL_AUDIO_SS_CLR, + ANALOG_PLL_AUDIO_SS_TOG, + ANALOG_PLL_AUDIO_NUM, + ANALOG_PLL_AUDIO_NUM_SET, + ANALOG_PLL_AUDIO_NUM_CLR, + ANALOG_PLL_AUDIO_NUM_TOG, + ANALOG_PLL_AUDIO_DENOM, + ANALOG_PLL_AUDIO_DENOM_SET, + ANALOG_PLL_AUDIO_DENOM_CLR, + ANALOG_PLL_AUDIO_DENOM_TOG, + ANALOG_PLL_VIDEO, + ANALOG_PLL_VIDEO_SET, + ANALOG_PLL_VIDEO_CLR, + ANALOG_PLL_VIDEO_TOG, + ANALOG_PLL_VIDEO_SS, + ANALOG_PLL_VIDEO_SS_SET, + ANALOG_PLL_VIDEO_SS_CLR, + ANALOG_PLL_VIDEO_SS_TOG, + ANALOG_PLL_VIDEO_NUM, + ANALOG_PLL_VIDEO_NUM_SET, + ANALOG_PLL_VIDEO_NUM_CLR, + ANALOG_PLL_VIDEO_NUM_TOG, + ANALOG_PLL_VIDEO_DENOM, + ANALOG_PLL_VIDEO_DENOM_SET, + ANALOG_PLL_VIDEO_DENOM_CLR, + ANALOG_PLL_VIDEO_DENOM_TOG, + ANALOG_PLL_MISC0, + ANALOG_PLL_MISC0_SET, + ANALOG_PLL_MISC0_CLR, + ANALOG_PLL_MISC0_TOG, + + ANALOG_DIGPROG = 0x800 / sizeof(uint32_t), + ANALOG_MAX, + + ANALOG_PLL_LOCK = BIT(31) +}; + +enum IMX7CCMRegisters { + CCM_MAX = 0xBE00 / sizeof(uint32_t) + 1, +}; + +enum IMX7PMURegisters { + PMU_MAX = 0x140 / sizeof(uint32_t), +}; + +#define TYPE_IMX7_CCM "imx7.ccm" +#define IMX7_CCM(obj) OBJECT_CHECK(IMX7CCMState, (obj), TYPE_IMX7_CCM) + +typedef struct IMX7CCMState { + /* <private> */ + IMXCCMState parent_obj; + + /* <public> */ + MemoryRegion iomem; + + uint32_t ccm[CCM_MAX]; +} IMX7CCMState; + + +#define TYPE_IMX7_ANALOG "imx7.analog" +#define IMX7_ANALOG(obj) OBJECT_CHECK(IMX7AnalogState, (obj), TYPE_IMX7_ANALOG) + +typedef struct IMX7AnalogState { + /* <private> */ + IMXCCMState parent_obj; + + /* <public> */ + struct { + MemoryRegion container; + MemoryRegion analog; + MemoryRegion digprog; + MemoryRegion pmu; + } mmio; + + uint32_t analog[ANALOG_MAX]; + uint32_t pmu[PMU_MAX]; +} IMX7AnalogState; + +#endif /* IMX7_CCM_H */ diff --git a/include/hw/misc/imx7_gpr.h b/include/hw/misc/imx7_gpr.h new file mode 100644 index 0000000000..e19373d274 --- /dev/null +++ b/include/hw/misc/imx7_gpr.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017, Impinj, Inc. + * + * i.MX7 GPR IP block emulation code + * + * Author: Andrey Smirnov <andrew.smirnov@gmail.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef IMX7_GPR_H +#define IMX7_GPR_H + +#include "qemu/bitops.h" +#include "hw/sysbus.h" + +#define TYPE_IMX7_GPR "imx7.gpr" +#define IMX7_GPR(obj) OBJECT_CHECK(IMX7GPRState, (obj), TYPE_IMX7_GPR) + +typedef struct IMX7GPRState { + /* <private> */ + SysBusDevice parent_obj; + + MemoryRegion mmio; +} IMX7GPRState; + +#endif /* IMX7_GPR_H */ diff --git a/include/hw/misc/imx7_snvs.h b/include/hw/misc/imx7_snvs.h new file mode 100644 index 0000000000..255f8f26f9 --- /dev/null +++ b/include/hw/misc/imx7_snvs.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2017, Impinj, Inc. + * + * i.MX7 SNVS block emulation code + * + * Author: Andrey Smirnov <andrew.smirnov@gmail.com> + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef IMX7_SNVS_H +#define IMX7_SNVS_H + +#include "qemu/bitops.h" +#include "hw/sysbus.h" + + +enum IMX7SNVSRegisters { + SNVS_LPCR = 0x38, + SNVS_LPCR_TOP = BIT(6), + SNVS_LPCR_DP_EN = BIT(5) +}; + +#define TYPE_IMX7_SNVS "imx7.snvs" +#define IMX7_SNVS(obj) OBJECT_CHECK(IMX7SNVSState, (obj), TYPE_IMX7_SNVS) + +typedef struct IMX7SNVSState { + /* <private> */ + SysBusDevice parent_obj; + + MemoryRegion mmio; +} IMX7SNVSState; + +#endif /* IMX7_SNVS_H */ diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h new file mode 100644 index 0000000000..a53c161b00 --- /dev/null +++ b/include/hw/misc/mos6522.h @@ -0,0 +1,152 @@ +/* + * QEMU MOS6522 VIA emulation + * + * Copyright (c) 2004-2007 Fabrice Bellard + * Copyright (c) 2007 Jocelyn Mayer + * Copyright (c) 2018 Mark Cave-Ayland + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MOS6522_H +#define MOS6522_H + +#include "exec/memory.h" +#include "hw/sysbus.h" +#include "hw/ide/internal.h" +#include "hw/input/adb.h" + +/* Bits in ACR */ +#define SR_CTRL 0x1c /* Shift register control bits */ +#define SR_EXT 0x0c /* Shift on external clock */ +#define SR_OUT 0x10 /* Shift out if 1 */ + +/* Bits in IFR and IER */ +#define IER_SET 0x80 /* set bits in IER */ +#define IER_CLR 0 /* clear bits in IER */ + +#define CA2_INT 0x01 +#define CA1_INT 0x02 +#define SR_INT 0x04 /* Shift register full/empty */ +#define CB2_INT 0x08 +#define CB1_INT 0x10 +#define T2_INT 0x20 /* Timer 2 interrupt */ +#define T1_INT 0x40 /* Timer 1 interrupt */ + +/* Bits in ACR */ +#define T1MODE 0xc0 /* Timer 1 mode */ +#define T1MODE_CONT 0x40 /* continuous interrupts */ + +/* VIA registers */ +#define VIA_REG_B 0x00 +#define VIA_REG_A 0x01 +#define VIA_REG_DIRB 0x02 +#define VIA_REG_DIRA 0x03 +#define VIA_REG_T1CL 0x04 +#define VIA_REG_T1CH 0x05 +#define VIA_REG_T1LL 0x06 +#define VIA_REG_T1LH 0x07 +#define VIA_REG_T2CL 0x08 +#define VIA_REG_T2CH 0x09 +#define VIA_REG_SR 0x0a +#define VIA_REG_ACR 0x0b +#define VIA_REG_PCR 0x0c +#define VIA_REG_IFR 0x0d +#define VIA_REG_IER 0x0e +#define VIA_REG_ANH 0x0f + +/** + * MOS6522Timer: + * @counter_value: counter value at load time + */ +typedef struct MOS6522Timer { + int index; + uint16_t latch; + uint16_t counter_value; + int64_t load_time; + int64_t next_irq_time; + uint64_t frequency; + QEMUTimer *timer; +} MOS6522Timer; + +/** + * MOS6522State: + * @b: B-side data + * @a: A-side data + * @dirb: B-side direction (1=output) + * @dira: A-side direction (1=output) + * @sr: Shift register + * @acr: Auxiliary control register + * @pcr: Peripheral control register + * @ifr: Interrupt flag register + * @ier: Interrupt enable register + * @anh: A-side data, no handshake + * @last_b: last value of B register + * @last_acr: last value of ACR register + */ +typedef struct MOS6522State { + /*< private >*/ + SysBusDevice parent_obj; + /*< public >*/ + + MemoryRegion mem; + /* VIA registers */ + uint8_t b; + uint8_t a; + uint8_t dirb; + uint8_t dira; + uint8_t sr; + uint8_t acr; + uint8_t pcr; + uint8_t ifr; + uint8_t ier; + uint8_t anh; + + MOS6522Timer timers[2]; + uint64_t frequency; + + qemu_irq irq; +} MOS6522State; + +#define TYPE_MOS6522 "mos6522" +#define MOS6522(obj) OBJECT_CHECK(MOS6522State, (obj), TYPE_MOS6522) + +typedef struct MOS6522DeviceClass { + DeviceClass parent_class; + + DeviceRealize parent_realize; + void (*set_sr_int)(MOS6522State *dev); + void (*portB_write)(MOS6522State *dev); + void (*portA_write)(MOS6522State *dev); + /* These are used to influence the CUDA MacOS timebase calibration */ + uint64_t (*get_timer1_counter_value)(MOS6522State *dev, MOS6522Timer *ti); + uint64_t (*get_timer2_counter_value)(MOS6522State *dev, MOS6522Timer *ti); + uint64_t (*get_timer1_load_time)(MOS6522State *dev, MOS6522Timer *ti); + uint64_t (*get_timer2_load_time)(MOS6522State *dev, MOS6522Timer *ti); +} MOS6522DeviceClass; + +#define MOS6522_DEVICE_CLASS(cls) \ + OBJECT_CLASS_CHECK(MOS6522DeviceClass, (cls), TYPE_MOS6522) +#define MOS6522_DEVICE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(MOS6522DeviceClass, (obj), TYPE_MOS6522) + +uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size); +void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size); + +#endif /* MOS6522_H */ diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index 7ccbae5fba..b2259cc4a3 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -1,7 +1,6 @@ #ifndef FW_CFG_H #define FW_CFG_H -#include "qemu/typedefs.h" #include "exec/hwaddr.h" #include "hw/nvram/fw_cfg_keys.h" #include "hw/sysbus.h" diff --git a/include/hw/pci-bridge/simba.h b/include/hw/pci-bridge/simba.h index fac56ab1cf..e13ba27d0b 100644 --- a/include/hw/pci-bridge/simba.h +++ b/include/hw/pci-bridge/simba.h @@ -24,7 +24,6 @@ * THE SOFTWARE. */ -#include "qemu/osdep.h" #include "hw/pci/pci_bridge.h" diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 18c0251b40..fc9d617a76 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -2,7 +2,6 @@ #define QDEV_CORE_H #include "qemu/queue.h" -#include "qemu/option.h" #include "qemu/bitmap.h" #include "qom/object.h" #include "hw/irq.h" diff --git a/include/hw/registerfields.h b/include/hw/registerfields.h index 44e0b94edf..2659a58737 100644 --- a/include/hw/registerfields.h +++ b/include/hw/registerfields.h @@ -11,7 +11,7 @@ #ifndef REGISTERFIELDS_H #define REGISTERFIELDS_H -#include <qemu/bitops.h> +#include "qemu/bitops.h" /* Define constants for a 32 bit register */ diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index 7aab6ef7f0..4687ecfe83 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -16,6 +16,7 @@ #include "hw/sysbus.h" #include "hw/s390x/adapter.h" #include "hw/virtio/virtio.h" +#include "qemu/queue.h" /* * Reserve enough gsis to accommodate all virtio devices. @@ -66,6 +67,11 @@ typedef struct S390FLICStateClass { int (*modify_ais_mode)(S390FLICState *fs, uint8_t isc, uint16_t mode); int (*inject_airq)(S390FLICState *fs, uint8_t type, uint8_t isc, uint8_t flags); + void (*inject_service)(S390FLICState *fs, uint32_t parm); + void (*inject_io)(S390FLICState *fs, uint16_t subchannel_id, + uint16_t subchannel_nr, uint32_t io_int_parm, + uint32_t io_int_word); + void (*inject_crw_mchk)(S390FLICState *fs); } S390FLICStateClass; #define TYPE_KVM_S390_FLIC "s390-flic-kvm" @@ -80,24 +86,57 @@ typedef struct S390FLICStateClass { #define SIC_IRQ_MODE_SINGLE 1 #define AIS_MODE_MASK(isc) (0x80 >> isc) +#define ISC_TO_PENDING_IO(_isc) (0x80 >> (_isc)) +#define CR6_TO_PENDING_IO(_cr6) (((_cr6) >> 24) & 0xff) + +/* organize the ISC bits so that the macros above work */ +#define FLIC_PENDING_IO_ISC7 (1 << 0) +#define FLIC_PENDING_IO_ISC6 (1 << 1) +#define FLIC_PENDING_IO_ISC5 (1 << 2) +#define FLIC_PENDING_IO_ISC4 (1 << 3) +#define FLIC_PENDING_IO_ISC3 (1 << 4) +#define FLIC_PENDING_IO_ISC2 (1 << 5) +#define FLIC_PENDING_IO_ISC1 (1 << 6) +#define FLIC_PENDING_IO_ISC0 (1 << 7) +#define FLIC_PENDING_SERVICE (1 << 8) +#define FLIC_PENDING_MCHK_CR (1 << 9) + +#define FLIC_PENDING_IO (FLIC_PENDING_IO_ISC0 | FLIC_PENDING_IO_ISC1 | \ + FLIC_PENDING_IO_ISC2 | FLIC_PENDING_IO_ISC3 | \ + FLIC_PENDING_IO_ISC4 | FLIC_PENDING_IO_ISC5 | \ + FLIC_PENDING_IO_ISC6 | FLIC_PENDING_IO_ISC7) + +typedef struct QEMUS390FlicIO { + uint16_t id; + uint16_t nr; + uint32_t parm; + uint32_t word; + QLIST_ENTRY(QEMUS390FlicIO) next; +} QEMUS390FlicIO; + typedef struct QEMUS390FLICState { S390FLICState parent_obj; + uint32_t pending; + uint32_t service_param; uint8_t simm; uint8_t nimm; + QLIST_HEAD(, QEMUS390FlicIO) io[8]; } QEMUS390FLICState; +uint32_t qemu_s390_flic_dequeue_service(QEMUS390FLICState *flic); +QEMUS390FlicIO *qemu_s390_flic_dequeue_io(QEMUS390FLICState *flic, + uint64_t cr6); +void qemu_s390_flic_dequeue_crw_mchk(QEMUS390FLICState *flic); +bool qemu_s390_flic_has_service(QEMUS390FLICState *flic); +bool qemu_s390_flic_has_io(QEMUS390FLICState *fs, uint64_t cr6); +bool qemu_s390_flic_has_crw_mchk(QEMUS390FLICState *flic); +bool qemu_s390_flic_has_any(QEMUS390FLICState *flic); + void s390_flic_init(void); S390FLICState *s390_get_flic(void); +QEMUS390FLICState *s390_get_qemu_flic(S390FLICState *fs); +S390FLICStateClass *s390_get_flic_class(S390FLICState *fs); bool ais_needed(void *opaque); -#ifdef CONFIG_KVM -DeviceState *s390_flic_kvm_create(void); -#else -static inline DeviceState *s390_flic_kvm_create(void) -{ - return NULL; -} -#endif - #endif /* HW_S390_FLIC_H */ diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/storage-attributes.h index 9be954d163..d6403a0a7e 100644 --- a/include/hw/s390x/storage-attributes.h +++ b/include/hw/s390x/storage-attributes.h @@ -12,7 +12,7 @@ #ifndef S390_STORAGE_ATTRIBUTES_H #define S390_STORAGE_ATTRIBUTES_H -#include <hw/qdev.h> +#include "hw/qdev.h" #include "monitor/monitor.h" #define TYPE_S390_STATTRIB "s390-storage_attributes" diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h index 1cf70f8c23..f8d1ba3538 100644 --- a/include/hw/sd/sdhci.h +++ b/include/hw/sd/sdhci.h @@ -44,6 +44,7 @@ typedef struct SDHCIState { AddressSpace sysbus_dma_as; AddressSpace *dma_as; MemoryRegion *dma_mr; + const MemoryRegionOps *io_ops; QEMUTimer *insert_timer; /* timer for 'changing' sd card. */ QEMUTimer *transfer_timer; @@ -91,8 +92,18 @@ typedef struct SDHCIState { /* Configurable properties */ bool pending_insert_quirk; /* Quirk for Raspberry Pi card insert int */ + uint32_t quirks; } SDHCIState; +/* + * Controller does not provide transfer-complete interrupt when not + * busy. + * + * NOTE: This definition is taken out of Linux kernel and so the + * original bit number is preserved + */ +#define SDHCI_QUIRK_NO_BUSY_IRQ BIT(14) + #define TYPE_PCI_SDHCI "sdhci-pci" #define PCI_SDHCI(obj) OBJECT_CHECK(SDHCIState, (obj), TYPE_PCI_SDHCI) @@ -100,4 +111,6 @@ typedef struct SDHCIState { #define SYSBUS_SDHCI(obj) \ OBJECT_CHECK(SDHCIState, (obj), TYPE_SYSBUS_SDHCI) +#define TYPE_IMX_USDHC "imx-usdhc" + #endif /* SDHCI_H */ diff --git a/include/hw/smbios/smbios.h b/include/hw/smbios/smbios.h index a83adb93d7..eeb5a4d7b6 100644 --- a/include/hw/smbios/smbios.h +++ b/include/hw/smbios/smbios.h @@ -14,7 +14,6 @@ * */ -#include "qemu/option.h" #define SMBIOS_MAX_TYPE 127 diff --git a/include/hw/timer/imx_gpt.h b/include/hw/timer/imx_gpt.h index eac59b2a70..20ccb327c4 100644 --- a/include/hw/timer/imx_gpt.h +++ b/include/hw/timer/imx_gpt.h @@ -77,6 +77,7 @@ #define TYPE_IMX25_GPT "imx25.gpt" #define TYPE_IMX31_GPT "imx31.gpt" #define TYPE_IMX6_GPT "imx6.gpt" +#define TYPE_IMX7_GPT "imx7.gpt" #define TYPE_IMX_GPT TYPE_IMX25_GPT diff --git a/include/hw/usb/chipidea.h b/include/hw/usb/chipidea.h new file mode 100644 index 0000000000..1ec2e9dbda --- /dev/null +++ b/include/hw/usb/chipidea.h @@ -0,0 +1,16 @@ +#ifndef CHIPIDEA_H +#define CHIPIDEA_H + +#include "hw/usb/hcd-ehci.h" + +typedef struct ChipideaState { + /*< private >*/ + EHCISysBusState parent_obj; + + MemoryRegion iomem[3]; +} ChipideaState; + +#define TYPE_CHIPIDEA "usb-chipidea" +#define CHIPIDEA(obj) OBJECT_CHECK(ChipideaState, (obj), TYPE_CHIPIDEA) + +#endif /* CHIPIDEA_H */ diff --git a/include/hw/xtensa/xtensa-isa.h b/include/hw/xtensa/xtensa-isa.h index 353f82ba25..bd68ada640 100644 --- a/include/hw/xtensa/xtensa-isa.h +++ b/include/hw/xtensa/xtensa-isa.h @@ -25,8 +25,6 @@ #ifndef XTENSA_LIBISA_H #define XTENSA_LIBISA_H -#include <stdint.h> - #ifdef __cplusplus extern "C" { #endif diff --git a/include/migration/colo.h b/include/migration/colo.h index ff9874ea16..50ace16205 100644 --- a/include/migration/colo.h +++ b/include/migration/colo.h @@ -14,6 +14,7 @@ #define QEMU_COLO_H #include "qemu-common.h" +#include "qapi-types.h" void colo_info_init(void); diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 83ea4a1aaf..ad64ad8e68 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -2,7 +2,6 @@ #define MONITOR_H #include "qemu-common.h" -#include "qapi/qmp/qdict.h" #include "block/block.h" #include "qemu/readline.h" diff --git a/include/net/net.h b/include/net/net.h index 4afac1a9dd..3fc48e4f51 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -2,12 +2,9 @@ #define QEMU_NET_H #include "qemu/queue.h" -#include "qemu-common.h" -#include "qapi/qmp/qdict.h" -#include "qemu/option.h" +#include "qapi-types.h" #include "net/queue.h" #include "migration/vmstate.h" -#include "qapi-types.h" #define MAC_FMT "%02X:%02X:%02X:%02X:%02X:%02X" #define MAC_ARG(x) ((uint8_t *)(x))[0], ((uint8_t *)(x))[1], \ diff --git a/include/net/slirp.h b/include/net/slirp.h index 0c98e463db..4d63d74da4 100644 --- a/include/net/slirp.h +++ b/include/net/slirp.h @@ -24,10 +24,6 @@ #ifndef QEMU_NET_SLIRP_H #define QEMU_NET_SLIRP_H -#include "qemu-common.h" -#include "qapi/qmp/qdict.h" -#include "qemu/option.h" -#include "qapi-types.h" #ifdef CONFIG_SLIRP diff --git a/include/net/tap.h b/include/net/tap.h index 5da4edc692..ce6f8418ac 100644 --- a/include/net/tap.h +++ b/include/net/tap.h @@ -27,7 +27,6 @@ #define QEMU_NET_TAP_H #include "qemu-common.h" -#include "qapi-types.h" #include "standard-headers/linux/virtio_net.h" int tap_enable(NetClientState *nc); diff --git a/include/qapi/clone-visitor.h b/include/qapi/clone-visitor.h index a4915c7d57..b119d3daa9 100644 --- a/include/qapi/clone-visitor.h +++ b/include/qapi/clone-visitor.h @@ -11,7 +11,6 @@ #ifndef QAPI_CLONE_VISITOR_H #define QAPI_CLONE_VISITOR_H -#include "qemu/typedefs.h" #include "qapi/visitor.h" #include "qapi-visit.h" diff --git a/include/qapi/opts-visitor.h b/include/qapi/opts-visitor.h index 6462c96c29..9b989e7e08 100644 --- a/include/qapi/opts-visitor.h +++ b/include/qapi/opts-visitor.h @@ -14,7 +14,6 @@ #define OPTS_VISITOR_H #include "qapi/visitor.h" -#include "qemu/option.h" /* Inclusive upper bound on the size of any flattened range. This is a safety * (= anti-annoyance) measure; wrong ranges should not cause long startup diff --git a/include/qapi/qmp-event.h b/include/qapi/qmp-event.h index 40fe3cbc12..0c87ad833e 100644 --- a/include/qapi/qmp-event.h +++ b/include/qapi/qmp-event.h @@ -14,7 +14,6 @@ #ifndef QMP_EVENT_H #define QMP_EVENT_H -#include "qapi/qmp/qdict.h" typedef void (*QMPEventFuncEmit)(unsigned event, QDict *dict, Error **errp); diff --git a/include/qapi/qmp/dispatch.h b/include/qapi/qmp/dispatch.h index 20578dcd48..1e694b5ecf 100644 --- a/include/qapi/qmp/dispatch.h +++ b/include/qapi/qmp/dispatch.h @@ -14,8 +14,7 @@ #ifndef QAPI_QMP_DISPATCH_H #define QAPI_QMP_DISPATCH_H -#include "qapi/qmp/qobject.h" -#include "qapi/qmp/qdict.h" +#include "qemu/queue.h" typedef void (QmpCommandFunc)(QDict *, QObject **, Error **); diff --git a/include/qapi/qmp/json-parser.h b/include/qapi/qmp/json-parser.h index 9987f8ca85..102f5c0068 100644 --- a/include/qapi/qmp/json-parser.h +++ b/include/qapi/qmp/json-parser.h @@ -15,7 +15,6 @@ #define QEMU_JSON_PARSER_H #include "qemu-common.h" -#include "qapi/qmp/qlist.h" QObject *json_parser_parse(GQueue *tokens, va_list *ap); QObject *json_parser_parse_err(GQueue *tokens, va_list *ap, Error **errp); diff --git a/include/qapi/qmp/qbool.h b/include/qapi/qmp/qbool.h index f77ea86c4e..629c508d34 100644 --- a/include/qapi/qmp/qbool.h +++ b/include/qapi/qmp/qbool.h @@ -16,10 +16,10 @@ #include "qapi/qmp/qobject.h" -typedef struct QBool { +struct QBool { QObject base; bool value; -} QBool; +}; QBool *qbool_from_bool(bool value); bool qbool_get_bool(const QBool *qb); diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index fc218e7be6..ff6f7842c3 100644 --- a/include/qapi/qmp/qdict.h +++ b/include/qapi/qmp/qdict.h @@ -14,9 +14,6 @@ #define QDICT_H #include "qapi/qmp/qobject.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qnull.h" -#include "qapi/qmp/qnum.h" #include "qemu/queue.h" #define QDICT_BUCKET_MAX 512 @@ -27,11 +24,11 @@ typedef struct QDictEntry { QLIST_ENTRY(QDictEntry) next; } QDictEntry; -typedef struct QDict { +struct QDict { QObject base; size_t size; QLIST_HEAD(,QDictEntry) table[QDICT_BUCKET_MAX]; -} QDict; +}; /* Object API */ QDict *qdict_new(void); @@ -55,17 +52,11 @@ void qdict_destroy_obj(QObject *obj); #define qdict_put(qdict, key, obj) \ qdict_put_obj(qdict, key, QOBJECT(obj)) -/* Helpers for int, bool, null, and string */ -#define qdict_put_int(qdict, key, value) \ - qdict_put(qdict, key, qnum_from_int(value)) -#define qdict_put_bool(qdict, key, value) \ - qdict_put(qdict, key, qbool_from_bool(value)) -#define qdict_put_str(qdict, key, value) \ - qdict_put(qdict, key, qstring_from_str(value)) -#define qdict_put_null(qdict, key) \ - qdict_put(qdict, key, qnull()) +void qdict_put_bool(QDict *qdict, const char *key, bool value); +void qdict_put_int(QDict *qdict, const char *key, int64_t value); +void qdict_put_null(QDict *qdict, const char *key); +void qdict_put_str(QDict *qdict, const char *key, const char *value); -/* High level helpers */ double qdict_get_double(const QDict *qdict, const char *key); int64_t qdict_get_int(const QDict *qdict, const char *key); bool qdict_get_bool(const QDict *qdict, const char *key); diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 6e84082d5f..b274ac3a86 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -14,9 +14,6 @@ #ifndef QJSON_H #define QJSON_H -#include "qapi/qmp/qobject.h" -#include "qapi/qmp/qstring.h" - QObject *qobject_from_json(const char *string, Error **errp); QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2); QObject *qobject_from_jsonv(const char *string, va_list *ap, Error **errp) diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h index ec3fcc1a4c..5fd976a398 100644 --- a/include/qapi/qmp/qlist.h +++ b/include/qapi/qmp/qlist.h @@ -14,8 +14,6 @@ #define QLIST_H #include "qapi/qmp/qobject.h" -#include "qapi/qmp/qnum.h" -#include "qapi/qmp/qnull.h" #include "qemu/queue.h" typedef struct QListEntry { @@ -23,23 +21,18 @@ typedef struct QListEntry { QTAILQ_ENTRY(QListEntry) next; } QListEntry; -typedef struct QList { +struct QList { QObject base; QTAILQ_HEAD(,QListEntry) head; -} QList; +}; #define qlist_append(qlist, obj) \ qlist_append_obj(qlist, QOBJECT(obj)) -/* Helpers for int, bool, and string */ -#define qlist_append_int(qlist, value) \ - qlist_append(qlist, qnum_from_int(value)) -#define qlist_append_bool(qlist, value) \ - qlist_append(qlist, qbool_from_bool(value)) -#define qlist_append_str(qlist, value) \ - qlist_append(qlist, qstring_from_str(value)) -#define qlist_append_null(qlist) \ - qlist_append(qlist, qnull()) +void qlist_append_bool(QList *qlist, bool value); +void qlist_append_int(QList *qlist, int64_t value); +void qlist_append_null(QList *qlist); +void qlist_append_str(QList *qlist, const char *value); #define QLIST_FOREACH_ENTRY(qlist, var) \ for ((var) = ((qlist)->head.tqh_first); \ diff --git a/include/qapi/qmp/qlit.h b/include/qapi/qmp/qlit.h index b18406bce9..56f9d97bd9 100644 --- a/include/qapi/qmp/qlit.h +++ b/include/qapi/qmp/qlit.h @@ -14,7 +14,6 @@ #ifndef QLIT_H #define QLIT_H -#include "qapi-types.h" #include "qobject.h" typedef struct QLitDictEntry QLitDictEntry; diff --git a/include/qapi/qmp/qnum.h b/include/qapi/qmp/qnum.h index c3d86794bb..15e3971c7f 100644 --- a/include/qapi/qmp/qnum.h +++ b/include/qapi/qmp/qnum.h @@ -44,7 +44,7 @@ typedef enum { * in range: qnum_get_try_int() / qnum_get_try_uint() check range and * convert under the hood. */ -typedef struct QNum { +struct QNum { QObject base; QNumKind kind; union { @@ -52,7 +52,7 @@ typedef struct QNum { uint64_t u64; double dbl; } u; -} QNum; +}; QNum *qnum_from_int(int64_t value); QNum *qnum_from_uint(uint64_t value); diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h index 65c05a9be5..98070ef3d6 100644 --- a/include/qapi/qmp/qstring.h +++ b/include/qapi/qmp/qstring.h @@ -15,12 +15,12 @@ #include "qapi/qmp/qobject.h" -typedef struct QString { +struct QString { QObject base; char *string; size_t length; size_t capacity; -} QString; +}; QString *qstring_new(void); QString *qstring_from_str(const char *str); diff --git a/include/qapi/qmp/types.h b/include/qapi/qmp/types.h deleted file mode 100644 index 749ac44dcb..0000000000 --- a/include/qapi/qmp/types.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Include all QEMU objects. - * - * Copyright (C) 2009 Red Hat Inc. - * - * Authors: - * Luiz Capitulino <lcapitulino@redhat.com> - * - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. - * See the COPYING.LIB file in the top-level directory. - */ - -#ifndef QAPI_QMP_TYPES_H -#define QAPI_QMP_TYPES_H - -#include "qapi/qmp/qobject.h" -#include "qapi/qmp/qnum.h" -#include "qapi/qmp/qbool.h" -#include "qapi/qmp/qstring.h" -#include "qapi/qmp/qdict.h" -#include "qapi/qmp/qlist.h" -#include "qapi/qmp/qnull.h" - -#endif /* QAPI_QMP_TYPES_H */ diff --git a/include/qapi/qobject-input-visitor.h b/include/qapi/qobject-input-visitor.h index daee18c6ac..95985e25e5 100644 --- a/include/qapi/qobject-input-visitor.h +++ b/include/qapi/qobject-input-visitor.h @@ -16,7 +16,6 @@ #define QOBJECT_INPUT_VISITOR_H #include "qapi/visitor.h" -#include "qapi/qmp/qobject.h" typedef struct QObjectInputVisitor QObjectInputVisitor; diff --git a/include/qapi/qobject-output-visitor.h b/include/qapi/qobject-output-visitor.h index e5a3490812..2b1726baf5 100644 --- a/include/qapi/qobject-output-visitor.h +++ b/include/qapi/qobject-output-visitor.h @@ -15,7 +15,6 @@ #define QOBJECT_OUTPUT_VISITOR_H #include "qapi/visitor.h" -#include "qapi/qmp/qobject.h" typedef struct QObjectOutputVisitor QObjectOutputVisitor; diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h index 62a51a54cb..ecff296c11 100644 --- a/include/qapi/visitor.h +++ b/include/qapi/visitor.h @@ -15,7 +15,7 @@ #ifndef QAPI_VISITOR_H #define QAPI_VISITOR_H -#include "qapi/qmp/qobject.h" +#include "qapi-types.h" /* * The QAPI schema defines both a set of C data types, and a QMP wire diff --git a/include/qemu-common.h b/include/qemu-common.h index 05319b9ddc..8a4f63c9de 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -16,8 +16,6 @@ #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) -#include "qemu/option.h" - /* Copyright string for -version arguments, About dialogs, etc */ #define QEMU_COPYRIGHT "Copyright (c) 2003-2017 " \ "Fabrice Bellard and the QEMU Project developers" diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h index c80d5c8a33..d74f920152 100644 --- a/include/qemu/config-file.h +++ b/include/qemu/config-file.h @@ -1,8 +1,6 @@ #ifndef QEMU_CONFIG_FILE_H #define QEMU_CONFIG_FILE_H -#include "qemu/option.h" -#include "qapi/qmp/qdict.h" QemuOptsList *qemu_find_opts(const char *group); QemuOptsList *qemu_find_opts_err(const char *group, Error **errp); diff --git a/include/qemu/option.h b/include/qemu/option.h index a88c5f02b1..b127fb6db6 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -27,7 +27,6 @@ #define QEMU_OPTION_H #include "qemu/queue.h" -#include "qapi/qmp/qdict.h" const char *get_opt_name(char *buf, int buf_size, const char *p, char delim); const char *get_opt_value(char *buf, int buf_size, const char *p); diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h index 8c93237866..03d45f44f8 100644 --- a/include/qemu/throttle.h +++ b/include/qemu/throttle.h @@ -26,6 +26,7 @@ #define THROTTLE_H #include "qemu-common.h" +#include "qapi-types.h" #include "qemu/timer.h" #define THROTTLE_VALUE_MAX 1000000000000000LL diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 5923849cdd..a46b0b347b 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -96,8 +96,13 @@ typedef struct QemuSpin QemuSpin; typedef struct QEMUSGList QEMUSGList; typedef struct QEMUTimer QEMUTimer; typedef struct QEMUTimerListGroup QEMUTimerListGroup; -typedef struct QObject QObject; +typedef struct QBool QBool; +typedef struct QDict QDict; +typedef struct QList QList; typedef struct QNull QNull; +typedef struct QNum QNum; +typedef struct QObject QObject; +typedef struct QString QString; typedef struct RAMBlock RAMBlock; typedef struct Range Range; typedef struct SerialState SerialState; diff --git a/include/qom/object_interfaces.h b/include/qom/object_interfaces.h index d23e11bc53..4d513fb329 100644 --- a/include/qom/object_interfaces.h +++ b/include/qom/object_interfaces.h @@ -2,7 +2,6 @@ #define OBJECT_INTERFACES_H #include "qom/object.h" -#include "qapi/qmp/qdict.h" #include "qapi/visitor.h" #define TYPE_USER_CREATABLE "user-creatable" diff --git a/include/scsi/pr-manager.h b/include/scsi/pr-manager.h index b2b37d63bc..5d2f13a5e4 100644 --- a/include/scsi/pr-manager.h +++ b/include/scsi/pr-manager.h @@ -2,7 +2,6 @@ #define PR_MANAGER_H #include "qom/object.h" -#include "qapi/qmp/qdict.h" #include "qapi/visitor.h" #include "qom/object_interfaces.h" #include "block/aio.h" diff --git a/include/sysemu/arch_init.h b/include/sysemu/arch_init.h index f999bfd3be..d40d882e38 100644 --- a/include/sysemu/arch_init.h +++ b/include/sysemu/arch_init.h @@ -1,8 +1,7 @@ #ifndef QEMU_ARCH_INIT_H #define QEMU_ARCH_INIT_H -#include "qmp-commands.h" -#include "qemu/option.h" +#include "qapi-types.h" enum { QEMU_ARCH_ALL = -1, diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index df43bd0e07..c14bcfe8c6 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -38,7 +38,6 @@ #include "sysemu/dump-arch.h" #include "sysemu/memory_mapping.h" -#include "qapi-types.h" typedef struct QEMU_PACKED MakedumpfileHeader { char signature[16]; /* = "makedumpfile" */ diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h index ed6a437f4d..621a3f9d42 100644 --- a/include/sysemu/hostmem.h +++ b/include/sysemu/hostmem.h @@ -16,7 +16,6 @@ #include "sysemu/sysemu.h" /* for MAX_NODES */ #include "qom/object.h" #include "exec/memory.h" -#include "qemu/option.h" #include "qemu/bitmap.h" #define TYPE_MEMORY_BACKEND "memory-backend" diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index e4e43f6468..241118845c 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -12,8 +12,6 @@ #ifndef _HVF_H #define _HVF_H -#include "config-host.h" -#include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/bitops.h" #include "exec/memory.h" diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h index b3545215f6..d99e5474b4 100644 --- a/include/sysemu/numa.h +++ b/include/sysemu/numa.h @@ -2,7 +2,6 @@ #define SYSEMU_NUMA_H #include "qemu/bitmap.h" -#include "qemu/option.h" #include "sysemu/sysemu.h" #include "sysemu/hostmem.h" #include "hw/boards.h" diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h index fa14d0ec0b..dc8ae7b6b1 100644 --- a/include/sysemu/replay.h +++ b/include/sysemu/replay.h @@ -12,7 +12,6 @@ * */ -#include "qapi-types.h" #include "sysemu.h" /* replay clock kinds */ diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 1c925309e3..77bb3da582 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -2,10 +2,8 @@ #define SYSEMU_H /* Misc. things related to the system emulator. */ -#include "qemu/option.h" #include "qemu/queue.h" #include "qemu/timer.h" -#include "qapi-types.h" #include "qemu/notify.h" #include "qemu/main-loop.h" #include "qemu/bitmap.h" diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 233b1a3fc3..32b753d4f3 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -13,7 +13,6 @@ #define QEMU_TPM_H #include "qom/object.h" -#include "qapi-types.h" int tpm_config_parse(QemuOptsList *opts_list, const char *optarg); int tpm_init(void); diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index 7e166ef954..14488820f6 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -15,7 +15,6 @@ #include "qom/object.h" #include "qemu-common.h" -#include "qapi-types.h" #include "qemu/option.h" #include "sysemu/tpm.h" #include "qapi/error.h" diff --git a/include/ui/console.h b/include/ui/console.h index 7b35778444..12fef80923 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -3,12 +3,8 @@ #include "ui/qemu-pixman.h" #include "qom/object.h" -#include "qapi/qmp/qdict.h" #include "qemu/notify.h" -#include "qemu/typedefs.h" -#include "qapi-types.h" #include "qemu/error-report.h" -#include "qapi/error.h" #ifdef CONFIG_OPENGL # include <epoxy/gl.h> @@ -468,31 +464,10 @@ static inline void cocoa_display_init(DisplayState *ds, int full_screen) void vnc_display_init(const char *id); void vnc_display_open(const char *id, Error **errp); void vnc_display_add_client(const char *id, int csock, bool skipauth); -#ifdef CONFIG_VNC int vnc_display_password(const char *id, const char *password); int vnc_display_pw_expire(const char *id, time_t expires); QemuOpts *vnc_parse(const char *str, Error **errp); int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp); -#else -static inline int vnc_display_password(const char *id, const char *password) -{ - return -ENODEV; -} -static inline int vnc_display_pw_expire(const char *id, time_t expires) -{ - return -ENODEV; -}; -static inline QemuOpts *vnc_parse(const char *str, Error **errp) -{ - error_setg(errp, "VNC support is disabled"); - return NULL; -} -static inline int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp) -{ - error_setg(errp, "VNC support is disabled"); - return -1; -} -#endif /* curses.c */ #ifdef CONFIG_CURSES diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index 52a9f8808b..c6d50eb87a 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -23,7 +23,6 @@ #ifdef CONFIG_SPICE #include <spice.h> -#include "qemu/option.h" #include "qemu/config-file.h" extern int using_spice; |