Add option to use Ada code in romstage

If selected, libgnat is linked into romstage. In addition, a call to
romstage_adainit() is added to support Ada program data
initialization.

BUG=b:252792591
BRANCH=firmware-brya-14505.B
TEST=Ada code compiles for romstage and loads successfully

Change-Id: I74f0460f6b14fde2b4bd6391e1782b2e5b217707
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70274
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jeremy Compostella
2022-11-30 19:26:01 -07:00
committed by Martin L Roth
parent e6b96dceab
commit fa83887e48
6 changed files with 31 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <adainit.h>
#include <arch/romstage.h>
#include <arch/symbols.h>
#include <commonlib/helpers.h>
@@ -40,6 +41,18 @@ void __noreturn romstage_main(void)
if (CONFIG(VBOOT_EARLY_EC_SYNC))
vboot_sync_ec();
/*
* We can generally jump between C and Ada code back and forth
* without trouble. But since we don't have an Ada main() we
* have to do some Ada package initializations that GNAT would
* do there. This has to be done before calling any Ada code.
*
* The package initializations should not have any dependen-
* cies on C code. So we can call them here early, and don't
* have to worry at which point we can start to use Ada.
*/
romstage_adainit();
mainboard_romstage_entry();
/* Check the stack. */