diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2010-11-07 20:57:00 -0700 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-11-16 14:35:00 -0600 |
commit | 8ca209ad90bdb678932a6b18caf32b461dbe5eee (patch) | |
tree | ac1f897ee9155a1ca23b44e1e604fb0062b37f69 | |
parent | 67d4b0c1907455f42ad8cea445ff10b81b49eebc (diff) |
pc: Fix e820 fw_cfg for big endian
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/pc.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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) |