All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@petalogix.com>
To: qemu-devel@nongnu.org
Cc: "Edgar E. Iglesias" <edgar.iglesias@petalogix.com>
Subject: [Qemu-devel] [PATCH 1/2] pls3adsp1800: Base load_elf endianness on target endianness
Date: Mon, 21 Feb 2011 14:44:41 +0100	[thread overview]
Message-ID: <1298295882-13794-1-git-send-email-edgar.iglesias@petalogix.com> (raw)

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
---
 hw/petalogix_s3adsp1800_mmu.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index 42de459..6ef4e65 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -167,16 +167,21 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size,
     if (kernel_filename) {
         uint64_t entry, low, high;
         uint32_t base32;
+        int big_endian = 0;
+
+#ifdef TARGET_WORDS_BIGENDIAN
+        big_endian = 1;
+#endif
 
         /* Boots a kernel elf binary.  */
         kernel_size = load_elf(kernel_filename, NULL, NULL,
                                &entry, &low, &high,
-                               1, ELF_MACHINE, 0);
+                               big_endian, ELF_MACHINE, 0);
         base32 = entry;
         if (base32 == 0xc0000000) {
             kernel_size = load_elf(kernel_filename, translate_kernel_address,
                                    NULL, &entry, NULL, NULL,
-                                   1, ELF_MACHINE, 0);
+                                   big_endian, ELF_MACHINE, 0);
         }
         /* Always boot into physical ram.  */
         boot_info.bootstrap_pc = ddr_base + (entry & 0x0fffffff);
-- 
1.7.3.4

             reply	other threads:[~2011-02-21 13:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 13:44 Edgar E. Iglesias [this message]
2011-02-21 13:44 ` [Qemu-devel] [PATCH 2/2] microblaze: Allow targeting little-endian mb Edgar E. Iglesias
2011-02-25 15:15   ` Blue Swirl
2011-03-01 21:25     ` Edgar E. Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298295882-13794-1-git-send-email-edgar.iglesias@petalogix.com \
    --to=edgar.iglesias@petalogix.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.