diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-05-28 18:38:38 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-05-28 18:38:39 +0100 |
commit | d7d3d6092cb7edc75dc49fb90c86dd5425ab4805 (patch) | |
tree | ea3820e7a4e5f51bd1b7b51003546ebb70486b70 /include | |
parent | 66226ffd056d85a6b86034dd4bbec687e66ded24 (diff) | |
parent | de77914e50477ca4cef1e9cdd7a05b8d0c0ff1d9 (diff) | |
download | qemu-d7d3d6092cb7edc75dc49fb90c86dd5425ab4805.zip qemu-d7d3d6092cb7edc75dc49fb90c86dd5425ab4805.tar.gz qemu-d7d3d6092cb7edc75dc49fb90c86dd5425ab4805.tar.bz2 |
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM/QTest infrastructure fixes and device conversions
* qom-test extension
* QEMUMachineInitArgs conversion to MachineState
* -machine options turned into /machine properties
* Named GPIO IRQs for devices
# gpg: Signature made Wed 28 May 2014 18:24:04 BST using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found
* remotes/afaerber/tags/qom-devices-for-peter:
ssi: Name the CS GPIO
qdev: Implement named GPIOs
machine: Make -machine opts properties of MachineState
tests: Check empty QMP output visitor
qapi: Avoid output visitor crashing if it encounters a NULL value
vl.c: Do not set 'type' property in obj_set_property()
machine: Conversion of QEMUMachineInitArgs to MachineState
qom-test: Test qom-list on link<> properties
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/boards.h | 27 | ||||
-rw-r--r-- | include/hw/qdev-core.h | 24 | ||||
-rw-r--r-- | include/hw/ssi.h | 2 |
3 files changed, 32 insertions, 21 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h index 4345bd0..2d2e2be 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -8,17 +8,10 @@ #include "hw/qdev.h" #include "qom/object.h" -typedef struct QEMUMachineInitArgs { - const MachineClass *machine; - ram_addr_t ram_size; - const char *boot_order; - const char *kernel_filename; - const char *kernel_cmdline; - const char *initrd_filename; - const char *cpu_model; -} QEMUMachineInitArgs; -typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args); +typedef struct MachineState MachineState; + +typedef void QEMUMachineInitFunc(MachineState *ms); typedef void QEMUMachineResetFunc(void); @@ -62,8 +55,6 @@ int qemu_register_machine(QEMUMachine *m); #define MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE) -typedef struct MachineState MachineState; - MachineClass *find_default_machine(void); extern MachineState *current_machine; @@ -80,7 +71,7 @@ struct MachineClass { const char *alias; const char *desc; - void (*init)(QEMUMachineInitArgs *args); + void (*init)(MachineState *state); void (*reset)(void); void (*hot_add_cpu)(const int64_t id, Error **errp); int (*kvm_type)(const char *arg); @@ -112,9 +103,6 @@ struct MachineState { char *accel; bool kernel_irqchip; int kvm_shadow_mem; - char *kernel; - char *initrd; - char *append; char *dtb; char *dumpdtb; int phandle_start; @@ -124,7 +112,12 @@ struct MachineState { bool usb; char *firmware; - QEMUMachineInitArgs init_args; + ram_addr_t ram_size; + const char *boot_order; + char *kernel_filename; + char *kernel_cmdline; + char *initrd_filename; + const char *cpu_model; }; #endif diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index dbe473c..ae31575 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -131,6 +131,17 @@ typedef struct DeviceClass { const char *bus_type; } DeviceClass; +typedef struct NamedGPIOList NamedGPIOList; + +struct NamedGPIOList { + char *name; + qemu_irq *in; + int num_in; + qemu_irq *out; + int num_out; + QLIST_ENTRY(NamedGPIOList) node; +}; + /** * DeviceState: * @realized: Indicates whether the device has been fully constructed. @@ -148,10 +159,7 @@ struct DeviceState { QemuOpts *opts; int hotplugged; BusState *parent_bus; - int num_gpio_out; - qemu_irq *gpio_out; - int num_gpio_in; - qemu_irq *gpio_in; + QLIST_HEAD(, NamedGPIOList) gpios; QLIST_HEAD(, BusState) child_bus; int num_child_bus; int instance_id_alias; @@ -252,7 +260,11 @@ void qdev_machine_creation_done(void); bool qdev_machine_modified(void); qemu_irq qdev_get_gpio_in(DeviceState *dev, int n); +qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n); + void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); +void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, + qemu_irq pin); BusState *qdev_get_child_bus(DeviceState *dev, const char *name); @@ -262,6 +274,10 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name); /* GPIO inputs also double as IRQ sinks. */ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n); void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n); +void qdev_init_gpio_in_named(DeviceState *dev, qemu_irq_handler handler, + const char *name, int n); +void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, + const char *name, int n); BusState *qdev_get_parent_bus(DeviceState *dev); diff --git a/include/hw/ssi.h b/include/hw/ssi.h index 6c13fb2..df0f838 100644 --- a/include/hw/ssi.h +++ b/include/hw/ssi.h @@ -23,6 +23,8 @@ typedef struct SSISlave SSISlave; #define SSI_SLAVE_GET_CLASS(obj) \ OBJECT_GET_CLASS(SSISlaveClass, (obj), TYPE_SSI_SLAVE) +#define SSI_GPIO_CS "ssi-gpio-cs" + typedef enum { SSI_CS_NONE = 0, SSI_CS_LOW, |