diff options
author | Jiaxun Yang <jiaxun.yang@flygoat.com> | 2020-12-15 14:41:53 +0800 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-01-04 23:36:03 +0100 |
commit | dde989943b401aec3a063214278474d2f8c1a9de (patch) | |
tree | 0441f1af1f07e9697853d9b3b15ea02b4b11f021 /hw/mips/fuloong2e.c | |
parent | c7784e42c7cce358ba9b21231dffe376f670cd5f (diff) | |
download | qemu-dde989943b401aec3a063214278474d2f8c1a9de.zip qemu-dde989943b401aec3a063214278474d2f8c1a9de.tar.gz qemu-dde989943b401aec3a063214278474d2f8c1a9de.tar.bz2 |
hw/mips: Make bootloader addresses unsigned
Address should be unsigned anyway, otherwise it may carry
calculations wrongly.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201215064200.28751-2-jiaxun.yang@flygoat.com>
[PMD: Fixed typo and convert hw/mips/mipssim.c too]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/mips/fuloong2e.c')
-rw-r--r-- | hw/mips/fuloong2e.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index e5d0866..804bef9 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -107,9 +107,9 @@ static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t *prom_buf, int index, va_end(ap); } -static int64_t load_kernel(CPUMIPSState *env) +static uint64_t load_kernel(CPUMIPSState *env) { - int64_t kernel_entry, kernel_high, initrd_size; + uint64_t kernel_entry, kernel_high, initrd_size; int index = 0; long kernel_size; ram_addr_t initrd_offset; @@ -118,8 +118,8 @@ static int64_t load_kernel(CPUMIPSState *env) kernel_size = load_elf(loaderparams.kernel_filename, NULL, cpu_mips_kseg0_to_phys, NULL, - (uint64_t *)&kernel_entry, NULL, - (uint64_t *)&kernel_high, NULL, + &kernel_entry, NULL, + &kernel_high, NULL, 0, EM_MIPS, 1, 0); if (kernel_size < 0) { error_report("could not load kernel '%s': %s", @@ -180,7 +180,7 @@ static int64_t load_kernel(CPUMIPSState *env) } static void write_bootloader(CPUMIPSState *env, uint8_t *base, - int64_t kernel_addr) + uint64_t kernel_addr) { uint32_t *p; @@ -299,7 +299,7 @@ static void mips_fuloong2e_init(MachineState *machine) MemoryRegion *bios = g_new(MemoryRegion, 1); long bios_size; uint8_t *spd_data; - int64_t kernel_entry; + uint64_t kernel_entry; PCIDevice *pci_dev; PCIBus *pci_bus; ISABus *isa_bus; |