From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPoUN-0007hr-CX for qemu-devel@nongnu.org; Mon, 23 Feb 2015 03:35:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPoUD-0006ak-Pk for qemu-devel@nongnu.org; Mon, 23 Feb 2015 03:35:39 -0500 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:55182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPoUC-0006Yn-UI for qemu-devel@nongnu.org; Mon, 23 Feb 2015 03:35:29 -0500 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Feb 2015 18:35:26 +1000 From: Alexey Kardashevskiy Date: Mon, 23 Feb 2015 19:33:55 +1100 Message-Id: <1424680440-10913-6-git-send-email-aik@ozlabs.ru> In-Reply-To: <1424680440-10913-1-git-send-email-aik@ozlabs.ru> References: <1424680440-10913-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH 05/10] spapr_pci: Define default DMA window size as a macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf This gets rid of a magic constant describing the default DMA window size for an emulated PHB. Signed-off-by: Alexey Kardashevskiy --- hw/ppc/spapr_pci.c | 6 +++--- include/hw/pci-host/spapr.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 388fd53..130c532 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -641,11 +641,11 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) static void spapr_phb_finish_realize(sPAPRPHBState *sphb, Error **errp) { sPAPRTCETable *tcet; + uint32_t nb_table; + nb_table = SPAPR_PCI_DMA32_SIZE >> SPAPR_TCE_PAGE_SHIFT; tcet = spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn, - 0, - SPAPR_TCE_PAGE_SHIFT, - 0x40000000 >> SPAPR_TCE_PAGE_SHIFT, false); + 0, SPAPR_TCE_PAGE_SHIFT, nb_table, false); if (!tcet) { error_setg(errp, "Unable to create TCE table for %s", sphb->dtbusname); diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index d725f0e..718bf59 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -110,6 +110,8 @@ struct sPAPRPHBVFIOState { #define SPAPR_PCI_MSI_WINDOW 0x40000000000ULL +#define SPAPR_PCI_DMA32_SIZE 0x40000000 + static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRPHBState *phb, int pin) { return xics_get_qirq(spapr->icp, phb->lsi_table[pin].irq); -- 2.0.0