* [Qemu-devel] [PATCH 01/32] qdev/prop: macros for creating typechecked properties.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 02/32] qdev/prop: add CharDriverState property Gerd Hoffmann
` (30 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
There are DEFINE_PROP_$TYPE("name", struct, field, default) macros for
each property type. These macros link the qdev_prop_$name struct to the
type used by that property. typeof(struct->field) is verifyed to be the
correct one for the given property.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qdev-addr.h | 3 +++
hw/qdev.h | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/hw/qdev-addr.h b/hw/qdev-addr.h
index f02bd7a..a0ddf38 100644
--- a/hw/qdev-addr.h
+++ b/hw/qdev-addr.h
@@ -1,2 +1,5 @@
+#define DEFINE_PROP_TADDR(_n, _s, _f, _d) \
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_taddr, target_phys_addr_t)
+
extern PropertyInfo qdev_prop_taddr;
void qdev_prop_set_taddr(DeviceState *dev, const char *name, target_phys_addr_t value);
diff --git a/hw/qdev.h b/hw/qdev.h
index b342afb..e2703f4 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -156,6 +156,44 @@ extern PropertyInfo qdev_prop_ptr;
extern PropertyInfo qdev_prop_macaddr;
extern PropertyInfo qdev_prop_pci_devfn;
+#define typeof_field(type, field) typeof(((type *)0)->field)
+#define type_check(t1,t2) ((t1*)0 - (t2*)0)
+
+#define DEFINE_PROP(_name, _state, _field, _prop, _type) { \
+ .name = (_name), \
+ .info = &(_prop), \
+ .offset = offsetof(_state, _field) \
+ + type_check(_type,typeof_field(_state, _field)), \
+ }
+#define DEFINE_PROP_DEFAULT(_name, _state, _field, _defval, _prop, _type) { \
+ .name = (_name), \
+ .info = &(_prop), \
+ .offset = offsetof(_state, _field) \
+ + type_check(_type,typeof_field(_state, _field)), \
+ .defval = (_type[]) { _defval }, \
+ }
+
+#define DEFINE_PROP_UINT16(_n, _s, _f, _d) \
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_uint16, uint16_t)
+#define DEFINE_PROP_UINT32(_n, _s, _f, _d) \
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_uint32, uint32_t)
+#define DEFINE_PROP_UINT64(_n, _s, _f, _d) \
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_uint64, uint64_t)
+#define DEFINE_PROP_HEX32(_n, _s, _f, _d) \
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_hex32, uint32_t)
+#define DEFINE_PROP_HEX64(_n, _s, _f, _d) \
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_hex64, uint64_t)
+#define DEFINE_PROP_PCI_DEVFN(_n, _s, _f, _d) \
+ DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_pci_devfn, uint32_t)
+
+#define DEFINE_PROP_PTR(_n, _s, _f) \
+ DEFINE_PROP(_n, _s, _f, qdev_prop_ptr, void*)
+#define DEFINE_PROP_MACADDR(_n, _s, _f) \
+ DEFINE_PROP(_n, _s, _f, qdev_prop_macaddr, uint8_t[6])
+
+#define DEFINE_PROP_END_OF_LIST() \
+ {}
+
/* Set properties between creation and init. */
void *qdev_get_prop_ptr(DeviceState *dev, Property *prop);
int qdev_prop_parse(DeviceState *dev, const char *name, const char *value);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 02/32] qdev/prop: add CharDriverState property.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 01/32] qdev/prop: " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 03/32] qdev/prop: convert pci.c to helper macros Gerd Hoffmann
` (29 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qdev-properties.c | 20 ++++++++++++++++++++
hw/qdev.h | 6 ++++++
2 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 0e4878e..7edb6b7 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -141,6 +141,21 @@ PropertyInfo qdev_prop_hex64 = {
.print = print_hex64,
};
+/* --- character device --- */
+
+static int print_chr(DeviceState *dev, Property *prop, char *dest, size_t len)
+{
+ CharDriverState **ptr = qdev_get_prop_ptr(dev, prop);
+ return snprintf(dest, len, "%s", (*ptr)->label);
+}
+
+PropertyInfo qdev_prop_chr = {
+ .name = "chr",
+ .type = PROP_TYPE_CHR,
+ .size = sizeof(CharDriverState*),
+ .print = print_chr,
+};
+
/* --- pointer --- */
static int print_ptr(DeviceState *dev, Property *prop, char *dest, size_t len)
@@ -325,6 +340,11 @@ void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value)
qdev_prop_set(dev, name, &value, PROP_TYPE_UINT64);
}
+void qdev_prop_set_chr(DeviceState *dev, const char *name, CharDriverState *value)
+{
+ qdev_prop_set(dev, name, &value, PROP_TYPE_CHR);
+}
+
void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value)
{
qdev_prop_set(dev, name, &value, PROP_TYPE_PTR);
diff --git a/hw/qdev.h b/hw/qdev.h
index e2703f4..bff13fa 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -3,6 +3,7 @@
#include "hw.h"
#include "sys-queue.h"
+#include "qemu-char.h"
typedef struct Property Property;
@@ -62,6 +63,7 @@ enum PropertyType {
PROP_TYPE_UINT64,
PROP_TYPE_TADDR,
PROP_TYPE_MACADDR,
+ PROP_TYPE_CHR,
PROP_TYPE_PTR,
};
@@ -152,6 +154,7 @@ extern PropertyInfo qdev_prop_uint32;
extern PropertyInfo qdev_prop_uint64;
extern PropertyInfo qdev_prop_hex32;
extern PropertyInfo qdev_prop_hex64;
+extern PropertyInfo qdev_prop_chr;
extern PropertyInfo qdev_prop_ptr;
extern PropertyInfo qdev_prop_macaddr;
extern PropertyInfo qdev_prop_pci_devfn;
@@ -188,6 +191,8 @@ extern PropertyInfo qdev_prop_pci_devfn;
#define DEFINE_PROP_PTR(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_ptr, void*)
+#define DEFINE_PROP_CHR(_n, _s, _f) \
+ DEFINE_PROP(_n, _s, _f, qdev_prop_chr, CharDriverState*)
#define DEFINE_PROP_MACADDR(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_macaddr, uint8_t[6])
@@ -201,6 +206,7 @@ void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyT
void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value);
void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value);
void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value);
+void qdev_prop_set_chr(DeviceState *dev, const char *name, CharDriverState *value);
/* FIXME: Remove opaque pointer properties. */
void qdev_prop_set_ptr(DeviceState *dev, const char *name, void *value);
void qdev_prop_set_defaults(DeviceState *dev, Property *props);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 03/32] qdev/prop: convert pci.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 01/32] qdev/prop: " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 02/32] qdev/prop: add CharDriverState property Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 04/32] qdev/prop: convert arm_sysctl.c " Gerd Hoffmann
` (28 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/pci.c | 9 ++-------
hw/pci.h | 2 +-
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 4d0cdc7..27eac04 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -60,13 +60,8 @@ static struct BusInfo pci_bus_info = {
.size = sizeof(PCIBus),
.print_dev = pcibus_dev_print,
.props = (Property[]) {
- {
- .name = "addr",
- .info = &qdev_prop_pci_devfn,
- .offset = offsetof(PCIDevice, devfn),
- .defval = (uint32_t[]) { -1 },
- },
- {/* end of list */}
+ DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
+ DEFINE_PROP_END_OF_LIST()
}
};
diff --git a/hw/pci.h b/hw/pci.h
index cbfea6a..a2ec16a 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -177,7 +177,7 @@ struct PCIDevice {
/* the following fields are read only */
PCIBus *bus;
- int devfn;
+ uint32_t devfn;
char name[64];
PCIIORegion io_regions[PCI_NUM_REGIONS];
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 04/32] qdev/prop: convert arm_sysctl.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (2 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 03/32] qdev/prop: convert pci.c to helper macros Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 05/32] qdev/prop: convert armv7m.c " Gerd Hoffmann
` (27 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/arm_sysctl.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index bb005c8..11b3787 100644
--- a/hw/arm_sysctl.c
+++ b/hw/arm_sysctl.c
@@ -219,12 +219,8 @@ static SysBusDeviceInfo arm_sysctl_info = {
.qdev.name = "realview_sysctl",
.qdev.size = sizeof(arm_sysctl_state),
.qdev.props = (Property[]) {
- {
- .name = "sys_id",
- .info = &qdev_prop_uint32,
- .offset = offsetof(arm_sysctl_state, sys_id),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("sys_id", arm_sysctl_state, sys_id, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 05/32] qdev/prop: convert armv7m.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (3 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 04/32] qdev/prop: convert arm_sysctl.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 06/32] qdev/prop: convert eccmemctl.c " Gerd Hoffmann
` (26 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/armv7m.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/armv7m.c b/hw/armv7m.c
index 2e66d7e..2e4f0ed 100644
--- a/hw/armv7m.c
+++ b/hw/armv7m.c
@@ -242,12 +242,8 @@ static SysBusDeviceInfo bitband_info = {
.qdev.name = "ARM,bitband-memory",
.qdev.size = sizeof(BitBandState),
.qdev.props = (Property[]) {
- {
- .name = "base",
- .info = &qdev_prop_hex32,
- .offset = offsetof(BitBandState, base),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("base", BitBandState, base, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 06/32] qdev/prop: convert eccmemctl.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (4 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 05/32] qdev/prop: convert armv7m.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 07/32] qdev/prop: convert escc.c " Gerd Hoffmann
` (25 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/eccmemctl.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/eccmemctl.c b/hw/eccmemctl.c
index dca397d..3f38477 100644
--- a/hw/eccmemctl.c
+++ b/hw/eccmemctl.c
@@ -356,13 +356,8 @@ static SysBusDeviceInfo ecc_info = {
.qdev.name = "eccmemctl",
.qdev.size = sizeof(ECCState),
.qdev.props = (Property[]) {
- {
- .name = "version",
- .info = &qdev_prop_hex32,
- .offset = offsetof(ECCState, version),
- .defval = (uint32_t[]) { -1 },
- },
- {/* end of list */}
+ DEFINE_PROP_HEX32("version", ECCState, version, -1),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 07/32] qdev/prop: convert escc.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (5 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 06/32] qdev/prop: convert eccmemctl.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 08/32] qdev/prop: convert etraxfs_pic.c " Gerd Hoffmann
` (24 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/escc.c | 47 ++++++++++-------------------------------------
1 files changed, 10 insertions(+), 37 deletions(-)
diff --git a/hw/escc.c b/hw/escc.c
index 2264f5d..74a96cd 100644
--- a/hw/escc.c
+++ b/hw/escc.c
@@ -118,7 +118,7 @@ typedef struct ChannelState {
struct SerialState {
SysBusDevice busdev;
struct ChannelState chn[2];
- int it_shift;
+ uint32_t it_shift;
int mmio_index;
uint32_t disabled;
uint32_t frequency;
@@ -952,42 +952,15 @@ static SysBusDeviceInfo escc_info = {
.qdev.name = "escc",
.qdev.size = sizeof(SerialState),
.qdev.props = (Property[]) {
- {
- .name = "frequency",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SerialState, frequency),
- },
- {
- .name = "it_shift",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SerialState, it_shift),
- },
- {
- .name = "disabled",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SerialState, disabled),
- },
- {
- .name = "chrB",
- .info = &qdev_prop_ptr,
- .offset = offsetof(SerialState, chn[0].chr),
- },
- {
- .name = "chrA",
- .info = &qdev_prop_ptr,
- .offset = offsetof(SerialState, chn[1].chr),
- },
- {
- .name = "chnBtype",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SerialState, chn[0].type),
- },
- {
- .name = "chnAtype",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SerialState, chn[1].type),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("frequency", SerialState, frequency, 0),
+ DEFINE_PROP_UINT32("it_shift", SerialState, it_shift, 0),
+ DEFINE_PROP_UINT32("disabled", SerialState, disabled, 0),
+ DEFINE_PROP_UINT32("disabled", SerialState, disabled, 0),
+ DEFINE_PROP_UINT32("chnBtype", SerialState, chn[0].type, 0),
+ DEFINE_PROP_UINT32("chnAtype", SerialState, chn[1].type, 0),
+ DEFINE_PROP_CHR("chrB", SerialState, chn[0].chr),
+ DEFINE_PROP_CHR("chrA", SerialState, chn[1].chr),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 08/32] qdev/prop: convert etraxfs_pic.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (6 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 07/32] qdev/prop: convert escc.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 09/32] qdev/prop: convert i2c.c " Gerd Hoffmann
` (23 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/etraxfs_pic.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/hw/etraxfs_pic.c b/hw/etraxfs_pic.c
index e627218..4527d98 100644
--- a/hw/etraxfs_pic.c
+++ b/hw/etraxfs_pic.c
@@ -39,7 +39,7 @@
struct etrax_pic
{
SysBusDevice busdev;
- uint32_t *interrupt_vector;
+ void *interrupt_vector;
qemu_irq parent_irq;
qemu_irq parent_nmi;
uint32_t regs[R_MAX];
@@ -71,7 +71,8 @@ static void pic_update(struct etrax_pic *fs)
}
if (fs->interrupt_vector) {
- *fs->interrupt_vector = vector;
+ /* hack alert: ptr property */
+ *(uint32_t*)(fs->interrupt_vector) = vector;
}
qemu_set_irq(fs->parent_irq, !!vector);
}
@@ -153,12 +154,8 @@ static SysBusDeviceInfo etraxfs_pic_info = {
.qdev.name = "etraxfs,pic",
.qdev.size = sizeof(struct etrax_pic),
.qdev.props = (Property[]) {
- {
- .name = "interrupt_vector",
- .info = &qdev_prop_ptr,
- .offset = offsetof(struct etrax_pic, interrupt_vector),
- },
- {/* end of list */}
+ DEFINE_PROP_PTR("interrupt_vector", struct etrax_pic, interrupt_vector),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 09/32] qdev/prop: convert i2c.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (7 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 08/32] qdev/prop: convert etraxfs_pic.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 10/32] qdev/prop: convert integratorcp.c " Gerd Hoffmann
` (22 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/i2c.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/i2c.c b/hw/i2c.c
index 42a5d7a..7a1b358 100644
--- a/hw/i2c.c
+++ b/hw/i2c.c
@@ -21,12 +21,8 @@ static struct BusInfo i2c_bus_info = {
.name = "I2C",
.size = sizeof(i2c_bus),
.props = (Property[]) {
- {
- .name = "address",
- .info = &qdev_prop_uint32,
- .offset = offsetof(struct i2c_slave, address),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("address", struct i2c_slave, address, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 10/32] qdev/prop: convert integratorcp.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (8 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 09/32] qdev/prop: convert i2c.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 11/32] qdev/prop: convert iommu.c " Gerd Hoffmann
` (21 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/integratorcp.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index ddc8d85..2d83004 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -526,12 +526,8 @@ static SysBusDeviceInfo core_info = {
.qdev.name = "integrator_core",
.qdev.size = sizeof(integratorcm_state),
.qdev.props = (Property[]) {
- {
- .name = "memsz",
- .info = &qdev_prop_uint32,
- .offset = offsetof(integratorcm_state, memsz),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("memsz", integratorcm_state, memsz, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 11/32] qdev/prop: convert iommu.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (9 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 10/32] qdev/prop: convert integratorcp.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 12/32] qdev/prop: convert m48t59.c " Gerd Hoffmann
` (20 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/iommu.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/iommu.c b/hw/iommu.c
index d73dad3..a1c54f8 100644
--- a/hw/iommu.c
+++ b/hw/iommu.c
@@ -404,12 +404,8 @@ static SysBusDeviceInfo iommu_info = {
.qdev.name = "iommu",
.qdev.size = sizeof(IOMMUState),
.qdev.props = (Property[]) {
- {
- .name = "version",
- .info = &qdev_prop_hex32,
- .offset = offsetof(IOMMUState, version),
- },
- {/* end of property list */}
+ DEFINE_PROP_HEX32("version", IOMMUState, version, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 12/32] qdev/prop: convert m48t59.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (10 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 11/32] qdev/prop: convert iommu.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 13/32] qdev/prop: convert pcnet.c " Gerd Hoffmann
` (19 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/m48t59.c | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/hw/m48t59.c b/hw/m48t59.c
index 7e53dce..6541cbe 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -668,22 +668,10 @@ static SysBusDeviceInfo m48t59_info = {
.qdev.name = "m48t59",
.qdev.size = sizeof(m48t59_t),
.qdev.props = (Property[]) {
- {
- .name = "size",
- .info = &qdev_prop_uint32,
- .offset = offsetof(m48t59_t, size),
- .defval = (uint32_t[]) { -1 },
- },{
- .name = "type",
- .info = &qdev_prop_uint32,
- .offset = offsetof(m48t59_t, type),
- .defval = (uint32_t[]) { -1 },
- },{
- .name = "io_base",
- .info = &qdev_prop_hex32,
- .offset = offsetof(m48t59_t, io_base),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("size", m48t59_t, size, -1),
+ DEFINE_PROP_UINT32("type", m48t59_t, type, -1),
+ DEFINE_PROP_HEX32( "io_base", m48t59_t, io_base, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 13/32] qdev/prop: convert pcnet.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (11 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 12/32] qdev/prop: convert m48t59.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 14/32] qdev/prop: convert qdev.c " Gerd Hoffmann
` (18 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/pcnet.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/pcnet.c b/hw/pcnet.c
index 22ab6be..637dcfb 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -2145,12 +2145,8 @@ static SysBusDeviceInfo lance_info = {
.qdev.name = "lance",
.qdev.size = sizeof(SysBusPCNetState),
.qdev.props = (Property[]) {
- {
- .name = "dma",
- .info = &qdev_prop_ptr,
- .offset = offsetof(SysBusPCNetState, state.dma_opaque),
- },
- {/* end of list */}
+ DEFINE_PROP_PTR("dma", SysBusPCNetState, state.dma_opaque),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 14/32] qdev/prop: convert qdev.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (12 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 13/32] qdev/prop: convert pcnet.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-04 13:27 ` Anthony Liguori
2009-08-03 15:35 ` [Qemu-devel] [PATCH 15/32] qdev/prop: convert slavio_intctl.c " Gerd Hoffmann
` (17 subsequent siblings)
31 siblings, 1 reply; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qdev.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 9488dba..3de3bc9 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -543,8 +543,8 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
if (!props)
return;
while (props->name) {
- if (props->info->print) {
- props->info->print(dev, props, buf, sizeof(buf));
+ if (props->xinfo->print) {
+ props->xinfo->print(dev, props, buf, sizeof(buf));
qdev_printf("%s-prop: %s = %s\n", prefix, props->name, buf);
}
props++;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [Qemu-devel] [PATCH 14/32] qdev/prop: convert qdev.c to helper macros.
2009-08-03 15:35 ` [Qemu-devel] [PATCH 14/32] qdev/prop: convert qdev.c " Gerd Hoffmann
@ 2009-08-04 13:27 ` Anthony Liguori
2009-08-04 13:43 ` Gerd Hoffmann
0 siblings, 1 reply; 35+ messages in thread
From: Anthony Liguori @ 2009-08-04 13:27 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: qemu-devel
Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/qdev.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index 9488dba..3de3bc9 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -543,8 +543,8 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props,
> if (!props)
> return;
> while (props->name) {
> - if (props->info->print) {
> - props->info->print(dev, props, buf, sizeof(buf));
> + if (props->xinfo->print) {
> + props->xinfo->print(dev, props, buf, sizeof(buf));
> qdev_printf("%s-prop: %s = %s\n", prefix, props->name, buf);
> }
> props++;
>
This doesn't match the description and breaks the build for me.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [Qemu-devel] [PATCH 14/32] qdev/prop: convert qdev.c to helper macros.
2009-08-04 13:27 ` Anthony Liguori
@ 2009-08-04 13:43 ` Gerd Hoffmann
0 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-04 13:43 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel
On 08/04/09 15:27, Anthony Liguori wrote:
> Gerd Hoffmann wrote:
>> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>> ---
>> hw/qdev.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/qdev.c b/hw/qdev.c
>> index 9488dba..3de3bc9 100644
>> --- a/hw/qdev.c
>> +++ b/hw/qdev.c
>> @@ -543,8 +543,8 @@ static void qdev_print_props(Monitor *mon,
>> DeviceState *dev, Property *props,
>> if (!props)
>> return;
>> while (props->name) {
>> - if (props->info->print) {
>> - props->info->print(dev, props, buf, sizeof(buf));
>> + if (props->xinfo->print) {
>> + props->xinfo->print(dev, props, buf, sizeof(buf));
>> qdev_printf("%s-prop: %s = %s\n", prefix, props->name, buf);
>> }
>> props++;
> This doesn't match the description and breaks the build for me.
Indeed. Just drop that patch.
It is part of a little temporary patch to make gcc complain about any
not-yet converted property. It wasn't intended to sneak into public ...
cheers,
Gerd
^ permalink raw reply [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 15/32] qdev/prop: convert slavio_intctl.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (13 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 14/32] qdev/prop: convert qdev.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 16/32] qdev/prop: convert slavio_timer.c " Gerd Hoffmann
` (16 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/slavio_intctl.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c
index 188511e..01a7624 100644
--- a/hw/slavio_intctl.c
+++ b/hw/slavio_intctl.c
@@ -68,6 +68,7 @@ typedef struct SLAVIO_INTCTLState {
#endif
qemu_irq cpu_irqs[MAX_CPUS][MAX_PILS];
const uint32_t *intbit_to_level;
+ void *i_to_l;
uint32_t cputimer_lbit, cputimer_mbit;
uint32_t cputimer_bit;
uint32_t pil_out[MAX_CPUS];
@@ -392,6 +393,7 @@ static void slavio_intctl_init1(SysBusDevice *dev)
int io_memory;
unsigned int i, j;
+ s->intbit_to_level = s->i_to_l; /* hack alert: ptr property */
qdev_init_gpio_in(&dev->qdev, slavio_set_irq_all, 32 + MAX_CPUS);
io_memory = cpu_register_io_memory(slavio_intctlm_mem_read,
slavio_intctlm_mem_write, s);
@@ -450,17 +452,9 @@ static SysBusDeviceInfo slavio_intctl_info = {
.qdev.name = "slavio_intctl",
.qdev.size = sizeof(SLAVIO_INTCTLState),
.qdev.props = (Property[]) {
- {
- .name = "intbit_to_level",
- .info = &qdev_prop_ptr,
- .offset = offsetof(SLAVIO_INTCTLState, intbit_to_level),
- },
- {
- .name = "cputimer_bit",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SLAVIO_INTCTLState, cputimer_bit),
- },
- {/* end of property list */}
+ DEFINE_PROP_PTR("intbit_to_level", SLAVIO_INTCTLState, i_to_l),
+ DEFINE_PROP_UINT32("cputimer_bit", SLAVIO_INTCTLState, cputimer_bit, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 16/32] qdev/prop: convert slavio_timer.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (14 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 15/32] qdev/prop: convert slavio_intctl.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 17/32] qdev/prop: convert smbus_eeprom.c " Gerd Hoffmann
` (15 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/slavio_timer.c | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/hw/slavio_timer.c b/hw/slavio_timer.c
index 69c9f3b..131e903 100644
--- a/hw/slavio_timer.c
+++ b/hw/slavio_timer.c
@@ -61,6 +61,7 @@ typedef struct SLAVIO_TIMERState {
// processor only
uint32_t running;
struct SLAVIO_TIMERState *master;
+ void *m;
uint32_t slave_index;
// system only
uint32_t num_slaves;
@@ -395,6 +396,7 @@ static void slavio_timer_init1(SysBusDevice *dev)
sysbus_init_irq(dev, &s->irq);
+ s->master = s->m; /* hack alert: ptr property */
if (!s->master || s->slave_index < s->master->num_slaves) {
bh = qemu_bh_new(slavio_timer_irq, s);
s->timer = ptimer_init(bh);
@@ -436,22 +438,10 @@ static SysBusDeviceInfo slavio_timer_info = {
.qdev.name = "slavio_timer",
.qdev.size = sizeof(SLAVIO_TIMERState),
.qdev.props = (Property[]) {
- {
- .name = "num_slaves",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SLAVIO_TIMERState, num_slaves),
- },
- {
- .name = "slave_index",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SLAVIO_TIMERState, slave_index),
- },
- {
- .name = "master",
- .info = &qdev_prop_ptr,
- .offset = offsetof(SLAVIO_TIMERState, master),
- },
- {/* end of property list */}
+ DEFINE_PROP_UINT32("num_slaves", SLAVIO_TIMERState, num_slaves, 0),
+ DEFINE_PROP_UINT32("slave_index", SLAVIO_TIMERState, slave_index, 0),
+ DEFINE_PROP_PTR("master", SLAVIO_TIMERState, m),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 17/32] qdev/prop: convert smbus_eeprom.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (15 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 16/32] qdev/prop: convert slavio_timer.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 18/32] qdev/prop: convert sparc32_dma.c " Gerd Hoffmann
` (14 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/smbus_eeprom.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/hw/smbus_eeprom.c b/hw/smbus_eeprom.c
index c071fb1..9785cc2 100644
--- a/hw/smbus_eeprom.c
+++ b/hw/smbus_eeprom.c
@@ -30,7 +30,7 @@
typedef struct SMBusEEPROMDevice {
SMBusDevice smbusdev;
- uint8_t *data;
+ void *data;
uint8_t offset;
} SMBusEEPROMDevice;
@@ -54,7 +54,8 @@ static void eeprom_send_byte(SMBusDevice *dev, uint8_t val)
static uint8_t eeprom_receive_byte(SMBusDevice *dev)
{
SMBusEEPROMDevice *eeprom = (SMBusEEPROMDevice *) dev;
- uint8_t val = eeprom->data[eeprom->offset++];
+ uint8_t *data = eeprom->data;
+ uint8_t val = data[eeprom->offset++];
#ifdef DEBUG
printf("eeprom_receive_byte: addr=0x%02x val=0x%02x\n",
dev->i2c.address, val);
@@ -106,12 +107,8 @@ static SMBusDeviceInfo smbus_eeprom_info = {
.i2c.qdev.name = "smbus-eeprom",
.i2c.qdev.size = sizeof(SMBusEEPROMDevice),
.i2c.qdev.props = (Property[]) {
- {
- .name = "data",
- .info = &qdev_prop_ptr,
- .offset = offsetof(SMBusEEPROMDevice, data),
- },
- {/* end of list */}
+ DEFINE_PROP_PTR("data", SMBusEEPROMDevice, data),
+ DEFINE_PROP_END_OF_LIST(),
},
.init = smbus_eeprom_init,
.quick_cmd = eeprom_quick_cmd,
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 18/32] qdev/prop: convert sparc32_dma.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (16 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 17/32] qdev/prop: convert smbus_eeprom.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 19/32] qdev/prop: convert sun4m.c " Gerd Hoffmann
` (13 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/sparc32_dma.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/sparc32_dma.c b/hw/sparc32_dma.c
index 7633905..926fd32 100644
--- a/hw/sparc32_dma.c
+++ b/hw/sparc32_dma.c
@@ -286,12 +286,8 @@ static SysBusDeviceInfo sparc32_dma_info = {
.qdev.name = "sparc32_dma",
.qdev.size = sizeof(DMAState),
.qdev.props = (Property[]) {
- {
- .name = "iommu_opaque",
- .info = &qdev_prop_ptr,
- .offset = offsetof(DMAState, iommu),
- },
- {/* end of property list */}
+ DEFINE_PROP_PTR("iommu_opaque", DMAState, iommu),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 19/32] qdev/prop: convert sun4m.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (17 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 18/32] qdev/prop: convert sparc32_dma.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 20/32] qdev/prop: convert sun4u.c " Gerd Hoffmann
` (12 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/sun4m.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/sun4m.c b/hw/sun4m.c
index 274ee35..6a59627 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -525,12 +525,8 @@ static SysBusDeviceInfo ram_info = {
.qdev.name = "memory",
.qdev.size = sizeof(RamDevice),
.qdev.props = (Property[]) {
- {
- .name = "size",
- .info = &qdev_prop_uint64,
- .offset = offsetof(RamDevice, size),
- },
- {/* end of property list */}
+ DEFINE_PROP_UINT64("size", RamDevice, size, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 20/32] qdev/prop: convert sun4u.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (18 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 19/32] qdev/prop: convert sun4m.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 21/32] qdev/prop: convert syborg_fb.c " Gerd Hoffmann
` (11 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/sun4u.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/sun4u.c b/hw/sun4u.c
index 6f3f0c3..fc0c552 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -492,12 +492,8 @@ static SysBusDeviceInfo ram_info = {
.qdev.name = "memory",
.qdev.size = sizeof(RamDevice),
.qdev.props = (Property[]) {
- {
- .name = "size",
- .info = &qdev_prop_uint64,
- .offset = offsetof(RamDevice, size),
- },
- {/* end of property list */}
+ DEFINE_PROP_UINT64("size", RamDevice, size, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 21/32] qdev/prop: convert syborg_fb.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (19 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 20/32] qdev/prop: convert sun4u.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 22/32] qdev/prop: convert syborg_interrupt.c " Gerd Hoffmann
` (10 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/syborg_fb.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/hw/syborg_fb.c b/hw/syborg_fb.c
index 2929ffd..efa5c0e 100644
--- a/hw/syborg_fb.c
+++ b/hw/syborg_fb.c
@@ -535,16 +535,9 @@ static SysBusDeviceInfo syborg_fb_info = {
.qdev.name = "syborg,framebuffer",
.qdev.size = sizeof(SyborgFBState),
.qdev.props = (Property[]) {
- {
- .name = "width",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgFBState, cols),
- },{
- .name = "height",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgFBState, rows),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("width", SyborgFBState, cols, 0),
+ DEFINE_PROP_UINT32("height", SyborgFBState, rows, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 22/32] qdev/prop: convert syborg_interrupt.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (20 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 21/32] qdev/prop: convert syborg_fb.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 23/32] qdev/prop: convert syborg_keyboard.c " Gerd Hoffmann
` (9 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/syborg_interrupt.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/syborg_interrupt.c b/hw/syborg_interrupt.c
index a372ec1..1b44989 100644
--- a/hw/syborg_interrupt.c
+++ b/hw/syborg_interrupt.c
@@ -222,13 +222,8 @@ static SysBusDeviceInfo syborg_int_info = {
.qdev.name = "syborg,interrupt",
.qdev.size = sizeof(SyborgIntState),
.qdev.props = (Property[]) {
- {
- .name = "num-interrupts",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgIntState, num_irqs),
- .defval = (uint32_t[]) { 64 },
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("num-interrupts", SyborgIntState, num_irqs, 64),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 23/32] qdev/prop: convert syborg_keyboard.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (21 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 22/32] qdev/prop: convert syborg_interrupt.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 24/32] qdev/prop: convert syborg_pointer.c " Gerd Hoffmann
` (8 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/syborg_keyboard.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/syborg_keyboard.c b/hw/syborg_keyboard.c
index ffc85a5..deece3c 100644
--- a/hw/syborg_keyboard.c
+++ b/hw/syborg_keyboard.c
@@ -229,13 +229,8 @@ static SysBusDeviceInfo syborg_keyboard_info = {
.qdev.name = "syborg,keyboard",
.qdev.size = sizeof(SyborgKeyboardState),
.qdev.props = (Property[]) {
- {
- .name = "fifo-size",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgKeyboardState, fifo_size),
- .defval = (uint32_t[]) { 16 },
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("fifo-size", SyborgKeyboardState, fifo_size, 16),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 24/32] qdev/prop: convert syborg_pointer.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (22 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 23/32] qdev/prop: convert syborg_keyboard.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 25/32] qdev/prop: convert syborg_serial.c " Gerd Hoffmann
` (7 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/syborg_pointer.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/hw/syborg_pointer.c b/hw/syborg_pointer.c
index edd1f22..152602a 100644
--- a/hw/syborg_pointer.c
+++ b/hw/syborg_pointer.c
@@ -227,18 +227,9 @@ static SysBusDeviceInfo syborg_pointer_info = {
.qdev.name = "syborg,pointer",
.qdev.size = sizeof(SyborgPointerState),
.qdev.props = (Property[]) {
- {
- .name = "fifo-size",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgPointerState, fifo_size),
- .defval = (uint32_t[]) { 16 },
- },{
- .name = "absolute",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgPointerState, absolute),
- .defval = (uint32_t[]) { 1 },
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("fifo-size", SyborgPointerState, fifo_size, 16),
+ DEFINE_PROP_UINT32("absolute", SyborgPointerState, absolute, 1),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 25/32] qdev/prop: convert syborg_serial.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (23 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 24/32] qdev/prop: convert syborg_pointer.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 26/32] qdev/prop: convert syborg_timer.c " Gerd Hoffmann
` (6 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/syborg_serial.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/syborg_serial.c b/hw/syborg_serial.c
index f693421..f1c6c7e 100644
--- a/hw/syborg_serial.c
+++ b/hw/syborg_serial.c
@@ -344,13 +344,8 @@ static SysBusDeviceInfo syborg_serial_info = {
.qdev.name = "syborg,serial",
.qdev.size = sizeof(SyborgSerialState),
.qdev.props = (Property[]) {
- {
- .name = "fifo-size",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgSerialState, fifo_size),
- .defval = (uint32_t[]) { 16 },
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("fifo-size", SyborgSerialState, fifo_size, 16),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 26/32] qdev/prop: convert syborg_timer.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (24 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 25/32] qdev/prop: convert syborg_serial.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 27/32] qdev/prop: convert tcx.c " Gerd Hoffmann
` (5 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/syborg_timer.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/syborg_timer.c b/hw/syborg_timer.c
index cf96c5f..f64b824 100644
--- a/hw/syborg_timer.c
+++ b/hw/syborg_timer.c
@@ -230,12 +230,8 @@ static SysBusDeviceInfo syborg_timer_info = {
.qdev.name = "syborg,timer",
.qdev.size = sizeof(SyborgTimerState),
.qdev.props = (Property[]) {
- {
- .name = "frequency",
- .info = &qdev_prop_uint32,
- .offset = offsetof(SyborgTimerState, freq),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("frequency",SyborgTimerState, freq, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 27/32] qdev/prop: convert tcx.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (25 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 26/32] qdev/prop: convert syborg_timer.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 28/32] qdev/prop: convert vga.c " Gerd Hoffmann
` (4 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/tcx.c | 33 ++++++---------------------------
1 files changed, 6 insertions(+), 27 deletions(-)
diff --git a/hw/tcx.c b/hw/tcx.c
index c592524..e6c1824 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -679,33 +679,12 @@ static SysBusDeviceInfo tcx_info = {
.qdev.name = "SUNW,tcx",
.qdev.size = sizeof(TCXState),
.qdev.props = (Property[]) {
- {
- .name = "addr",
- .info = &qdev_prop_taddr,
- .offset = offsetof(TCXState, addr),
- .defval = (target_phys_addr_t[]) { -1 },
- },{
- .name = "vram_size",
- .info = &qdev_prop_hex32,
- .offset = offsetof(TCXState, vram_size),
- .defval = (uint32_t[]) { -1 },
- },{
- .name = "width",
- .info = &qdev_prop_uint16,
- .offset = offsetof(TCXState, width),
- .defval = (uint16_t[]) { -1 },
- },{
- .name = "height",
- .info = &qdev_prop_uint16,
- .offset = offsetof(TCXState, height),
- .defval = (uint16_t[]) { -1 },
- },{
- .name = "depth",
- .info = &qdev_prop_uint16,
- .offset = offsetof(TCXState, depth),
- .defval = (uint16_t[]) { -1 },
- },
- {/* end of list */}
+ DEFINE_PROP_TADDR("addr", TCXState, addr, -1),
+ DEFINE_PROP_HEX32("vram_size", TCXState, vram_size, -1),
+ DEFINE_PROP_UINT16("width", TCXState, width, -1),
+ DEFINE_PROP_UINT16("height", TCXState, height, -1),
+ DEFINE_PROP_UINT16("depth", TCXState, depth, -1),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 28/32] qdev/prop: convert vga.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (26 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 27/32] qdev/prop: convert tcx.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 29/32] qdev/prop: convert virtio-pci.c " Gerd Hoffmann
` (3 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/vga.c | 13 +++----------
hw/vga_int.h | 4 ++--
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/hw/vga.c b/hw/vga.c
index 4d74ffe..25e5d6c 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2533,16 +2533,9 @@ static PCIDeviceInfo vga_info = {
.init = pci_vga_initfn,
.config_write = pci_vga_write_config,
.qdev.props = (Property[]) {
- {
- .name = "bios-offset",
- .info = &qdev_prop_hex32,
- .offset = offsetof(PCIVGAState, vga_state.bios_offset),
- },{
- .name = "bios-size",
- .info = &qdev_prop_hex32,
- .offset = offsetof(PCIVGAState, vga_state.bios_size),
- },
- {/* end of list */}
+ DEFINE_PROP_HEX32("bios-offset", PCIVGAState, vga_state.bios_offset, 0),
+ DEFINE_PROP_HEX32("bios-size", PCIVGAState, vga_state.bios_size, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
diff --git a/hw/vga_int.h b/hw/vga_int.h
index 631b1b0..651e6f3 100644
--- a/hw/vga_int.h
+++ b/hw/vga_int.h
@@ -107,8 +107,8 @@ typedef struct VGACommonState {
uint32_t map_addr;
uint32_t map_end;
uint32_t lfb_vram_mapped; /* whether 0xa0000 is mapped as ram */
- unsigned long bios_offset;
- unsigned int bios_size;
+ uint32_t bios_offset;
+ uint32_t bios_size;
int it_shift;
PCIDevice *pci_dev;
uint32_t latch;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 29/32] qdev/prop: convert virtio-pci.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (27 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 28/32] qdev/prop: convert vga.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 30/32] qdev/prop: convert xilinx_ethlite.c " Gerd Hoffmann
` (2 subsequent siblings)
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/virtio-pci.c | 26 +++++++-------------------
1 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 703f4fe..d05970f 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -498,37 +498,25 @@ static PCIDeviceInfo virtio_info[] = {
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_blk_init_pci,
.qdev.props = (Property[]) {
- {
- .name = "class",
- .info = &qdev_prop_hex32,
- .offset = offsetof(VirtIOPCIProxy, class_code),
- },
- {/* end of list */}
+ DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
+ DEFINE_PROP_END_OF_LIST(),
},
},{
.qdev.name = "virtio-net-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_net_init_pci,
.qdev.props = (Property[]) {
- {
- .name = "vectors",
- .info = &qdev_prop_uint32,
- .offset = offsetof(VirtIOPCIProxy, nvectors),
- .defval = (uint32_t[]) { NIC_NVECTORS_UNSPECIFIED },
- },
- {/* end of list */}
+ DEFINE_PROP_HEX32("vectors", VirtIOPCIProxy, nvectors,
+ NIC_NVECTORS_UNSPECIFIED),
+ DEFINE_PROP_END_OF_LIST(),
},
},{
.qdev.name = "virtio-console-pci",
.qdev.size = sizeof(VirtIOPCIProxy),
.init = virtio_console_init_pci,
.qdev.props = (Property[]) {
- {
- .name = "class",
- .info = &qdev_prop_hex32,
- .offset = offsetof(VirtIOPCIProxy, class_code),
- },
- {/* end of list */}
+ DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
+ DEFINE_PROP_END_OF_LIST(),
},
},{
.qdev.name = "virtio-balloon-pci",
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 30/32] qdev/prop: convert xilinx_ethlite.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (28 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 29/32] qdev/prop: convert virtio-pci.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 31/32] qdev/prop: convert xilinx_intc.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 32/32] qdev/prop: convert xilinx_timer.c " Gerd Hoffmann
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/xilinx_ethlite.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
index b3fd25b..f981d10 100644
--- a/hw/xilinx_ethlite.c
+++ b/hw/xilinx_ethlite.c
@@ -228,18 +228,9 @@ static SysBusDeviceInfo xilinx_ethlite_info = {
.qdev.name = "xilinx,ethlite",
.qdev.size = sizeof(struct xlx_ethlite),
.qdev.props = (Property[]) {
- {
- .name = "txpingpong",
- .info = &qdev_prop_uint32,
- .offset = offsetof(struct xlx_ethlite, c_tx_pingpong),
- .defval = (uint32_t[]) { 1 },
- },{
- .name = "rxpingpong",
- .info = &qdev_prop_uint32,
- .offset = offsetof(struct xlx_ethlite, c_rx_pingpong),
- .defval = (uint32_t[]) { 1 },
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("txpingpong", struct xlx_ethlite, c_tx_pingpong, 1),
+ DEFINE_PROP_UINT32("rxpingpong", struct xlx_ethlite, c_rx_pingpong, 1),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 31/32] qdev/prop: convert xilinx_intc.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (29 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 30/32] qdev/prop: convert xilinx_ethlite.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 32/32] qdev/prop: convert xilinx_timer.c " Gerd Hoffmann
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/xilinx_intc.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/xilinx_intc.c b/hw/xilinx_intc.c
index 3f08bf8..7fadad5 100644
--- a/hw/xilinx_intc.c
+++ b/hw/xilinx_intc.c
@@ -162,12 +162,8 @@ static SysBusDeviceInfo xilinx_intc_info = {
.qdev.name = "xilinx,intc",
.qdev.size = sizeof(struct xlx_pic),
.qdev.props = (Property[]) {
- {
- .name = "kind-of-intr",
- .info = &qdev_prop_uint32,
- .offset = offsetof(struct xlx_pic, c_kind_of_intr),
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("kind-of-intr", struct xlx_pic, c_kind_of_intr, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [Qemu-devel] [PATCH 32/32] qdev/prop: convert xilinx_timer.c to helper macros.
2009-08-03 15:35 [Qemu-devel] [PATCH 00/32] qdev: macros for creating typechecked properties Gerd Hoffmann
` (30 preceding siblings ...)
2009-08-03 15:35 ` [Qemu-devel] [PATCH 31/32] qdev/prop: convert xilinx_intc.c " Gerd Hoffmann
@ 2009-08-03 15:35 ` Gerd Hoffmann
31 siblings, 0 replies; 35+ messages in thread
From: Gerd Hoffmann @ 2009-08-03 15:35 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/xilinx_timer.c | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/hw/xilinx_timer.c b/hw/xilinx_timer.c
index efb6a04..196f011 100644
--- a/hw/xilinx_timer.c
+++ b/hw/xilinx_timer.c
@@ -219,18 +219,9 @@ static SysBusDeviceInfo xilinx_timer_info = {
.qdev.name = "xilinx,timer",
.qdev.size = sizeof(struct timerblock),
.qdev.props = (Property[]) {
- {
- .name = "frequency",
- .info = &qdev_prop_uint32,
- .offset = offsetof(struct timerblock, freq_hz),
- .defval = (uint32_t[]) { 2 },
- },{
- .name = "nr-timers",
- .info = &qdev_prop_uint32,
- .offset = offsetof(struct timerblock, nr_timers),
- .defval = (uint32_t[]) { 2 },
- },
- {/* end of list */}
+ DEFINE_PROP_UINT32("frequency", struct timerblock, freq_hz, 0),
+ DEFINE_PROP_UINT32("nr-timers", struct timerblock, nr_timers, 0),
+ DEFINE_PROP_END_OF_LIST(),
}
};
--
1.6.2.5
^ permalink raw reply related [flat|nested] 35+ messages in thread