From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXzaI-0002ZM-8Z for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:36:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXza0-0002Ae-Ox for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:36:10 -0400 Received: from [199.232.76.173] (port=39452 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXzZz-00029L-Or for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:36:03 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42785) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXzZz-0004g2-6L for qemu-devel@nongnu.org; Mon, 03 Aug 2009 11:36:03 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n73Fa2Zw001536 for ; Mon, 3 Aug 2009 11:36:02 -0400 From: Gerd Hoffmann Date: Mon, 3 Aug 2009 17:35:31 +0200 Message-Id: <1249313748-6459-16-git-send-email-kraxel@redhat.com> In-Reply-To: <1249313748-6459-1-git-send-email-kraxel@redhat.com> References: <1249313748-6459-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 15/32] qdev/prop: convert slavio_intctl.c to helper macros. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/slavio_intctl.c | 16 +++++----------- 1 files changed, 5 insertions(+), 11 deletions(-) diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c index 188511e..01a7624 100644 --- a/hw/slavio_intctl.c +++ b/hw/slavio_intctl.c @@ -68,6 +68,7 @@ typedef struct SLAVIO_INTCTLState { #endif qemu_irq cpu_irqs[MAX_CPUS][MAX_PILS]; const uint32_t *intbit_to_level; + void *i_to_l; uint32_t cputimer_lbit, cputimer_mbit; uint32_t cputimer_bit; uint32_t pil_out[MAX_CPUS]; @@ -392,6 +393,7 @@ static void slavio_intctl_init1(SysBusDevice *dev) int io_memory; unsigned int i, j; + s->intbit_to_level = s->i_to_l; /* hack alert: ptr property */ qdev_init_gpio_in(&dev->qdev, slavio_set_irq_all, 32 + MAX_CPUS); io_memory = cpu_register_io_memory(slavio_intctlm_mem_read, slavio_intctlm_mem_write, s); @@ -450,17 +452,9 @@ static SysBusDeviceInfo slavio_intctl_info = { .qdev.name = "slavio_intctl", .qdev.size = sizeof(SLAVIO_INTCTLState), .qdev.props = (Property[]) { - { - .name = "intbit_to_level", - .info = &qdev_prop_ptr, - .offset = offsetof(SLAVIO_INTCTLState, intbit_to_level), - }, - { - .name = "cputimer_bit", - .info = &qdev_prop_uint32, - .offset = offsetof(SLAVIO_INTCTLState, cputimer_bit), - }, - {/* end of property list */} + DEFINE_PROP_PTR("intbit_to_level", SLAVIO_INTCTLState, i_to_l), + DEFINE_PROP_UINT32("cputimer_bit", SLAVIO_INTCTLState, cputimer_bit, 0), + DEFINE_PROP_END_OF_LIST(), } }; -- 1.6.2.5