aboutsummaryrefslogtreecommitdiffstats
path: root/hw/mips_mipssim.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/mips_mipssim.c')
-rw-r--r--hw/mips_mipssim.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index aa9011676..9a6f50cd1 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -35,14 +35,6 @@
#include "loader.h"
#include "elf.h"
-#ifdef TARGET_MIPS64
-#define PHYS_TO_VIRT(x) ((x) | ~0x7fffffffULL)
-#else
-#define PHYS_TO_VIRT(x) ((x) | ~0x7fffffffU)
-#endif
-
-#define VIRT_TO_PHYS_ADDEND (-((int64_t)(int32_t)0x80000000))
-
static struct _loaderparams {
int ram_size;
const char *kernel_filename;
@@ -57,7 +49,7 @@ typedef struct ResetData {
static int64_t load_kernel(void)
{
- int64_t entry, kernel_low, kernel_high;
+ int64_t entry, kernel_high;
long kernel_size;
long initrd_size;
ram_addr_t initrd_offset;
@@ -69,9 +61,10 @@ static int64_t load_kernel(void)
big_endian = 0;
#endif
- kernel_size = load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND,
- (uint64_t *)&entry, (uint64_t *)&kernel_low,
- (uint64_t *)&kernel_high, big_endian, ELF_MACHINE, 1);
+ kernel_size = load_elf(loaderparams.kernel_filename, cpu_mips_kseg0_to_phys,
+ NULL, (uint64_t *)&entry, NULL,
+ (uint64_t *)&kernel_high, big_endian,
+ ELF_MACHINE, 1);
if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000)
entry = (int32_t)entry;