qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 16/32] qdev/prop: convert slavio_timer.c to helper macros.
Date: Mon,  3 Aug 2009 17:35:32 +0200	[thread overview]
Message-ID: <1249313748-6459-17-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1249313748-6459-1-git-send-email-kraxel@redhat.com>


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

  parent reply	other threads:[~2009-08-03 15:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` [Qemu-devel] [PATCH 03/32] qdev/prop: convert pci.c to helper macros Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 04/32] qdev/prop: convert arm_sysctl.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 05/32] qdev/prop: convert armv7m.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 06/32] qdev/prop: convert eccmemctl.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 07/32] qdev/prop: convert escc.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 08/32] qdev/prop: convert etraxfs_pic.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 09/32] qdev/prop: convert i2c.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 10/32] qdev/prop: convert integratorcp.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 11/32] qdev/prop: convert iommu.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 12/32] qdev/prop: convert m48t59.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 13/32] qdev/prop: convert pcnet.c " Gerd Hoffmann
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
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 [this message]
2009-08-03 15:35 ` [Qemu-devel] [PATCH 17/32] qdev/prop: convert smbus_eeprom.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 18/32] qdev/prop: convert sparc32_dma.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 19/32] qdev/prop: convert sun4m.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 20/32] qdev/prop: convert sun4u.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 21/32] qdev/prop: convert syborg_fb.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 22/32] qdev/prop: convert syborg_interrupt.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 23/32] qdev/prop: convert syborg_keyboard.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 24/32] qdev/prop: convert syborg_pointer.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 25/32] qdev/prop: convert syborg_serial.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 26/32] qdev/prop: convert syborg_timer.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 27/32] qdev/prop: convert tcx.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 28/32] qdev/prop: convert vga.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 29/32] qdev/prop: convert virtio-pci.c " Gerd Hoffmann
2009-08-03 15:35 ` [Qemu-devel] [PATCH 30/32] qdev/prop: convert xilinx_ethlite.c " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1249313748-6459-17-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).