qemu-patch-raspberry4/hw/core
Aleksandar Markovic 6cdda0ff4b hw/core/loader: Let load_elf() populate a field with CPU-specific flags
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>
2020-01-29 19:28:52 +01:00
..
bus.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
cpu.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
empty_slot.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
fw-path-provider.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
generic-loader.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
hotplug.c call HotplugHandler->plug() as the last step in device realization 2018-10-19 13:44:12 +02:00
irq.c Revert "irq: introduce qemu_irq_proxy()" 2019-11-05 23:33:12 +01:00
Kconfig hw/core: Add a config switch for the generic loader device 2019-08-20 09:11:17 +02:00
loader-fit.c hw/core: Fix fit_load_fdt() error API violations 2019-12-18 08:36:15 +01:00
loader.c hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
machine-hmp-cmds.c hmp: drop Error pointer indirection in hmp_handle_error 2019-12-18 08:36:16 +01:00
machine-qmp-cmds.c qapi: report the default CPU type for each machine 2019-09-03 14:39:46 -03:00
machine.c usb-redir: remove 'remote wakeup' flag from configuration descriptor 2020-01-13 09:17:31 +01:00
Makefile.objs hw/core/Makefile: Group generic objects versus system-mode objects 2020-01-24 20:59:09 +01:00
nmi.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
null-machine.c hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
numa.c virtio, pci, pc: fixes, features 2020-01-07 16:25:00 +00:00
or-irq.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
platform-bus.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
ptimer.c ptimer: Remove old ptimer_init_with_bh() API 2019-11-11 13:44:16 +00:00
qdev-fw.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
qdev-properties-system.c audio: add audiodev properties to frontends 2019-08-21 09:13:37 +02:00
qdev-properties.c qdev: register properties as class properties 2020-01-24 20:59:16 +01:00
qdev.c qdev: register properties as class properties 2020-01-24 20:59:16 +01:00
register.c Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
reset.c qemu/queue.h: leave head structs anonymous unless necessary 2019-01-11 15:46:55 +01:00
split-irq.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
stream.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
sysbus.c sysbus: remove unused sysbus_try_create* 2020-01-07 16:06:59 +04:00
trace-events loader: Trace loaded images 2019-09-18 10:18:51 +01:00
uboot_image.h Support u-boot noload images for arm as used by, NetBSD/evbarm GENERIC kernel. 2019-01-07 15:46:20 +00:00
vm-change-state-handler.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
vmstate-if.c vmstate: add qom interface to get id 2020-01-06 18:41:32 +04:00