Skip to content

Commit

Permalink
hw/core/loader: Let load_elf() populate a field with CPU-specific flags
Browse files Browse the repository at this point in the history
While loading the executable, some platforms (like AVR) need to
detect CPU type that executable is built for - and, with this patch,
this is enabled by reading the field 'e_flags' of the ELF header of
the executable in question. The change expands functionality of
the following functions:

  - load_elf()
  - load_elf_as()
  - load_elf_ram()
  - load_elf_ram_sym()

The argument added to these functions is called 'pflags' and is of
type 'uint32_t*' (that matches 'pointer to 'elf_word'', 'elf_word'
being the type of the field 'e_flags', in both 32-bit and 64-bit
variants of ELF header). Callers are allowed to pass NULL as that
argument, and in such case no lookup to the field 'e_flags' will
happen, and no information will be returned, of course.

CC: Richard Henderson <rth@twiddle.net>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Edgar E. Iglesias <edgar.iglesias@gmail.com>
CC: Michael Walle <michael@walle.cc>
CC: Thomas Huth <huth@tuxfamily.org>
CC: Laurent Vivier <laurent@vivier.eu>
CC: Philippe Mathieu-Daudé <f4bug@amsat.org>
CC: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
CC: Aurelien Jarno <aurelien@aurel32.net>
CC: Jia Liu <proljc@gmail.com>
CC: David Gibson <david@gibson.dropbear.id.au>
CC: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
CC: BALATON Zoltan <balaton@eik.bme.hu>
CC: Christian Borntraeger <borntraeger@de.ibm.com>
CC: Thomas Huth <thuth@redhat.com>
CC: Artyom Tarasenko <atar4qemu@gmail.com>
CC: Fabien Chouteau <chouteau@adacore.com>
CC: KONRAD Frederic <frederic.konrad@adacore.com>
CC: Max Filippov <jcmvbkbc@gmail.com>

Reviewed-by: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Signed-off-by: Michael Rolnik <mrolnik@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Message-Id: <1580079311-20447-24-git-send-email-aleksandar.markovic@rt-rk.com>
  • Loading branch information
