qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] pc: Fix e820 fw_cfg for big endian


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] pc: Fix e820 fw_cfg for big endian
Date: Tue, 16 Nov 2010 16:26:07 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10

On 11/07/2010 09:57 PM, Alex Williamson wrote:
Signed-off-by: Alex Williamson<address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori
---

  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)







reply via email to

[Prev in Thread] Current Thread [Next in Thread]