From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmRqa-0004pJ-HE for qemu-devel@nongnu.org; Mon, 19 May 2014 13:59:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WmRqS-0007fM-D3 for qemu-devel@nongnu.org; Mon, 19 May 2014 13:59:36 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:35477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WmRqS-0007fA-3Y for qemu-devel@nongnu.org; Mon, 19 May 2014 13:59:28 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 May 2014 18:59:27 +0100 From: Greg Kurz Date: Mon, 19 May 2014 19:59:22 +0200 Message-ID: <20140519175912.27382.68086.stgit@bahia.local> In-Reply-To: <20140519174410.27382.38486.stgit@bahia.local> References: <20140519174410.27382.38486.stgit@bahia.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v4 4/4] target-ppc: Set the correct endianness in ELF dump header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Andreas =?utf-8?q?F=C3=A4rber?= , bharata@linux.vnet.ibm.com From: Bharata B Rao Signed-off-by: Bharata B Rao Reviewed-by: Alexander Graf Signed-off-by: Greg Kurz --- No change. target-ppc/arch_dump.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/target-ppc/arch_dump.c b/target-ppc/arch_dump.c index 5a3b40d..5acafc6 100644 --- a/target-ppc/arch_dump.c +++ b/target-ppc/arch_dump.c @@ -209,12 +209,16 @@ typedef struct NoteFuncDescStruct NoteFuncDesc; int cpu_get_dump_info(ArchDumpInfo *info, const struct GuestPhysBlockList *guest_phys_blocks) { - /* - * Currently only handling PPC64 big endian. - */ + PowerPCCPU *cpu = POWERPC_CPU(first_cpu); + PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); + info->d_machine = EM_PPC64; - info->d_endian = ELFDATA2MSB; info->d_class = ELFCLASS64; + if ((*pcc->interrupts_big_endian)(cpu)) { + info->d_endian = ELFDATA2MSB; + } else { + info->d_endian = ELFDATA2LSB; + } return 0; }