summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/hardwaremain.c20
-rw-r--r--src/lib/rmodule.ld4
2 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index dba47a7348..0a5a522b99 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -293,6 +293,23 @@ int boot_state_sched_on_exit(struct boot_state_callback *bscb,
return boot_state_sched_callback(state, bscb, BS_ON_EXIT);
}
+static void boot_state_schedule_static_entries(void)
+{
+ extern struct boot_state_init_entry _bs_init_begin;
+ extern struct boot_state_init_entry _bs_init_end;
+ struct boot_state_init_entry *cur;
+
+ cur = &_bs_init_begin;
+
+ while (cur != &_bs_init_end) {
+ if (cur->when == BS_ON_ENTRY)
+ boot_state_sched_on_entry(&cur->bscb, cur->state);
+ else
+ boot_state_sched_on_exit(&cur->bscb, cur->state);
+ cur++;
+ }
+}
+
void hardwaremain(int boot_complete)
{
timestamp_stash(TS_START_RAMSTAGE);
@@ -318,6 +335,9 @@ void hardwaremain(int boot_complete)
hard_reset();
}
+ /* Schedule the static boot state entries. */
+ boot_state_schedule_static_entries();
+
/* FIXME: Is there a better way to handle this? */
init_timer();
diff --git a/src/lib/rmodule.ld b/src/lib/rmodule.ld
index 96401a1715..0cdbb2fa25 100644
--- a/src/lib/rmodule.ld
+++ b/src/lib/rmodule.ld
@@ -61,6 +61,10 @@ SECTIONS
cpu_drivers = . ;
*(.rodata.cpu_driver)
ecpu_drivers = . ;
+ _bs_init_begin = .;
+ *(.bs_init)
+ _bs_init_end = .;
+
. = ALIGN(4);
*(.rodata);