AMarkovic committed Jan 29, 2020
1 parent 54fc33f commit 6cdda0f
Show file tree
Hide file tree
Showing 40 changed files with 92 additions and 79 deletions.
4 changes: 2 additions & 2 deletions hw/alpha/dp264.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static void clipper_init(MachineState *machine)
exit(1);
}
size = load_elf(palcode_filename, NULL, cpu_alpha_superpage_to_phys,
NULL, &palcode_entry, &palcode_low, &palcode_high,
NULL, &palcode_entry, &palcode_low, &palcode_high, NULL,
0, EM_ALPHA, 0, 0);
if (size < 0) {
error_report("could not load palcode '%s'", palcode_filename);
Expand All @@ -134,7 +134,7 @@ static void clipper_init(MachineState *machine)
uint64_t param_offset;

size = load_elf(kernel_filename, NULL, cpu_alpha_superpage_to_phys,
NULL, &kernel_entry, &kernel_low, &kernel_high,
NULL, &kernel_entry, &kernel_low, &kernel_high, NULL,
0, EM_ALPHA, 0, 0);
if (size < 0) {
error_report("could not load kernel '%s'", kernel_filename);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/armv7m.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ void armv7m_load_kernel(ARMCPU *cpu, const char *kernel_filename, int mem_size)

if (kernel_filename) {
image_size = load_elf_as(kernel_filename, NULL, NULL, NULL,
&entry, &lowaddr,
&entry, &lowaddr, NULL,
NULL, big_endian, EM_ARM, 1, 0, as);
if (image_size < 0) {
image_size = load_image_targphys_as(kernel_filename, 0,
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ static int64_t arm_load_elf(struct arm_boot_info *info, uint64_t *pentry,
}

ret = load_elf_as(info->kernel_filename, NULL, NULL, NULL,
pentry, lowaddr, highaddr, big_endian, elf_machine,
pentry, lowaddr, highaddr, NULL, big_endian, elf_machine,
1, data_swab, as);
if (ret <= 0) {
/* The header loaded but the image didn't */
Expand Down
2 changes: 1 addition & 1 deletion hw/core/generic-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)

if (!s->force_raw) {
size = load_elf_as(s->file, NULL, NULL, NULL, &entry, NULL, NULL,
big_endian, 0, 0, 0, as);
NULL, big_endian, 0, 0, 0, as);

if (size < 0) {
size = load_uimage_as(s->file, &entry, NULL, NULL, NULL, NULL,
Expand Down
37 changes: 19 additions & 18 deletions hw/core/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,39 +406,39 @@ int load_elf(const char *filename,
uint64_t (*elf_note_fn)(void *, void *, bool),
uint64_t (*translate_fn)(void *, uint64_t),
void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
uint64_t *highaddr, int big_endian, int elf_machine,
int clear_lsb, int data_swab)
uint64_t *highaddr, uint32_t *pflags, int big_endian,
int elf_machine, int clear_lsb, int data_swab)
{
return load_elf_as(filename, elf_note_fn, translate_fn, translate_opaque,
pentry, lowaddr, highaddr, big_endian, elf_machine,
clear_lsb, data_swab, NULL);
pentry, lowaddr, highaddr, pflags, big_endian,
elf_machine, clear_lsb, data_swab, NULL);
}

/* return < 0 if error, otherwise the number of bytes loaded in memory */
int load_elf_as(const char *filename,
uint64_t (*elf_note_fn)(void *, void *, bool),
uint64_t (*translate_fn)(void *, uint64_t),
void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
uint64_t *highaddr, int big_endian, int elf_machine,
int clear_lsb, int data_swab, AddressSpace *as)
uint64_t *highaddr, uint32_t *pflags, int big_endian,
int elf_machine, int clear_lsb, int data_swab, AddressSpace *as)
{
return load_elf_ram(filename, elf_note_fn, translate_fn, translate_opaque,
pentry, lowaddr, highaddr, big_endian, elf_machine,
clear_lsb, data_swab, as, true);
pentry, lowaddr, highaddr, pflags, big_endian,
elf_machine, clear_lsb, data_swab, as, true);
}

/* return < 0 if error, otherwise the number of bytes loaded in memory */
int load_elf_ram(const char *filename,
uint64_t (*elf_note_fn)(void *, void *, bool),
uint64_t (*translate_fn)(void *, uint64_t),
void *translate_opaque, uint64_t *pentry, uint64_t *lowaddr,
uint64_t *highaddr, int big_endian, int elf_machine,
int clear_lsb, int data_swab, AddressSpace *as,
bool load_rom)
uint64_t *highaddr, uint32_t *pflags, int big_endian,
int elf_machine, int clear_lsb, int data_swab,
AddressSpace *as, bool load_rom)
{
return load_elf_ram_sym(filename, elf_note_fn,
translate_fn, translate_opaque,
pentry, lowaddr, highaddr, big_endian,
pentry, lowaddr, highaddr, pflags, big_endian,
elf_machine, clear_lsb, data_swab, as,
load_rom, NULL);
}
Expand All @@ -448,8 +448,9 @@ int load_elf_ram_sym(const char *filename,
uint64_t (*elf_note_fn)(void *, void *, bool),
uint64_t (*translate_fn)(void *, uint64_t),
void *translate_opaque, uint64_t *pentry,
uint64_t *lowaddr, uint64_t *highaddr, int big_endian,
int elf_machine, int clear_lsb, int data_swab,
uint64_t *lowaddr, uint64_t *highaddr, uint32_t *pflags,
int big_endian, int elf_machine,
int clear_lsb, int data_swab,
AddressSpace *as, bool load_rom, symbol_fn_t sym_cb)
{
int fd, data_order, target_data_order, must_swab, ret = ELF_LOAD_FAILED;
Expand Down Expand Up @@ -490,13 +491,13 @@ int load_elf_ram_sym(const char *filename,
if (e_ident[EI_CLASS] == ELFCLASS64) {
ret = load_elf64(filename, fd, elf_note_fn,
translate_fn, translate_opaque, must_swab,
pentry, lowaddr, highaddr, elf_machine, clear_lsb,
data_swab, as, load_rom, sym_cb);
pentry, lowaddr, highaddr, pflags, elf_machine,
clear_lsb, data_swab, as, load_rom, sym_cb);
} else {
ret = load_elf32(filename, fd, elf_note_fn,
translate_fn, translate_opaque, must_swab,
pentry, lowaddr, highaddr, elf_machine, clear_lsb,
data_swab, as, load_rom, sym_cb);
pentry, lowaddr, highaddr, pflags, elf_machine,
clear_lsb, data_swab, as, load_rom, sym_cb);
}

fail:
Expand Down
2 changes: 1 addition & 1 deletion hw/cris/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li)
devboard SDK. */
image_size = load_elf(li->image_filename, NULL,
translate_kernel_address, NULL,
&entry, NULL, &high, 0, EM_CRIS, 0, 0);
&entry, NULL, &high, NULL, 0, EM_CRIS, 0, 0);
li->entry = entry;
if (image_size < 0) {
/* Takes a kimage from the axis devboard SDK. */
Expand Down
4 changes: 2 additions & 2 deletions hw/hppa/machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void machine_hppa_init(MachineState *machine)
}

