qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH v1 0/7]  QOM Super class access
@ 2013-06-18  9:43 peter.crosthwaite
  2013-06-18  9:44 ` [Qemu-devel] [RFC PATCH v1 1/7] target-arm/cpu.c: delete un-needed instance/class sizes peter.crosthwaite
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: peter.crosthwaite @ 2013-06-18  9:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: peter.maydell, aliguori, mst, pbonzini, edgar.iglesias, afaerber

From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>


This series enables QOM super class access and demostrates some usages.
Replaces the save->override->call via FooClass technique, to reduce
some of the boiler plate in recently fully QOMified devices.

Applied the change to ARM CPU, MB CPU and some of Andreas's recently
QOMified i386 devices, all which have the save->override->call issue.
ARMCPU I've done a brief test on and seems to work.

ARM CPU was particularly difficult, as it has 3 layers of heirachy,
where a non-concrete class (TYPE_ARM_CPU) need to super class itself
(to TYPE_CPU). This sees the need for super-classers to specify their
expected base class level. See patches for illustration.

The main future work to the series is to apply the change pattern to
the reset of the tree


Peter Crosthwaite (7):
  target-arm/cpu.c: delete un-needed instance/class sizes
  qom: Add super class accessor
  qdev-core: Introduce DEVICE super class cast macros
  qom/cpu: Introduce CPU super class cast macros
  target-arm: Remove ARMCPUClass
  target-microblaze: Remove MicroblazeCPUClass
  i8254: Remove [KVM]PITClass

 hw/i386/kvm/i8254.c         | 17 ++---------------
 hw/timer/i8254.c            | 16 ++--------------
 include/hw/qdev-core.h      |  4 ++++
 include/qom/cpu.h           |  4 ++++
 include/qom/object.h        | 18 ++++++++++++++++++
 qom/object.c                | 15 +++++++++++++++
 target-arm/cpu-qom.h        | 20 --------------------
 target-arm/cpu.c            | 16 +++++-----------
 target-microblaze/cpu-qom.h | 20 --------------------
 target-microblaze/cpu.c     | 13 ++++---------
 10 files changed, 54 insertions(+), 89 deletions(-)

-- 
1.8.3.rc1.44.gb387c77.dirty

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-06-19  1:45 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18  9:43 [Qemu-devel] [RFC PATCH v1 0/7] QOM Super class access peter.crosthwaite
2013-06-18  9:44 ` [Qemu-devel] [RFC PATCH v1 1/7] target-arm/cpu.c: delete un-needed instance/class sizes peter.crosthwaite
2013-06-18  9:58   ` Andreas Färber
2013-06-18  9:44 ` [Qemu-devel] [RFC PATCH v1 2/7] qom: Add super class accessor peter.crosthwaite
2013-06-18  9:45 ` [Qemu-devel] [RFC PATCH v1 3/7] qdev-core: Introduce DEVICE super class cast macros peter.crosthwaite
2013-06-18 10:12   ` Michael S. Tsirkin
2013-06-18  9:46 ` [Qemu-devel] [RFC PATCH v1 4/7] qom/cpu: Introduce CPU " peter.crosthwaite
2013-06-18  9:47 ` [Qemu-devel] [RFC PATCH v1 5/7] target-arm: Remove ARMCPUClass peter.crosthwaite
2013-06-18  9:47 ` [Qemu-devel] [RFC PATCH v1 6/7] target-microblaze: Remove MicroblazeCPUClass peter.crosthwaite
2013-06-18  9:48 ` [Qemu-devel] [RFC PATCH v1 7/7] i8254: Remove [KVM]PITClass peter.crosthwaite
2013-06-18 10:12 ` [Qemu-devel] [RFC PATCH v1 0/7] QOM Super class access Andreas Färber
2013-06-18 10:20   ` Peter Crosthwaite
2013-06-18 10:23 ` Michael S. Tsirkin
2013-06-18 10:35   ` Peter Crosthwaite
2013-06-18 10:39     ` Michael S. Tsirkin
2013-06-18 10:44       ` Peter Crosthwaite
2013-06-18 10:48         ` Michael S. Tsirkin
2013-06-18 10:45       ` Andreas Färber
2013-06-18 10:41   ` Andreas Färber
2013-06-18 10:45     ` Michael S. Tsirkin
2013-06-19  1:44     ` Hu Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).