From patchwork Thu Sep 4 06:06:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 385742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D26B6140217 for ; Thu, 4 Sep 2014 16:13:16 +1000 (EST) Received: from localhost ([::1]:48956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPQIE-0006Ti-KA for incoming@patchwork.ozlabs.org; Thu, 04 Sep 2014 02:13:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPQCE-0003g1-Ty for qemu-devel@nongnu.org; Thu, 04 Sep 2014 02:07:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPQBz-0004Ih-6R for qemu-devel@nongnu.org; Thu, 04 Sep 2014 02:07:02 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:56564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPQBy-0004Gy-3n for qemu-devel@nongnu.org; Thu, 04 Sep 2014 02:06:47 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 Sep 2014 11:36:42 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp01.in.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 4 Sep 2014 11:36:41 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 2FEF91258071 for ; Thu, 4 Sep 2014 11:37:01 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s84672lA4718972 for ; Thu, 4 Sep 2014 11:37:03 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8466TBV017393 for ; Thu, 4 Sep 2014 11:36:29 +0530 Received: from bharata.in.ibm.com ([9.193.66.19]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s8466Rdk017213; Thu, 4 Sep 2014 11:36:28 +0530 From: Bharata B Rao To: qemu-devel@nongnu.org Date: Thu, 4 Sep 2014 11:36:12 +0530 Message-Id: <1409810785-12391-3-git-send-email-bharata@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1409810785-12391-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1409810785-12391-1-git-send-email-bharata@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14090406-4790-0000-0000-0000039C53FF X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 122.248.162.1 Cc: mdroth@linux.vnet.ibm.com, Bharata B Rao Subject: [Qemu-devel] [RFC PATCH v0 02/15] ppc: Rename SPAPR_DRC_TABLE_SIZE to SPAPR_DRC_PHB_TABLE_SIZE 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 DRC table could contain entries for both PHB and CPU types. The existing size of this table is only for PHB entries, reflect the same in the code. This patch doesn't change the code functionality. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 26 +++++++++++++------------- include/hw/ppc/spapr.h | 8 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 47fc21d..071d65b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -300,7 +300,7 @@ sPAPRDrcEntry *spapr_phb_to_drc_entry(uint64_t buid) { int i; - for (i = 0; i < SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { if (spapr->drc_table[i].phb_buid == buid) { return &spapr->drc_table[i]; } @@ -313,7 +313,7 @@ sPAPRDrcEntry *spapr_find_drc_entry(int drc_index) { int i, j; - for (i = 0; i < SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { sPAPRDrcEntry *phb_entry = &spapr->drc_table[i]; if (phb_entry->drc_index == drc_index) { return phb_entry; @@ -339,7 +339,7 @@ static void spapr_init_drc_table(void) memset(spapr->drc_table, 0, sizeof(spapr->drc_table)); /* For now we only care about PHB entries */ - for (i = 0; i < SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { spapr->drc_table[i].drc_index = 0x2000001 + i; } } @@ -350,7 +350,7 @@ sPAPRDrcEntry *spapr_add_phb_to_drc_table(uint64_t buid, uint32_t state) sPAPRDrcEntry *found_drc = NULL; int i, phb_index; - for (i = 0; i < SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { if (spapr->drc_table[i].phb_buid == 0) { empty_drc = &spapr->drc_table[i]; } @@ -388,7 +388,7 @@ sPAPRDrcEntry *spapr_add_phb_to_drc_table(uint64_t buid, uint32_t state) static void spapr_create_drc_dt_entries(void *fdt) { char char_buf[1024]; - uint32_t int_buf[SPAPR_DRC_TABLE_SIZE + 1]; + uint32_t int_buf[SPAPR_DRC_PHB_TABLE_SIZE + 1]; uint32_t *entries; int offset, fdt_offset; int i, ret; @@ -397,9 +397,9 @@ static void spapr_create_drc_dt_entries(void *fdt) /* ibm,drc-indexes */ memset(int_buf, 0, sizeof(int_buf)); - int_buf[0] = SPAPR_DRC_TABLE_SIZE; + int_buf[0] = SPAPR_DRC_PHB_TABLE_SIZE; - for (i = 1; i <= SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 1; i <= SPAPR_DRC_PHB_TABLE_SIZE; i++) { int_buf[i] = spapr->drc_table[i-1].drc_index; } @@ -411,9 +411,9 @@ static void spapr_create_drc_dt_entries(void *fdt) /* ibm,drc-power-domains */ memset(int_buf, 0, sizeof(int_buf)); - int_buf[0] = SPAPR_DRC_TABLE_SIZE; + int_buf[0] = SPAPR_DRC_PHB_TABLE_SIZE; - for (i = 1; i <= SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 1; i <= SPAPR_DRC_PHB_TABLE_SIZE; i++) { int_buf[i] = 0xffffffff; } @@ -426,10 +426,10 @@ static void spapr_create_drc_dt_entries(void *fdt) /* ibm,drc-names */ memset(char_buf, 0, sizeof(char_buf)); entries = (uint32_t *)&char_buf[0]; - *entries = SPAPR_DRC_TABLE_SIZE; + *entries = SPAPR_DRC_PHB_TABLE_SIZE; offset = sizeof(*entries); - for (i = 0; i < SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { offset += sprintf(char_buf + offset, "PHB %d", i + 1); char_buf[offset++] = '\0'; } @@ -442,10 +442,10 @@ static void spapr_create_drc_dt_entries(void *fdt) /* ibm,drc-types */ memset(char_buf, 0, sizeof(char_buf)); entries = (uint32_t *)&char_buf[0]; - *entries = SPAPR_DRC_TABLE_SIZE; + *entries = SPAPR_DRC_PHB_TABLE_SIZE; offset = sizeof(*entries); - for (i = 0; i < SPAPR_DRC_TABLE_SIZE; i++) { + for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { offset += sprintf(char_buf + offset, "PHB"); char_buf[offset++] = '\0'; } diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index aab627f..9631aeb 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -11,9 +11,9 @@ struct sPAPRNVRAM; #define HPTE64_V_HPTE_DIRTY 0x0000000000000040ULL /* For dlparable/hotpluggable slots */ -#define SPAPR_DRC_TABLE_SIZE 32 -#define SPAPR_DRC_PHB_SLOT_MAX 32 -#define SPAPR_DRC_DEV_ID_BASE 0x40000000 +#define SPAPR_DRC_PHB_TABLE_SIZE 32 +#define SPAPR_DRC_PHB_SLOT_MAX 32 +#define SPAPR_DRC_DEV_ID_BASE 0x40000000 typedef struct sPAPRConfigureConnectorState { void *fdt; @@ -72,7 +72,7 @@ typedef struct sPAPREnvironment { int htab_fd; /* state for Dynamic Reconfiguration Connectors */ - sPAPRDrcEntry drc_table[SPAPR_DRC_TABLE_SIZE]; + sPAPRDrcEntry drc_table[SPAPR_DRC_PHB_TABLE_SIZE]; /* Platform state - sensors and indicators */ uint32_t state;