diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/block/nbd.h | 31 | ||||
-rw-r--r-- | include/hw/acpi/acpi-defs.h | 15 | ||||
-rw-r--r-- | include/hw/acpi/tpm.h | 21 | ||||
-rw-r--r-- | include/hw/arm/pxa.h | 1 | ||||
-rw-r--r-- | include/hw/char/serial.h | 4 | ||||
-rw-r--r-- | include/hw/devices.h | 1 | ||||
-rw-r--r-- | include/hw/i2c/smbus.h | 2 | ||||
-rw-r--r-- | include/hw/i386/pc.h | 4 | ||||
-rw-r--r-- | include/hw/ide/ahci.h | 4 | ||||
-rw-r--r-- | include/hw/input/ps2.h | 2 | ||||
-rw-r--r-- | include/hw/misc/mips_itu.h | 8 | ||||
-rw-r--r-- | include/hw/pci/pcie.h | 2 | ||||
-rw-r--r-- | include/hw/pcmcia.h | 4 | ||||
-rw-r--r-- | include/hw/ppc/spapr.h | 5 | ||||
-rw-r--r-- | include/hw/ppc/spapr_xive.h | 2 | ||||
-rw-r--r-- | include/hw/ppc/xics.h | 7 | ||||
-rw-r--r-- | include/hw/ppc/xics_spapr.h | 37 | ||||
-rw-r--r-- | include/hw/qdev-core.h | 3 | ||||
-rw-r--r-- | include/hw/virtio/virtio-net.h | 86 | ||||
-rw-r--r-- | include/migration/vmstate.h | 1 | ||||
-rw-r--r-- | include/net/eth.h | 2 | ||||
-rw-r--r-- | include/qemu/compiler.h | 19 | ||||
-rw-r--r-- | include/qemu/typedefs.h | 13 | ||||
-rw-r--r-- | include/sysemu/bt.h | 4 | ||||
-rw-r--r-- | include/ui/console.h | 24 | ||||
-rw-r--r-- | include/ui/qemu-pixman.h | 10 |
26 files changed, 246 insertions, 66 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index 1971b55..4faf394 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016-2017 Red Hat, Inc. + * Copyright (C) 2016-2019 Red Hat, Inc. * Copyright (C) 2005 Anthony Liguori <anthony@codemonkey.ws> * * Network Block Device @@ -263,26 +263,39 @@ struct NBDExportInfo { bool request_sizes; char *x_dirty_bitmap; + /* Set by client before nbd_receive_negotiate(), or by server results + * during nbd_receive_export_list() */ + char *name; /* must be non-NULL */ + /* In-out fields, set by client before nbd_receive_negotiate() and * updated by server results during nbd_receive_negotiate() */ bool structured_reply; bool base_allocation; /* base:allocation context for NBD_CMD_BLOCK_STATUS */ - /* Set by server results during nbd_receive_negotiate() */ + /* Set by server results during nbd_receive_negotiate() and + * nbd_receive_export_list() */ uint64_t size; uint16_t flags; uint32_t min_block; uint32_t opt_block; uint32_t max_block; - uint32_t meta_base_allocation_id; + uint32_t context_id; + + /* Set by server results during nbd_receive_export_list() */ + char *description; + int n_contexts; + char **contexts; }; typedef struct NBDExportInfo NBDExportInfo; -int nbd_receive_negotiate(QIOChannel *ioc, const char *name, - QCryptoTLSCreds *tlscreds, const char *hostname, - QIOChannel **outioc, NBDExportInfo *info, - Error **errp); +int nbd_receive_negotiate(QIOChannel *ioc, QCryptoTLSCreds *tlscreds, + const char *hostname, QIOChannel **outioc, + NBDExportInfo *info, Error **errp); +void nbd_free_export_list(NBDExportInfo *info, int count); +int nbd_receive_export_list(QIOChannel *ioc, QCryptoTLSCreds *tlscreds, + const char *hostname, NBDExportInfo **info, + Error **errp); int nbd_init(int fd, QIOChannelSocket *sioc, NBDExportInfo *info, Error **errp); int nbd_send_request(QIOChannel *ioc, NBDRequest *request); @@ -294,8 +307,8 @@ int nbd_errno_to_system_errno(int err); typedef struct NBDExport NBDExport; typedef struct NBDClient NBDClient; -NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset, off_t size, - const char *name, const char *description, +NBDExport *nbd_export_new(BlockDriverState *bs, uint64_t dev_offset, + uint64_t size, const char *name, const char *desc, const char *bitmap, uint16_t nbdflags, void (*close)(NBDExport *), bool writethrough, BlockBackend *on_eject_blk, Error **errp); diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index 5021cb9..f9aa4bd 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -41,8 +41,8 @@ enum { }; typedef struct AcpiRsdpData { - uint8_t oem_id[6]; /* OEM identification */ - uint8_t revision; /* Must be 0 for 1.0, 2 for 2.0 */ + uint8_t oem_id[6] QEMU_NONSTRING; /* OEM identification */ + uint8_t revision; /* Must be 0 for 1.0, 2 for 2.0 */ unsigned *rsdt_tbl_offset; unsigned *xsdt_tbl_offset; @@ -57,10 +57,13 @@ typedef struct AcpiRsdpData { uint32_t length; /* Length of table, in bytes, including header */ \ uint8_t revision; /* ACPI Specification minor version # */ \ uint8_t checksum; /* To make sum of entire table == 0 */ \ - uint8_t oem_id [6]; /* OEM identification */ \ - uint8_t oem_table_id [8]; /* OEM table identification */ \ + uint8_t oem_id[6] \ + QEMU_NONSTRING; /* OEM identification */ \ + uint8_t oem_table_id[8] \ + QEMU_NONSTRING; /* OEM table identification */ \ uint32_t oem_revision; /* OEM revision number */ \ - uint8_t asl_compiler_id [4]; /* ASL compiler vendor ID */ \ + uint8_t asl_compiler_id[4] \ + QEMU_NONSTRING; /* ASL compiler vendor ID */ \ uint32_t asl_compiler_revision; /* ASL compiler revision number */ @@ -623,6 +626,8 @@ struct AcpiIortItsGroup { } QEMU_PACKED; typedef struct AcpiIortItsGroup AcpiIortItsGroup; +#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE 1 + struct AcpiIortSmmu3 { ACPI_IORT_NODE_HEADER_DEF uint64_t base_address; diff --git a/include/hw/acpi/tpm.h b/include/hw/acpi/tpm.h index 3580ffd..1a2a57a 100644 --- a/include/hw/acpi/tpm.h +++ b/include/hw/acpi/tpm.h @@ -18,6 +18,8 @@ #include "qemu/units.h" #include "hw/registerfields.h" +#include "hw/acpi/aml-build.h" +#include "sysemu/tpm.h" #define TPM_TIS_ADDR_BASE 0xFED40000 #define TPM_TIS_ADDR_SIZE 0x5000 @@ -188,4 +190,23 @@ REG32(CRB_DATA_BUFFER, 0x80) #define TPM2_START_METHOD_MMIO 6 #define TPM2_START_METHOD_CRB 7 +/* + * Physical Presence Interface + */ +#define TPM_PPI_ADDR_SIZE 0x400 +#define TPM_PPI_ADDR_BASE 0xFED45000 + +#define TPM_PPI_VERSION_NONE 0 +#define TPM_PPI_VERSION_1_30 1 + +/* whether function is blocked by BIOS settings; bits 0, 1, 2 */ +#define TPM_PPI_FUNC_NOT_IMPLEMENTED (0 << 0) +#define TPM_PPI_FUNC_BIOS_ONLY (1 << 0) +#define TPM_PPI_FUNC_BLOCKED (2 << 0) +#define TPM_PPI_FUNC_ALLOWED_USR_REQ (3 << 0) +#define TPM_PPI_FUNC_ALLOWED_USR_NOT_REQ (4 << 0) +#define TPM_PPI_FUNC_MASK (7 << 0) + +void tpm_build_ppi_acpi(TPMIf *tpm, Aml *dev); + #endif /* HW_ACPI_TPM_H */ diff --git a/include/hw/arm/pxa.h b/include/hw/arm/pxa.h index 0df1199..f6dfb5c 100644 --- a/include/hw/arm/pxa.h +++ b/include/hw/arm/pxa.h @@ -12,6 +12,7 @@ #include "exec/memory.h" #include "target/arm/cpu-qom.h" +#include "hw/pcmcia.h" /* Interrupt numbers */ # define PXA2XX_PIC_SSP3 0 diff --git a/include/hw/char/serial.h b/include/hw/char/serial.h index 0acfbbc..abd5cf7 100644 --- a/include/hw/char/serial.h +++ b/include/hw/char/serial.h @@ -35,7 +35,7 @@ #define UART_FIFO_LENGTH 16 /* 16550A Fifo Length */ -struct SerialState { +typedef struct SerialState { uint16_t divider; uint8_t rbr; /* receive register */ uint8_t thr; /* transmit holding register */ @@ -77,7 +77,7 @@ struct SerialState { QEMUTimer *modem_status_poll; MemoryRegion io; -}; +} SerialState; extern const VMStateDescription vmstate_serial; extern const MemoryRegionOps serial_io_ops; diff --git a/include/hw/devices.h b/include/hw/devices.h index 0e27feb..b5f1662 100644 --- a/include/hw/devices.h +++ b/include/hw/devices.h @@ -4,6 +4,7 @@ /* Devices that have nowhere better to go. */ #include "hw/hw.h" +#include "ui/console.h" /* smc91c111.c */ void smc91c111_init(NICInfo *, uint32_t, qemu_irq); diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h index d8b1b9e..5c61c05 100644 --- a/include/hw/i2c/smbus.h +++ b/include/hw/i2c/smbus.h @@ -35,6 +35,8 @@ #define SMBUS_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SMBusDeviceClass, (obj), TYPE_SMBUS_DEVICE) +typedef struct SMBusDevice SMBusDevice; + typedef struct SMBusDeviceClass { I2CSlaveClass parent_class; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 0abbe45..882fd8d 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -96,7 +96,7 @@ struct PCMachineState { * way we can use 1GByte pages in the host. * */ -struct PCMachineClass { +typedef struct PCMachineClass { /*< private >*/ MachineClass parent_class; @@ -133,7 +133,7 @@ struct PCMachineClass { /* use DMA capable linuxboot option rom */ bool linuxboot_dma_enabled; -}; +} PCMachineClass; #define TYPE_PC_MACHINE "generic-pc-machine" #define PC_MACHINE(obj) \ diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h index b7bb2b0..b44e300 100644 --- a/include/hw/ide/ahci.h +++ b/include/hw/ide/ahci.h @@ -73,13 +73,13 @@ typedef struct SysbusAHCIState { #define ALLWINNER_AHCI_MMIO_OFF 0x80 #define ALLWINNER_AHCI_MMIO_SIZE 0x80 -struct AllwinnerAHCIState { +typedef struct AllwinnerAHCIState { /*< private >*/ SysbusAHCIState parent_obj; /*< public >*/ MemoryRegion mmio; uint32_t regs[ALLWINNER_AHCI_MMIO_SIZE/4]; -}; +} AllwinnerAHCIState; #endif /* HW_IDE_AHCI_H */ diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h index 213aa16..b60455d 100644 --- a/include/hw/input/ps2.h +++ b/include/hw/input/ps2.h @@ -31,6 +31,8 @@ #define PS2_MOUSE_BUTTON_SIDE 0x08 #define PS2_MOUSE_BUTTON_EXTRA 0x10 +typedef struct PS2State PS2State; + /* ps2.c */ void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg); void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg); diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index 030eb4a..c44e767 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -66,6 +66,14 @@ typedef struct MIPSITUState { /* ITC Configuration Tags */ uint64_t ITCAddressMap[ITC_ADDRESSMAP_NUM]; MemoryRegion tag_io; + + /* ITU Control Register */ + uint64_t icr0; + + /* SAAR */ + bool saar_present; + void *saar; + } MIPSITUState; /* Get ITC Configuration Tag memory region. */ diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index cd31864..5b82a0d 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -132,6 +132,8 @@ void pcie_ari_init(PCIDevice *dev, uint16_t offset, uint16_t nextfn); void pcie_dev_ser_num_init(PCIDevice *dev, uint16_t offset, uint64_t ser_num); void pcie_ats_init(PCIDevice *dev, uint16_t offset); +void pcie_cap_slot_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, + Error **errp); void pcie_cap_slot_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h index 79cac9c..1b40807 100644 --- a/include/hw/pcmcia.h +++ b/include/hw/pcmcia.h @@ -18,13 +18,13 @@ typedef struct PCMCIASocket { #define PCMCIA_CARD_CLASS(cls) \ OBJECT_CLASS_CHECK(PCMCIACardClass, cls, TYPE_PCMCIA_CARD) -struct PCMCIACardState { +typedef struct PCMCIACardState { /*< private >*/ DeviceState parent_obj; /*< public >*/ PCMCIASocket *slot; -}; +} PCMCIACardState; typedef struct PCMCIACardClass { /*< private >*/ diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 9e01a5a..a947a0a 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -8,15 +8,16 @@ #include "hw/mem/pc-dimm.h" #include "hw/ppc/spapr_ovec.h" #include "hw/ppc/spapr_irq.h" +#include "hw/ppc/spapr_xive.h" /* For sPAPRXive */ +#include "hw/ppc/xics.h" /* For ICSState */ struct VIOsPAPRBus; struct sPAPRPHBState; struct sPAPRNVRAM; + typedef struct sPAPREventLogEntry sPAPREventLogEntry; typedef struct sPAPREventSource sPAPREventSource; typedef struct sPAPRPendingHPT sPAPRPendingHPT; -typedef struct ICSState ICSState; -typedef struct sPAPRXive sPAPRXive; #define HPTE64_V_HPTE_DIRTY 0x0000000000000040ULL #define SPAPR_ENTRY_POINT 0x100 diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h index 7fdc250..9bec919 100644 --- a/include/hw/ppc/spapr_xive.h +++ b/include/hw/ppc/spapr_xive.h @@ -41,8 +41,6 @@ bool spapr_xive_irq_claim(sPAPRXive *xive, uint32_t lisn, bool lsi); bool spapr_xive_irq_free(sPAPRXive *xive, uint32_t lisn); void spapr_xive_pic_print_info(sPAPRXive *xive, Monitor *mon); -typedef struct sPAPRMachineState sPAPRMachineState; - void spapr_xive_hcall_init(sPAPRMachineState *spapr); void spapr_dt_xive(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt, uint32_t phandle); diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 07508cb..fad786e 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -200,13 +200,6 @@ void ics_pic_print_info(ICSState *ics, Monitor *mon); void ics_resend(ICSState *ics); void icp_resend(ICPState *ss); -typedef struct sPAPRMachineState sPAPRMachineState; - -void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt, - uint32_t phandle); -int xics_kvm_init(sPAPRMachineState *spapr, Error **errp); -void xics_spapr_init(sPAPRMachineState *spapr); - Object *icp_create(Object *cpu, const char *type, XICSFabric *xi, Error **errp); diff --git a/include/hw/ppc/xics_spapr.h b/include/hw/ppc/xics_spapr.h new file mode 100644 index 0000000..b1ab27d --- /dev/null +++ b/include/hw/ppc/xics_spapr.h @@ -0,0 +1,37 @@ +/* + * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator + * + * PAPR Virtualized Interrupt System, aka ICS/ICP aka xics + * + * Copyright (c) 2010, 2011 David Gibson, IBM Corporation. + * + * 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 XICS_SPAPR_H +#define XICS_SPAPR_H + +#include "hw/ppc/spapr.h" + +void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt, + uint32_t phandle); +int xics_kvm_init(sPAPRMachineState *spapr, Error **errp); +void xics_spapr_init(sPAPRMachineState *spapr); + +#endif /* XICS_SPAPR_H */ diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 9614f76..0a84c42 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -250,6 +250,8 @@ struct PropertyInfo { /** * GlobalProperty: * @used: Set to true if property was used when initializing a device. + * @optional: If set to true, GlobalProperty will be skipped without errors + * if the property doesn't exist. * * An error is fatal for non-hotplugged devices, when the global is applied. */ @@ -258,6 +260,7 @@ typedef struct GlobalProperty { const char *property; const char *value; bool used; + bool optional; } GlobalProperty; static inline void diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index 4d7f3c8..bd66275 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -44,6 +44,82 @@ typedef struct virtio_net_conf uint8_t duplex; } virtio_net_conf; +/* Coalesced packets type & status */ +typedef enum { + RSC_COALESCE, /* Data been coalesced */ + RSC_FINAL, /* Will terminate current connection */ + RSC_NO_MATCH, /* No matched in the buffer pool */ + RSC_BYPASS, /* Packet to be bypass, not tcp, tcp ctrl, etc */ + RSC_CANDIDATE /* Data want to be coalesced */ +} CoalesceStatus; + +typedef struct VirtioNetRscStat { + uint32_t received; + uint32_t coalesced; + uint32_t over_size; + uint32_t cache; + uint32_t empty_cache; + uint32_t no_match_cache; + uint32_t win_update; + uint32_t no_match; + uint32_t tcp_syn; + uint32_t tcp_ctrl_drain; + uint32_t dup_ack; + uint32_t dup_ack1; + uint32_t dup_ack2; + uint32_t pure_ack; + uint32_t ack_out_of_win; + uint32_t data_out_of_win; + uint32_t data_out_of_order; + uint32_t data_after_pure_ack; + uint32_t bypass_not_tcp; + uint32_t tcp_option; + uint32_t tcp_all_opt; + uint32_t ip_frag; + uint32_t ip_ecn; + uint32_t ip_hacked; + uint32_t ip_option; + uint32_t purge_failed; + uint32_t drain_failed; + uint32_t final_failed; + int64_t timer; +} VirtioNetRscStat; + +/* Rsc unit general info used to checking if can coalescing */ +typedef struct VirtioNetRscUnit { + void *ip; /* ip header */ + uint16_t *ip_plen; /* data len pointer in ip header field */ + struct tcp_header *tcp; /* tcp header */ + uint16_t tcp_hdrlen; /* tcp header len */ + uint16_t payload; /* pure payload without virtio/eth/ip/tcp */ +} VirtioNetRscUnit; + +/* Coalesced segmant */ +typedef struct VirtioNetRscSeg { + QTAILQ_ENTRY(VirtioNetRscSeg) next; + void *buf; + size_t size; + uint16_t packets; + uint16_t dup_ack; + bool is_coalesced; /* need recal ipv4 header checksum, mark here */ + VirtioNetRscUnit unit; + NetClientState *nc; +} VirtioNetRscSeg; + +typedef struct VirtIONet VirtIONet; + +/* Chain is divided by protocol(ipv4/v6) and NetClientInfo */ +typedef struct VirtioNetRscChain { + QTAILQ_ENTRY(VirtioNetRscChain) next; + VirtIONet *n; /* VirtIONet */ + uint16_t proto; + uint8_t gso_type; + uint16_t max_payload; + QEMUTimer *drain_timer; + QTAILQ_HEAD(, VirtioNetRscSeg) buffers; + VirtioNetRscStat stat; +} VirtioNetRscChain; + /* Maximum packet size we can receive from tap device: header + 64k */ #define VIRTIO_NET_MAX_BUFSIZE (sizeof(struct virtio_net_hdr) + (64 * KiB)) @@ -59,19 +135,25 @@ typedef struct VirtIONetQueue { struct VirtIONet *n; } VirtIONetQueue; -typedef struct VirtIONet { +struct VirtIONet { VirtIODevice parent_obj; uint8_t mac[ETH_ALEN]; uint16_t status; VirtIONetQueue *vqs; VirtQueue *ctrl_vq; NICState *nic; + /* RSC Chains - temporary storage of coalesced data, + all these data are lost in case of migration */ + QTAILQ_HEAD(, VirtioNetRscChain) rsc_chains; uint32_t tx_timeout; int32_t tx_burst; uint32_t has_vnet_hdr; size_t host_hdr_len; size_t guest_hdr_len; uint64_t host_features; + uint32_t rsc_timeout; + uint8_t rsc4_enabled; + uint8_t rsc6_enabled; uint8_t has_ufo; uint32_t mergeable_rx_bufs; uint8_t promisc; @@ -103,7 +185,7 @@ typedef struct VirtIONet { int announce_counter; bool needs_vnet_hdr_swap; bool mtu_bypass_backend; -} VirtIONet; +}; void virtio_net_set_netclient_name(VirtIONet *n, const char *name, const char *type); diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 61bef3e..067b126 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -185,6 +185,7 @@ struct VMStateDescription { int (*pre_load)(void *opaque); int (*post_load)(void *opaque, int version_id); int (*pre_save)(void *opaque); + int (*post_save)(void *opaque); bool (*needed)(void *opaque); const VMStateField *fields; const VMStateDescription **subsections; diff --git a/include/net/eth.h b/include/net/eth.h index e6dc8a7..7f45c67 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -177,6 +177,8 @@ struct tcp_hdr { #define TH_PUSH 0x08 #define TH_ACK 0x10 #define TH_URG 0x20 +#define TH_ECE 0x40 +#define TH_CWR 0x80 u_short th_win; /* window */ u_short th_sum; /* checksum */ u_short th_urp; /* urgent pointer */ diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 261842b..296b2fd 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -113,6 +113,10 @@ #define GCC_FMT_ATTR(n, m) #endif +#ifndef __has_warning +#define __has_warning(x) 0 /* compatibility with non-clang compilers */ +#endif + #ifndef __has_feature #define __has_feature(x) 0 /* compatibility with non-clang compilers */ #endif @@ -151,6 +155,21 @@ # define QEMU_ERROR(X) #endif +/* + * The nonstring variable attribute specifies that an object or member + * declaration with type array of char or pointer to char is intended + * to store character arrays that do not necessarily contain a terminating + * NUL character. This is useful in detecting uses of such arrays or pointers + * with functions that expect NUL-terminated strings, and to avoid warnings + * when such an array or pointer is used as an argument to a bounded string + * manipulation function such as strncpy. + */ +#if __has_attribute(nonstring) +# define QEMU_NONSTRING __attribute__((nonstring)) +#else +# define QEMU_NONSTRING +#endif + /* Implement C11 _Generic via GCC builtins. Example: * * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 741935f..5d1a2d8 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -8,8 +8,6 @@ typedef struct AdapterInfo AdapterInfo; typedef struct AddressSpace AddressSpace; typedef struct AioContext AioContext; -typedef struct AllwinnerAHCIState AllwinnerAHCIState; -typedef struct AudioState AudioState; typedef struct BdrvDirtyBitmap BdrvDirtyBitmap; typedef struct BdrvDirtyBitmapIter BdrvDirtyBitmapIter; typedef struct BlockBackend BlockBackend; @@ -26,8 +24,6 @@ typedef struct DeviceListener DeviceListener; typedef struct DeviceState DeviceState; typedef struct DirtyBitmapSnapshot DirtyBitmapSnapshot; typedef struct DisplayChangeListener DisplayChangeListener; -typedef struct DisplayState DisplayState; -typedef struct DisplaySurface DisplaySurface; typedef struct DriveInfo DriveInfo; typedef struct Error Error; typedef struct EventNotifier EventNotifier; @@ -36,7 +32,6 @@ typedef struct FWCfgEntry FWCfgEntry; typedef struct FWCfgIoState FWCfgIoState; typedef struct FWCfgMemState FWCfgMemState; typedef struct FWCfgState FWCfgState; -typedef struct HCIInfo HCIInfo; typedef struct HVFX86EmulatorState HVFX86EmulatorState; typedef struct I2CBus I2CBus; typedef struct I2SCodec I2SCodec; @@ -56,7 +51,6 @@ typedef struct MigrationIncomingState MigrationIncomingState; typedef struct MigrationState MigrationState; typedef struct Monitor Monitor; typedef struct MonitorDef MonitorDef; -typedef struct MouseTransformInfo MouseTransformInfo; typedef struct MSIMessage MSIMessage; typedef struct NetClientState NetClientState; typedef struct NetFilterState NetFilterState; @@ -76,19 +70,14 @@ typedef struct PCIExpressDevice PCIExpressDevice; typedef struct PCIExpressHost PCIExpressHost; typedef struct PCIHostDeviceAddress PCIHostDeviceAddress; typedef struct PCIHostState PCIHostState; -typedef struct PCMachineClass PCMachineClass; typedef struct PCMachineState PCMachineState; -typedef struct PCMCIACardState PCMCIACardState; -typedef struct PixelFormat PixelFormat; typedef struct PostcopyDiscardState PostcopyDiscardState; typedef struct Property Property; typedef struct PropertyInfo PropertyInfo; -typedef struct PS2State PS2State; typedef struct QBool QBool; typedef struct QDict QDict; typedef struct QEMUBH QEMUBH; typedef struct QemuConsole QemuConsole; -typedef struct QemuDmaBuf QemuDmaBuf; typedef struct QEMUFile QEMUFile; typedef struct QemuLockable QemuLockable; typedef struct QemuMutex QemuMutex; @@ -107,9 +96,7 @@ typedef struct QObject QObject; typedef struct QString QString; typedef struct RAMBlock RAMBlock; typedef struct Range Range; -typedef struct SerialState SerialState; typedef struct SHPCDevice SHPCDevice; -typedef struct SMBusDevice SMBusDevice; typedef struct SSIBus SSIBus; typedef struct uWireSlave uWireSlave; typedef struct VirtIODevice VirtIODevice; diff --git a/include/sysemu/bt.h b/include/sysemu/bt.h index ddb05cd..2fd8c0f 100644 --- a/include/sysemu/bt.h +++ b/include/sysemu/bt.h @@ -3,7 +3,7 @@ /* BT HCI info */ -struct HCIInfo { +typedef struct HCIInfo { int (*bdaddr_set)(struct HCIInfo *hci, const uint8_t *bd_addr); void (*cmd_send)(struct HCIInfo *hci, const uint8_t *data, int len); void (*sco_send)(struct HCIInfo *hci, const uint8_t *data, int len); @@ -11,7 +11,7 @@ struct HCIInfo { void *opaque; void (*evt_recv)(void *opaque, const uint8_t *data, int len); void (*acl_recv)(void *opaque, const uint8_t *data, int len); -}; +} HCIInfo; /* bt-host.c */ struct HCIInfo *bt_host_hci(const char *id); diff --git a/include/ui/console.h b/include/ui/console.h index 853fcf4..fef900d 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -65,13 +65,13 @@ void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry); void kbd_put_ledstate(int ledstate); -struct MouseTransformInfo { +typedef struct MouseTransformInfo { /* Touchscreen resolution */ int x; int y; /* Calibration values as used/generated by tslib */ int a[7]; -}; +} MouseTransformInfo; void hmp_mouse_set(Monitor *mon, const QDict *qdict); @@ -121,17 +121,7 @@ struct QemuConsoleClass { #define QEMU_ALLOCATED_FLAG 0x01 -struct PixelFormat { - uint8_t bits_per_pixel; - uint8_t bytes_per_pixel; - uint8_t depth; /* color depth in bits */ - uint32_t rmask, gmask, bmask, amask; - uint8_t rshift, gshift, bshift, ashift; - uint8_t rmax, gmax, bmax, amax; - uint8_t rbits, gbits, bbits, abits; -}; - -struct DisplaySurface { +typedef struct DisplaySurface { pixman_format_code_t format; pixman_image_t *image; uint8_t flags; @@ -140,7 +130,7 @@ struct DisplaySurface { GLenum gltype; GLuint texture; #endif -}; +} DisplaySurface; typedef struct QemuUIInfo { /* geometry */ @@ -179,7 +169,7 @@ struct QEMUGLParams { int minor_ver; }; -struct QemuDmaBuf { +typedef struct QemuDmaBuf { int fd; uint32_t width; uint32_t height; @@ -187,7 +177,9 @@ struct QemuDmaBuf { uint32_t fourcc; uint32_t texture; bool y0_top; -}; +} QemuDmaBuf; + +typedef struct DisplayState DisplayState; typedef struct DisplayChangeListenerOps { const char *dpy_name; diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index b7c82d1..0668109 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -53,6 +53,16 @@ /* -------------------------------------------------------------------- */ +typedef struct PixelFormat { + uint8_t bits_per_pixel; + uint8_t bytes_per_pixel; + uint8_t depth; /* color depth in bits */ + uint32_t rmask, gmask, bmask, amask; + uint8_t rshift, gshift, bshift, ashift; + uint8_t rmax, gmax, bmax, amax; + uint8_t rbits, gbits, bbits, abits; +} PixelFormat; + PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format); pixman_format_code_t qemu_default_pixman_format(int bpp, bool native_endian); pixman_format_code_t qemu_drm_format_to_pixman(uint32_t drm_format); |