size = load_elf(firmware_filename, NULL, NULL, NULL,
&firmware_entry, &firmware_low, &firmware_high,
&firmware_entry, &firmware_low, &firmware_high, NULL,
true, EM_PARISC, 0, 0);

/* Unfortunately, load_elf sign-extends reading elf32. */
Expand Down Expand Up @@ -184,7 +184,7 @@ static void machine_hppa_init(MachineState *machine)
/* Load kernel */
if (kernel_filename) {
size = load_elf(kernel_filename, NULL, &cpu_hppa_to_phys,
NULL, &kernel_entry, &kernel_low, &kernel_high,
NULL, &kernel_entry, &kernel_low, &kernel_high, NULL,
true, EM_PARISC, 0, 0);

/* Unfortunately, load_elf sign-extends reading elf32. */
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/multiboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ int load_multiboot(FWCfgState *fw_cfg,
}

kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
&elf_low, &elf_high, 0, I386_ELF_MACHINE,
&elf_low, &elf_high, NULL, 0, I386_ELF_MACHINE,
0, 0);
if (kernel_size < 0) {
error_report("Error while loading elf kernel");
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static bool load_elfboot(const char *kernel_filename,
uint64_t elf_note_type = XEN_ELFNOTE_PHYS32_ENTRY;
kernel_size = load_elf(kernel_filename, read_pvh_start_addr,
NULL, &elf_note_type, &elf_entry,
&elf_low, &elf_high, 0, I386_ELF_MACHINE,
&elf_low, &elf_high, NULL, 0, I386_ELF_MACHINE,
0, 0);

if (kernel_size < 0) {
Expand Down
4 changes: 2 additions & 2 deletions hw/lm32/lm32_boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static void lm32_evr_init(MachineState *machine)
int kernel_size;

kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&entry, NULL, NULL,
&entry, NULL, NULL, NULL,
1, EM_LATTICEMICO32, 0, 0);
reset_info->bootstrap_pc = entry;

Expand Down Expand Up @@ -232,7 +232,7 @@ static void lm32_uclinux_init(MachineState *machine)
int kernel_size;

kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&entry, NULL, NULL,
&entry, NULL, NULL, NULL,
1, EM_LATTICEMICO32, 0, 0);
reset_info->bootstrap_pc = entry;

Expand Down
2 changes: 1 addition & 1 deletion hw/lm32/milkymist.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ milkymist_init(MachineState *machine)

/* Boots a kernel elf binary. */
kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&entry, NULL, NULL,
&entry, NULL, NULL, NULL,
1, EM_LATTICEMICO32, 0, 0);
reset_info->bootstrap_pc = entry;

Expand Down
2 changes: 1 addition & 1 deletion hw/m68k/an5206.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static void an5206_init(MachineState *machine)
}

kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
NULL, NULL, 1, EM_68K, 0, 0);
NULL, NULL, NULL, 1, EM_68K, 0, 0);
entry = elf_entry;
if (kernel_size < 0) {
kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
Expand Down
2 changes: 1 addition & 1 deletion hw/m68k/mcf5208.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static void mcf5208evb_init(MachineState *machine)
}

kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
NULL, NULL, 1, EM_68K, 0, 0);
NULL, NULL, NULL, 1, EM_68K, 0, 0);
entry = elf_entry;
if (kernel_size < 0) {
kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
Expand Down
2 changes: 1 addition & 1 deletion hw/m68k/q800.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static void q800_init(MachineState *machine)
if (linux_boot) {
uint64_t high;
kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&elf_entry, NULL, &high, 1,
&elf_entry, NULL, &high, NULL, 1,
EM_68K, 0, 0);
if (kernel_size < 0) {
error_report("could not load kernel '%s'", kernel_filename);
Expand Down
4 changes: 2 additions & 2 deletions hw/microblaze/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,

/* Boots a kernel elf binary. */
kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&entry, &low, &high,
&entry, &low, &high, NULL,
big_endian, EM_MICROBLAZE, 0, 0);
base32 = entry;
if (base32 == 0xc0000000) {
kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, NULL,
&entry, NULL, NULL,
&entry, NULL, NULL, NULL,
big_endian, EM_MICROBLAZE, 0, 0);
}
/* Always boot into physical ram. */
Expand Down
2 changes: 1 addition & 1 deletion hw/mips/mips_fulong2e.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int64_t load_kernel(CPUMIPSState *env)
cpu_mips_kseg0_to_phys, NULL,
(uint64_t *)&kernel_entry,
(uint64_t *)&kernel_low, (uint64_t *)&kernel_high,
0, EM_MIPS, 1, 0);
NULL, 0, EM_MIPS, 1, 0);
if (kernel_size < 0) {
error_report("could not load kernel '%s': %s",
loaderparams.kernel_filename,
Expand Down
3 changes: 2 additions & 1 deletion hw/mips/mips_malta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,8 @@ static int64_t load_kernel(void)
kernel_size = load_elf(loaderparams.kernel_filename, NULL,
cpu_mips_kseg0_to_phys, NULL,
(uint64_t *)&kernel_entry, NULL,
(uint64_t *)&kernel_high, big_endian, EM_MIPS, 1, 0);
(uint64_t *)&kernel_high, NULL, big_endian, EM_MIPS,
1, 0);
if (kernel_size < 0) {
error_report("could not load kernel '%s': %s",
loaderparams.kernel_filename,
Expand Down
2 changes: 1 addition & 1 deletion hw/mips/mips_mipssim.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static int64_t load_kernel(void)
kernel_size = load_elf(loaderparams.kernel_filename, NULL,
cpu_mips_kseg0_to_phys, NULL,
(uint64_t *)&entry, NULL,
(uint64_t *)&kernel_high, big_endian,
(uint64_t *)&kernel_high, NULL, big_endian,
EM_MIPS, 1, 0);
if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000) {
Expand Down
2 changes: 1 addition & 1 deletion hw/mips/mips_r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int64_t load_kernel(void)
kernel_size = load_elf(loaderparams.kernel_filename, NULL,
cpu_mips_kseg0_to_phys, NULL,
(uint64_t *)&entry, NULL,
(uint64_t *)&kernel_high, big_endian,
(uint64_t *)&kernel_high, NULL, big_endian,
EM_MIPS, 1, 0);
if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000) {
Expand Down
2 changes: 1 addition & 1 deletion hw/moxie/moxiesim.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params)
ram_addr_t initrd_offset;

kernel_size = load_elf(loader_params->kernel_filename, NULL, NULL, NULL,
&entry, &kernel_low, &kernel_high, 1, EM_MOXIE,
&entry, &kernel_low, &kernel_high, NULL, 1, EM_MOXIE,
0, 0);

if (kernel_size <= 0) {
Expand Down
4 changes: 2 additions & 2 deletions hw/nios2/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,

/* Boots a kernel elf binary. */
kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&entry, &low, &high,
&entry, &low, &high, NULL,
big_endian, EM_ALTERA_NIOS2, 0, 0);
if ((uint32_t)entry == 0xc0000000) {
/*
Expand All @@ -158,7 +158,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base,
*/
kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, NULL,
&entry, NULL, NULL,
&entry, NULL, NULL, NULL,
big_endian, EM_ALTERA_NIOS2, 0, 0);
boot_info.bootstrap_pc = ddr_base + 0xc0000000 +
(entry & 0x07ffffff);
Expand Down
2 changes: 1 addition & 1 deletion hw/openrisc/openrisc_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static void openrisc_load_kernel(ram_addr_t ram_size,

if (kernel_filename && !qtest_enabled()) {
kernel_size = load_elf(kernel_filename, NULL, NULL, NULL,
&elf_entry, NULL, NULL, 1, EM_OPENRISC,
&elf_entry, NULL, NULL, NULL, 1, EM_OPENRISC,
1, 0);
entry = elf_entry;
if (kernel_size < 0) {
Expand Down
3 changes: 2 additions & 1 deletion hw/pci-host/prep.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ static void raven_realize(PCIDevice *d, Error **errp)
if (filename) {
if (s->elf_machine != EM_NONE) {
bios_size = load_elf(filename, NULL, NULL, NULL, NULL,
NULL, NULL, 1, s->elf_machine, 0, 0);
NULL, NULL, NULL, 1, s->elf_machine,
0, 0);
}
if (bios_size < 0) {
bios_size = get_image_size(filename);
Expand Down
2 changes: 1 addition & 1 deletion hw/ppc/e500.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ void ppce500_init(MachineState *machine)
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, payload_name);

payload_size = load_elf(filename, NULL, NULL, NULL,
&bios_entry, &loadaddr, NULL,
&bios_entry, &loadaddr, NULL, NULL,
1, PPC_ELF_MACHINE, 0, 0);
if (payload_size < 0) {
/*
Expand Down
4 changes: 2 additions & 2 deletions hw/ppc/mac_newworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static void ppc_core99_init(MachineState *machine)
/* Load OpenBIOS (ELF) */
if (filename) {
bios_size = load_elf(filename, NULL, NULL, NULL, NULL,
NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0);
NULL, NULL, NULL, 1, PPC_ELF_MACHINE, 0, 0);

g_free(filename);
} else {
Expand All @@ -192,7 +192,7 @@ static void ppc_core99_init(MachineState *machine)

kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, NULL,
NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE,
NULL, &lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE,
0, 0);
if (kernel_size < 0)
kernel_size = load_aout(kernel_filename, kernel_base,
Expand Down
4 changes: 2 additions & 2 deletions hw/ppc/mac_oldworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static void ppc_heathrow_init(MachineState *machine)

/* Load OpenBIOS (ELF) */
if (filename) {
bios_size = load_elf(filename, NULL, 0, NULL, NULL, NULL, NULL,
bios_size = load_elf(filename, NULL, 0, NULL, NULL, NULL, NULL, NULL,
1, PPC_ELF_MACHINE, 0, 0);
g_free(filename);
} else {
Expand All @@ -166,7 +166,7 @@ static void ppc_heathrow_init(MachineState *machine)
kernel_base = KERNEL_LOAD_ADDR;
kernel_size = load_elf(kernel_filename, NULL,
translate_kernel_address, NULL,
NULL, &lowaddr, NULL, 1, PPC_ELF_MACHINE,
NULL, &lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE,
0, 0);
if (kernel_size < 0)
kernel_size = load_aout(kernel_filename, kernel_base,
Expand Down
2 changes: 1 addition & 1 deletion hw/ppc/ppc440_bamboo.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static void bamboo_init(MachineState *machine)
NULL, NULL);
if (success < 0) {
success = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
&elf_lowaddr, NULL, 1, PPC_ELF_MACHINE,
&elf_lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE,
0, 0);
entry = elf_entry;
loadaddr = elf_lowaddr;
Expand Down
3 changes: 2 additions & 1 deletion hw/ppc/sam460ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ static void sam460ex_init(MachineState *machine)

success = load_elf(machine->kernel_filename, NULL,
NULL, NULL, &elf_entry,
&elf_lowaddr, NULL, 1, PPC_ELF_MACHINE, 0, 0);
&elf_lowaddr, NULL, NULL, 1, PPC_ELF_MACHINE, 0,
0);
entry = elf_entry;
loadaddr = elf_lowaddr;
}
Expand Down
Loading

0 comments on commit 6cdda0f

Please sign in to comment.