diff options
author | Helge Deller <deller@gmx.de> | 2021-09-24 10:42:59 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2021-09-24 11:10:17 +0200 |
commit | 0f38ada123728ef6582697157ae87799678d4412 (patch) | |
tree | e72f8cd4e8f952949418530cad9ab2b36bfde8d5 /src/parisc | |
parent | bcc894215bc60502046f8cf80ebd7bfc7f7f0c9b (diff) | |
download | seabios-hppa-0f38ada123728ef6582697157ae87799678d4412.zip seabios-hppa-0f38ada123728ef6582697157ae87799678d4412.tar.gz seabios-hppa-0f38ada123728ef6582697157ae87799678d4412.tar.bz2 |
parisc: Fix boot priority and malloc initializations
Make the malloc area initialization the first step after bootup.
It's important, because the first mallocs otherwise ends up in lower
memory area (PAGE0 from parisc) which will gets overwritten later.
That change fixes the fw_cfg() interface as well. Before that change
fw_cfg got initialized and zeroed-out shortly later in the boot process.
And now the initialization of the boot structures succeeds too, so we
can run boot_init() directly after setting up malloc and fw_cfg, and the
bootindex parameter from qemu suddenly works out of the box.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'src/parisc')
-rw-r--r-- | src/parisc/parisc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index ac69904..2634b62 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -1778,10 +1778,16 @@ void __VISIBLE start_parisc_firmware(void) if (ram_size >= FIRMWARE_START) ram_size = FIRMWARE_START; + /* Initialize malloc stack */ + malloc_preinit(); + /* Initialize qemu fw_cfg interface */ PORT_QEMU_CFG_CTL = fw_cfg_port; qemu_cfg_init(); + /* Initialize boot structures. Needs working fw_cfg for bootprio option. */ + boot_init(); + i = romfile_loadint("/etc/firmware-min-version", 0); if (i && i > SEABIOS_HPPA_VERSION) { printf("\nSeaBIOS firmware is version %d, but version %d is required. " @@ -1859,8 +1865,6 @@ void __VISIBLE start_parisc_firmware(void) chassis_code = 0; - malloc_preinit(); - // set Qemu serial debug port DebugOutputPort = PARISC_SERIAL_CONSOLE; // PlatformRunningOn = PF_QEMU; // emulate runningOnQEMU() |