From 7506c1566998d188867423bd184a9dd00a9246c4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 7 Nov 2024 14:31:46 -0700 Subject: sandbox: Report host default-filename in native mode When the --native flag is given, pretend to be running the host architecture rather than sandbox. Allow the same control for PXE too. Signed-off-by: Simon Glass --- include/efi.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') diff --git a/include/efi.h b/include/efi.h index 789a64eda9d..c559fda3004 100644 --- a/include/efi.h +++ b/include/efi.h @@ -678,6 +678,21 @@ void efi_show_tables(struct efi_system_table *systab); */ const char *efi_get_basename(void); +#ifdef CONFIG_SANDBOX +#include +#endif + +static inline bool efi_use_host_arch(void) +{ +#ifdef CONFIG_SANDBOX + struct sandbox_state *state = state_get_current(); + + return state->native; +#else + return false; +#endif +} + /** * efi_get_pxe_arch() - Get the architecture value for PXE * -- cgit v1.3.1