From patchwork Tue May 24 11:45:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 97148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 59219B6FA8 for ; Tue, 24 May 2011 21:46:10 +1000 (EST) Received: from localhost ([::1]:56147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOq3r-0008SC-H2 for incoming@patchwork.ozlabs.org; Tue, 24 May 2011 07:46:07 -0400 Received: from eggs.gnu.org ([140.186.70.92]:37639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOq3X-0008MX-8P for qemu-devel@nongnu.org; Tue, 24 May 2011 07:45:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOq3W-0004Zm-2V for qemu-devel@nongnu.org; Tue, 24 May 2011 07:45:47 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:38611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOq3V-0004ZT-Tz for qemu-devel@nongnu.org; Tue, 24 May 2011 07:45:46 -0400 Received: by pvg3 with SMTP id 3so3579545pvg.4 for ; Tue, 24 May 2011 04:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references; bh=v+xr+C+Oq7qif+0IJRXbAP7O7TU+utbnMk8niZcDWIE=; b=aptn9gUDCqp/bWGZPiH6Tjg2J4eoEsniHbuxVmfprLzA7yRDVicrqJysLEP2Z6ULHJ yyn7lbGUU0CT7QtajMwM9W3v/gKJtEp/eaNolKolR7A8k0CvBUNgmr04JDuQSmgIm/BD 8B31QC9/8EeRlG0LW1AZOw3kvtWFq4e0BJ5Cw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=EK5uG1aabvQUtrk7kc4lc5yfq4eXIaqeIAmrNgjAiE1ysnSu0BOgG9QPDWaTLEmaYN ec0mLFBlvpF1SiT96o5eofHrcpczjN9Tb/iT1IeD6Hh69dgYCcoy/Ffk8kmrbmPJa+ai 8qc7uOsZRJXuq2SD3hRiO4NOZs+Acb6Op5Ig8= Received: by 10.68.17.202 with SMTP id q10mr731729pbd.76.1306237545091; Tue, 24 May 2011 04:45:45 -0700 (PDT) Received: from localhost.localdomain (93-34-184-88.ip51.fastwebnet.it [93.34.184.88]) by mx.google.com with ESMTPS id y7sm4961185pbg.43.2011.05.24.04.45.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2011 04:45:44 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 24 May 2011 13:45:06 +0200 Message-Id: <1306237507-19189-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1306237507-19189-1-git-send-email-pbonzini@redhat.com> References: <1306237507-19189-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.173 Cc: agraf@suse.de, david@gibson.dropbear.id.au Subject: [Qemu-devel] [PATCH 2/3] spapr: prepare for qdevification of irq X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Restructure common properties for sPAPR devices so that IRQ definitions can be added in one place. Signed-off-by: Paolo Bonzini Cc: Alexander Graf Cc: David Gibson --- hw/spapr_llan.c | 4 +--- hw/spapr_vio.h | 5 +++++ hw/spapr_vscsi.c | 4 +--- hw/spapr_vty.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c index 2597748..abe1297 100644 --- a/hw/spapr_llan.c +++ b/hw/spapr_llan.c @@ -495,9 +495,7 @@ static VIOsPAPRDeviceInfo spapr_vlan = { .qdev.name = "spapr-vlan", .qdev.size = sizeof(VIOsPAPRVLANDevice), .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("reg", VIOsPAPRDevice, reg, 0x1000), - DEFINE_PROP_UINT32("dma-window", VIOsPAPRDevice, rtce_window_size, - 0x10000000), + DEFINE_SPAPR_PROPERTIES(VIOsPAPRVLANDevice, sdev, 0x1000, 0x10000000), DEFINE_NIC_PROPERTIES(VIOsPAPRVLANDevice, nicconf), DEFINE_PROP_END_OF_LIST(), }, diff --git a/hw/spapr_vio.h b/hw/spapr_vio.h index faa5d94..7eb5367 100644 --- a/hw/spapr_vio.h +++ b/hw/spapr_vio.h @@ -60,6 +60,11 @@ typedef struct VIOsPAPRDevice { VIOsPAPR_CRQ crq; } VIOsPAPRDevice; +#define DEFINE_SPAPR_PROPERTIES(type, field, default_reg, default_dma_window) \ + DEFINE_PROP_UINT32("reg", type, field.reg, default_reg), \ + DEFINE_PROP_UINT32("dma-window", type, field.rtce_window_size, \ + default_dma_window) + typedef struct VIOsPAPRBus { BusState bus; int irq; diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c index 89f7ce2..bbe32f9 100644 --- a/hw/spapr_vscsi.c +++ b/hw/spapr_vscsi.c @@ -931,9 +931,7 @@ static VIOsPAPRDeviceInfo spapr_vscsi = { .qdev.name = "spapr-vscsi", .qdev.size = sizeof(VSCSIState), .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("reg", VIOsPAPRDevice, reg, 0x2000), - DEFINE_PROP_UINT32("dma-window", VIOsPAPRDevice, - rtce_window_size, 0x10000000), + DEFINE_SPAPR_PROPERTIES(VSCSIState, vdev, 0x2000, 0x10000000), DEFINE_PROP_END_OF_LIST(), }, }; diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c index fa97cf7..abc41f8 100644 --- a/hw/spapr_vty.c +++ b/hw/spapr_vty.c @@ -140,7 +140,7 @@ static VIOsPAPRDeviceInfo spapr_vty = { .qdev.name = "spapr-vty", .qdev.size = sizeof(VIOsPAPRVTYDevice), .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("reg", VIOsPAPRDevice, reg, 0), + DEFINE_SPAPR_PROPERTIES(VIOsPAPRVTYDevice, sdev, 0, 0), DEFINE_PROP_CHR("chardev", VIOsPAPRVTYDevice, chardev), DEFINE_PROP_END_OF_LIST(), },