mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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>
This commit is contained in:
parent
c7784e42c7
commit
dde989943b
3 changed files with 21 additions and 21 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue