From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPQCC-0003fs-TI for qemu-devel@nongnu.org; Thu, 04 Sep 2014 02:07:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPQBy-0004Ht-Bo for qemu-devel@nongnu.org; Thu, 04 Sep 2014 02:07:00 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:49726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPQBx-0004Gj-7Z for qemu-devel@nongnu.org; Thu, 04 Sep 2014 02:06:46 -0400 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; 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 2A90D1258063 for ; Thu, 4 Sep 2014 11:36:57 +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 s8466wqg590196 for ; Thu, 4 Sep 2014 11:36:58 +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 s8466Uf7017500 for ; Thu, 4 Sep 2014 11:36:30 +0530 From: Bharata B Rao Date: Thu, 4 Sep 2014 11:36:14 +0530 Message-Id: <1409810785-12391-5-git-send-email-bharata@linux.vnet.ibm.com> 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> Subject: [Qemu-devel] [RFC PATCH v0 04/15] ppc: Make creation of DRC entries in FDT endian safe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, Bharata B Rao Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 29b7de4..bdbda1f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -397,10 +397,10 @@ static void spapr_create_drc_dt_entries(void *fdt) /* ibm,drc-indexes */ memset(int_buf, 0, sizeof(int_buf)); - int_buf[0] = SPAPR_DRC_PHB_TABLE_SIZE; + int_buf[0] = cpu_to_be32(SPAPR_DRC_PHB_TABLE_SIZE); for (i = 1; i <= SPAPR_DRC_PHB_TABLE_SIZE; i++) { - int_buf[i] = spapr->drc_table[i-1].drc_index; + int_buf[i] = cpu_to_be32(spapr->drc_table[i-1].drc_index); } ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-indexes", int_buf, @@ -411,10 +411,10 @@ 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_PHB_TABLE_SIZE; + int_buf[0] = cpu_to_be32(SPAPR_DRC_PHB_TABLE_SIZE); for (i = 1; i <= SPAPR_DRC_PHB_TABLE_SIZE; i++) { - int_buf[i] = 0xffffffff; + int_buf[i] = cpu_to_be32(0xffffffff); } ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-power-domains", int_buf, @@ -426,7 +426,7 @@ 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_PHB_TABLE_SIZE; + *entries = cpu_to_be32(SPAPR_DRC_PHB_TABLE_SIZE); offset = sizeof(*entries); for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { @@ -442,7 +442,7 @@ 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_PHB_TABLE_SIZE; + *entries = cpu_to_be32(SPAPR_DRC_PHB_TABLE_SIZE); offset = sizeof(*entries); for (i = 0; i < SPAPR_DRC_PHB_TABLE_SIZE; i++) { -- 1.7.11.7