]> Git Repo - qemu.git/blobdiff - loader.c
Support tap down script, by Wolfram Gloger.
[qemu.git] / loader.c
index 827d456d2e6fc2f38144efdb27f43087ce76ea11..c39cb5535282c1cbbb484178437ccac35f216a61 100644 (file)
--- a/loader.c
+++ b/loader.c
@@ -1,8 +1,8 @@
 /*
  * QEMU Executable loader
- * 
+ *
  * Copyright (c) 2006 Fabrice Bellard
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
  * in the Software without restriction, including without limitation the rights
@@ -173,6 +173,7 @@ static void *load_at(int fd, int offset, int size)
 
 #define SZ             32
 #define elf_word        uint32_t
+#define elf_sword        int32_t
 #define bswapSZs       bswap32s
 #include "elf_ops.h"
 
@@ -182,6 +183,7 @@ static void *load_at(int fd, int offset, int size)
 #undef elf_sym
 #undef elf_note
 #undef elf_word
+#undef elf_sword
 #undef bswapSZs
 #undef SZ
 #define elfhdr         elf64_hdr
@@ -190,13 +192,14 @@ static void *load_at(int fd, int offset, int size)
 #define elf_shdr       elf64_shdr
 #define elf_sym                elf64_sym
 #define elf_word        uint64_t
+#define elf_sword        int64_t
 #define bswapSZs       bswap64s
 #define SZ             64
 #include "elf_ops.h"
 
 /* return < 0 if error, otherwise the number of bytes loaded in memory */
 int load_elf(const char *filename, int64_t virt_to_phys_addend,
-             uint64_t *pentry)
+             uint64_t *pentry, uint64_t *lowaddr, uint64_t *highaddr)
 {
     int fd, data_order, host_data_order, must_swab, ret;
     uint8_t e_ident[EI_NIDENT];
@@ -230,9 +233,11 @@ int load_elf(const char *filename, int64_t virt_to_phys_addend,
 
     lseek(fd, 0, SEEK_SET);
     if (e_ident[EI_CLASS] == ELFCLASS64) {
-        ret = load_elf64(fd, virt_to_phys_addend, must_swab, pentry);
+        ret = load_elf64(fd, virt_to_phys_addend, must_swab, pentry,
+                         lowaddr, highaddr);
     } else {
-        ret = load_elf32(fd, virt_to_phys_addend, must_swab, pentry);
+        ret = load_elf32(fd, virt_to_phys_addend, must_swab, pentry,
+                         lowaddr, highaddr);
     }
 
     close(fd);
@@ -259,7 +264,7 @@ static void bswap_uboot_header(uboot_image_header_t *hdr)
 /* Load a U-Boot image.  */
 int load_uboot(const char *filename, target_ulong *ep, int *is_linux)
 {
-    
+
     int fd;
     int size;
     uboot_image_header_t h;
This page took 0.030408 seconds and 4 git commands to generate.