Angel Pons | 32859fc | 2020-04-02 23:48:27 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Nico Huber | e0ed902 | 2016-10-07 12:58:17 +0200 | [diff] [blame] | 2 | |
| 3 | #ifndef _ADAINIT_H |
| 4 | #define _ADAINIT_H |
| 5 | |
| 6 | /** |
| 7 | * @file adainit.h |
| 8 | * |
| 9 | * Ada supports some complex constructs that result in code for runtime |
| 10 | * initialization. It's also possible to have explicit procedures for |
| 11 | * package level initialization (e.g. you can initialize huge arrays in |
| 12 | * a loop instead of cluttering the binary). |
| 13 | * |
Elyes HAOUAS | 8250e2e | 2019-12-06 20:25:56 +0100 | [diff] [blame] | 14 | * When an Ada main() is in charge, GNAT emits the call to the initia- |
Nico Huber | e0ed902 | 2016-10-07 12:58:17 +0200 | [diff] [blame] | 15 | * lizations automatically. When not, we have to call it explicitly. |
| 16 | */ |
| 17 | |
Jeremy Compostella | fa83887 | 2022-11-30 19:26:01 -0700 | [diff] [blame] | 18 | #if CONFIG(ROMSTAGE_ADA) |
| 19 | void romstage_adainit(void); |
| 20 | #else |
| 21 | static inline void romstage_adainit(void) {} |
| 22 | #endif |
| 23 | |
Julius Werner | cd49cce | 2019-03-05 16:53:33 -0800 | [diff] [blame] | 24 | #if CONFIG(RAMSTAGE_ADA) |
Nico Huber | e0ed902 | 2016-10-07 12:58:17 +0200 | [diff] [blame] | 25 | void ramstage_adainit(void); |
| 26 | #else |
| 27 | static inline void ramstage_adainit(void) {} |
| 28 | #endif |
| 29 | |
| 30 | #endif /* _ADAINIT_H */ |