qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qom-next v2 0/5]  QOM Super class access
@ 2013-07-11  1:45 peter.crosthwaite
  2013-07-11  1:45 ` [Qemu-devel] [PATCH qom-next v2 1/5] target-arm/cpu.c: delete un-needed instance/class sizes peter.crosthwaite
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: peter.crosthwaite @ 2013-07-11  1:45 UTC (permalink / raw)
  To: afaerber; +Cc: hutao, aliguori, qemu-devel, mst

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

changed since V1:
Simplified to use object_class_get_parent_by_type (suggest by Hu Tao)


Peter Crosthwaite (5):
  target-arm/cpu.c: delete un-needed instance/class sizes
  qom/object: Add object_class_get_parent_by_name
  target-arm: Use parent classes for reset + realize
  target-microblaze: Use parent class for reset + realize
  i8254: Use parent class for realize

 hw/i386/kvm/i8254.c         | 18 +++---------------
 hw/timer/i8254.c            | 17 +++--------------
 include/qom/object.h        |  9 +++++++++
 qom/object.c                |  5 +++++
 target-arm/cpu-qom.h        | 20 --------------------
 target-arm/cpu.c            | 18 +++++++-----------
 target-microblaze/cpu-qom.h | 20 --------------------
 target-microblaze/cpu.c     | 16 ++++++----------
 8 files changed, 33 insertions(+), 90 deletions(-)

-- 
1.8.3.rc1.44.gb387c77.dirty

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

end of thread, other threads:[~2013-07-15  2:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-11  1:45 [Qemu-devel] [PATCH qom-next v2 0/5] QOM Super class access peter.crosthwaite
2013-07-11  1:45 ` [Qemu-devel] [PATCH qom-next v2 1/5] target-arm/cpu.c: delete un-needed instance/class sizes peter.crosthwaite
2013-07-11  8:07   ` Andreas Färber
2013-07-11  8:18     ` Peter Maydell
2013-07-11  1:46 ` [Qemu-devel] [PATCH qom-next v2 2/5] qom/object: Add object_class_get_parent_by_name peter.crosthwaite
2013-07-11  1:47 ` [Qemu-devel] [PATCH qom-next v2 3/5] target-arm: Use parent classes for reset + realize peter.crosthwaite
2013-07-11  9:47   ` Igor Mammedov
2013-07-11 10:31     ` Michael S. Tsirkin
2013-07-11 10:36       ` Andreas Färber
2013-07-15  2:53         ` Peter Crosthwaite
2013-07-11 10:48       ` Igor Mammedov
2013-07-12  0:30     ` Peter Crosthwaite
2013-07-11  1:47 ` [Qemu-devel] [PATCH qom-next v2 4/5] target-microblaze: Use parent class " peter.crosthwaite
2013-07-11  1:48 ` [Qemu-devel] [PATCH qom-next v2 5/5] i8254: Use parent class for realize peter.crosthwaite

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).