From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UosXX-0004qG-EW for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:49:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UosXV-0007Ce-Lc for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:49:27 -0400 Received: from mail-pb0-x22b.google.com ([2607:f8b0:400e:c01::22b]:38696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UosXV-0007CU-Fd for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:49:25 -0400 Received: by mail-pb0-f43.google.com with SMTP id md12so3772048pbc.16 for ; Tue, 18 Jun 2013 02:49:24 -0700 (PDT) Sender: Peter Crosthwaite From: peter.crosthwaite@xilinx.com Date: Tue, 18 Jun 2013 19:43:11 +1000 Message-Id: Subject: [Qemu-devel] [RFC PATCH v1 0/7] QOM Super class access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, mst@redhat.com, pbonzini@redhat.com, edgar.iglesias@gmail.com, afaerber@suse.de From: Peter Crosthwaite 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