diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/bootstate.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/include/bootstate.h b/src/include/bootstate.h index 87ed0c8425..a1743a81ab 100644 --- a/src/include/bootstate.h +++ b/src/include/bootstate.h @@ -188,7 +188,11 @@ struct boot_state_init_entry { }; \ static struct boot_state_init_entry * \ bsie_ ## func_ ##_## state_ ##_## when_ BOOT_STATE_INIT_ATTR = \ - &func_ ##_## state_ ##_## when_; + &func_ ##_## state_ ##_## when_; \ + _Static_assert(!(state_ == BS_PAYLOAD_BOOT && when_ == BS_ON_EXIT), \ + "Invalid bootstate hook"); \ + _Static_assert(!(state_ == BS_OS_RESUME && when_ == BS_ON_EXIT), \ + "Invalid bootstate hook"); /* Hook per arch when coreboot is exiting to payload or ACPI OS resume. It's * the very last thing done before the transition. */ |