From patchwork Mon Nov 8 03:57:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 70391 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EFD2CB6EDF for ; Mon, 8 Nov 2010 14:57:49 +1100 (EST) Received: from localhost ([127.0.0.1]:37178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFIra-0000ie-8w for incoming@patchwork.ozlabs.org; Sun, 07 Nov 2010 22:57:46 -0500 Received: from [140.186.70.92] (port=53381 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFIqy-0000iZ-LF for qemu-devel@nongnu.org; Sun, 07 Nov 2010 22:57:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFIqx-0007uv-1A for qemu-devel@nongnu.org; Sun, 07 Nov 2010 22:57:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:3672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFIqw-0007u9-QT for qemu-devel@nongnu.org; Sun, 07 Nov 2010 22:57:06 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA83v1Zg000928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 7 Nov 2010 22:57:02 -0500 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oA83v0qJ015443; Sun, 7 Nov 2010 22:57:01 -0500 From: Alex Williamson To: qemu-devel@nongnu.org, blauwirbel@gmail.com Date: Sun, 07 Nov 2010 20:57:00 -0700 Message-ID: <20101108035143.26532.81891.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: jes.sorensen@redhat.com, alex.williamson@redhat.com Subject: [Qemu-devel] [PATCH] pc: Fix e820 fw_cfg for big endian X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Alex Williamson --- Compile tested only. Only current user is kvm, no cross-arch users. hw/pc.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 0264e3d..cc8ec14 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -467,19 +467,19 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val) int e820_add_entry(uint64_t address, uint64_t length, uint32_t type) { - int index = e820_table.count; + int index = le32_to_cpu(e820_table.count); struct e820_entry *entry; if (index >= E820_NR_ENTRIES) return -EBUSY; - entry = &e820_table.entry[index]; + entry = &e820_table.entry[index++]; - entry->address = address; - entry->length = length; - entry->type = type; + entry->address = cpu_to_le64(address); + entry->length = cpu_to_le64(length); + entry->type = cpu_to_le32(type); - e820_table.count++; - return e820_table.count; + e820_table.count = cpu_to_le32(index); + return index; } static void *bochs_bios_init(void)