Received: from eggs.gnu.org ([140.186.70.92]:58001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe8Ty-0001nT-J6 for qemu-devel@nongnu.org; Tue, 05 Jul 2011 12:28:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qe8Tu-0000wC-3T for qemu-devel@nongnu.org; Tue, 05 Jul 2011 12:28:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50152 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qe8Tt-0000va-CV for qemu-devel@nongnu.org; Tue, 05 Jul 2011 12:28:13 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 10504890B6 for ; Tue, 5 Jul 2011 18:28:11 +0200 (CEST) From: Alexander Graf Date: Tue, 5 Jul 2011 18:28:10 +0200 Message-Id: <1309883290-17595-10-git-send-email-agraf@suse.de> In-Reply-To: <1309883290-17595-1-git-send-email-agraf@suse.de> References: <1309883290-17595-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 9/9] spapr: use specific endian ld/st_phys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org Developers" Signed-off-by: Alexander Graf --- hw/spapr.h | 4 ++-- hw/spapr_hcall.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/spapr.h b/hw/spapr.h index b52133a..263691b 100644 --- a/hw/spapr.h +++ b/hw/spapr.h @@ -280,12 +280,12 @@ target_ulong spapr_hypercall(CPUState *env, target_ulong opcode, static inline uint32_t rtas_ld(target_ulong phys, int n) { - return ldl_phys(phys + 4*n); + return ldl_be_phys(phys + 4*n); } static inline void rtas_st(target_ulong phys, int n, uint32_t val) { - stl_phys(phys + 4*n, val); + stl_be_phys(phys + 4*n, val); } typedef void (*spapr_rtas_fn)(sPAPREnvironment *spapr, uint32_t token, diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c index 84da8fc..5cd8d8f 100644 --- a/hw/spapr_hcall.c +++ b/hw/spapr_hcall.c @@ -278,7 +278,7 @@ static target_ulong register_vpa(CPUState *env, target_ulong vpa) } /* FIXME: bounds check the address */ - size = lduw_phys(vpa + 0x4); + size = lduw_be_phys(vpa + 0x4); if (size < VPA_MIN_SIZE) { return H_PARAMETER; @@ -321,7 +321,7 @@ static target_ulong register_slb_shadow(CPUState *env, target_ulong addr) return H_HARDWARE; } - size = ldl_phys(addr + 0x4); + size = ldl_be_phys(addr + 0x4); if (size < 0x8) { return H_PARAMETER; } @@ -354,7 +354,7 @@ static target_ulong register_dtl(CPUState *env, target_ulong addr) return H_HARDWARE; } - size = ldl_phys(addr + 0x4); + size = ldl_be_phys(addr + 0x4); if (size < 48) { return H_PARAMETER; @@ -441,9 +441,9 @@ static target_ulong h_rtas(CPUState *env, sPAPREnvironment *spapr, target_ulong opcode, target_ulong *args) { target_ulong rtas_r3 = args[0]; - uint32_t token = ldl_phys(rtas_r3); - uint32_t nargs = ldl_phys(rtas_r3 + 4); - uint32_t nret = ldl_phys(rtas_r3 + 8); + uint32_t token = ldl_be_phys(rtas_r3); + uint32_t nargs = ldl_be_phys(rtas_r3 + 4); + uint32_t nret = ldl_be_phys(rtas_r3 + 8); return spapr_rtas_call(spapr, token, nargs, rtas_r3 + 12, nret, rtas_r3 + 12 + 4*nargs); -- 1.7.3.4