summaryrefslogtreecommitdiffstats
path: root/hw/display/tcx.c
diff options
context:
space:
mode:
authorAnthony Liguori2013-07-29 21:39:49 +0200
committerAnthony Liguori2013-07-29 21:39:49 +0200
commit6a4992d0bdeb38a57314d731d9846063b2057e6c (patch)
tree10d359f7bec5918dd1fc6d9a445213f3019d1929 /hw/display/tcx.c
parentMerge remote-tracking branch 'stefanha/block' into staging (diff)
parentsysbus: QOM parent field cleanup for SysBusDevice (diff)
downloadqemu-6a4992d0bdeb38a57314d731d9846063b2057e6c.tar.gz
qemu-6a4992d0bdeb38a57314d731d9846063b2057e6c.tar.xz
qemu-6a4992d0bdeb38a57314d731d9846063b2057e6c.zip
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
QOM device refactorings * Replace all uses of FROM_SYSBUS() macro with QOM cast macros i) "QOM cast cleanup for X" Indicates a mechanical 1:1 between TYPE_* and *State. ii) "QOM'ify X and Y" Indicates abstract types may have been inserted or similar changes to type hierarchy. ii) Renames Coding Style fixes such as CamelCase have been applied in some cases. * Fix for sparc floppy - cf. ii) above * Change PCI type hierarchy to provide PCI_BRIDGE() casts * In doing so, prepare for adopting QOM realize # gpg: Signature made Mon 29 Jul 2013 02:15:22 PM CDT using RSA key ID 3E7E013F # gpg: Can't check signature: public key not found # By Andreas Färber (171) and others # Via Andreas Färber * afaerber/tags/qom-devices-for-anthony: (173 commits) sysbus: QOM parent field cleanup for SysBusDevice spapr_pci: QOM cast cleanup ioapic: QOM cast cleanup kvm/ioapic: QOM cast cleanup kvmvapic: QOM cast cleanup mipsnet: QOM cast cleanup opencores_eth: QOM cast cleanup exynos4210_i2c: QOM cast cleanup sysbus: Remove unused sysbus_new() prototype sysbus: Drop FROM_SYSBUS() xilinx_timer: QOM cast cleanup tusb6010: QOM cast cleanup slavio_timer: QOM cast cleanup pxa2xx_timer: QOM'ify pxa25x-timer and pxa27x-timer puv3_ost: QOM cast cleanup pl031: QOM cast cleanup pl031: Rename pl031_state to PL031State milkymist-sysctl: QOM cast cleanup m48t59: QOM cast cleanup for M48t59SysBusState lm32_timer: QOM cast cleanup ...
Diffstat (limited to 'hw/display/tcx.c')
-rw-r--r--hw/display/tcx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 9fd48b5f8b..24876d33ef 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -34,8 +34,12 @@
#define TCX_THC_NREGS_24 0x1000
#define TCX_TEC_NREGS 0x1000
+#define TYPE_TCX "SUNW,tcx"
+#define TCX(obj) OBJECT_CHECK(TCXState, (obj), TYPE_TCX)
+
typedef struct TCXState {
- SysBusDevice busdev;
+ SysBusDevice parent_obj;
+
QemuConsole *con;
uint8_t *vram;
uint32_t *vram24, *cplane;
@@ -423,7 +427,7 @@ static const VMStateDescription vmstate_tcx = {
static void tcx_reset(DeviceState *d)
{
- TCXState *s = container_of(d, TCXState, busdev.qdev);
+ TCXState *s = TCX(d);
/* Initialize palette */
memset(s->r, 0, 256);
@@ -523,7 +527,7 @@ static const GraphicHwOps tcx24_ops = {
static int tcx_init1(SysBusDevice *dev)
{
- TCXState *s = FROM_SYSBUS(TCXState, dev);
+ TCXState *s = TCX(dev);
ram_addr_t vram_offset = 0;
int size;
uint8_t *vram_base;
@@ -609,7 +613,7 @@ static void tcx_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo tcx_info = {
- .name = "SUNW,tcx",
+ .name = TYPE_TCX,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(TCXState),
.class_init = tcx_class_init,