Commit Graph

6 Commits

Author SHA1 Message Date
Simon Glass
5209eaf9e5 efi: Switch x86 and ARM to use the unified stub
Now that the stub code is unified, switch over to it, dropping the
individual efi_main() functions.

Series-to: concept
Cover-letter:
efi: Unify the scripts and start-up code
We have two scripts which run QEMU, one for EFI and one for bare metal.
They have similar options so it seems reasonable to try to unify them a
bit. This series creates a common file and adjusts arguments so they are
consistent across both scripts.

The EFI app for ARM and x86 have different start-up code but in fact
the code is quiet similar. This series creates a new common main
program, called efi_main_common() which is used for both architectures.
The small number of differences are handled in arch-specific code.
END
2025-06-30 14:28:08 -06:00
Simon Glass
c3c7d368a0 efi: Move ARM over to use the common efi_main() function
Fill in the required helper functions and call efi_main_common() to
do everything else.

Delete the old efi_main() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:28:08 -06:00
Simon Glass
4df2a3f4a1 efi: Unify the names for use_uart and ebs_called
The x86 and ARM implementations use a different variable for the same
thing, just inverted.

Invent a third name for this, adjust both files to use it and store it
in the common stub.c file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:26:34 -06:00
Simon Glass
baee46f95b efi: Move more common stub code into the common file
Pull in several functions which are identical in the ARM and x86 files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:26:34 -06:00
Simon Glass
d43aab19fb efi: Create a common file for the stub
There is some duplicated code across x86 and ARM even though they have
slightly different implementations.

They both call efi_stub_exit_boot_services() and this function does not
relate to the app, so belongs better outside the general-purpose efi.c
file.

Create a new efi_stub C file containing this function. Leave out the
efi_ prefix since this is obvious from the directory name.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:26:34 -06:00
Simon Glass
0b00c34e7c efi: Drop the efi_ prefix on the arch-specific stub files
These are already in the lib/efi/ directory so the extra efi_ prefix is
redundant and makes files harder to find. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-30 14:26:34 -06:00