From 4d3de7e328fd92498fd7cf149a0aa887e33f8dfd Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 2 Sep 2015 17:34:04 -0500 Subject: bootstate: remove need for #ifdef ENV_RAMSTAGE The BOOT_STATE_INIT_ENTRY macro can only be used in ramstage, however the current state of the header meant bad build errors in non-ramstage. Therefore, people had to #ifdef in the source. Remove that requirement. Change-Id: I8755fc68bbaca6b72fbe8b4db4bcc1ccb35622bd Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/11492 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/include/bootstate.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/include') diff --git a/src/include/bootstate.h b/src/include/bootstate.h index 4952780560..8dafa04d99 100644 --- a/src/include/bootstate.h +++ b/src/include/bootstate.h @@ -19,8 +19,7 @@ #ifndef BOOTSTATE_H #define BOOTSTATE_H -#if !defined(__SMM__) && !defined(__PRE_RAM__) - +#include #include #include #include @@ -173,8 +172,10 @@ int boot_state_unblock(boot_state_t state, boot_state_sequence_t seq); void boot_state_current_block(void); void boot_state_current_unblock(void); +#if ENV_RAMSTAGE /* Entry into the boot state machine. */ void main(void); +#endif /* In order to schedule boot state callbacks at compile-time specify the * entries in an array using the BOOT_STATE_INIT_ENTRIES and @@ -185,7 +186,11 @@ struct boot_state_init_entry { struct boot_state_callback bscb; }; +#if ENV_RAMSTAGE #define BOOT_STATE_INIT_ATTR __attribute__ ((used,section (".bs_init"))) +#else +#define BOOT_STATE_INIT_ATTR __attribute__ ((unused)) +#endif #define BOOT_STATE_INIT_ENTRY(state_, when_, func_, arg_) \ static struct boot_state_init_entry func_ ##_## state_ ##_## when_ = \ @@ -198,5 +203,4 @@ struct boot_state_init_entry { bsie_ ## func_ ##_## state_ ##_## when_ BOOT_STATE_INIT_ATTR = \ & func_ ##_## state_ ##_## when_; -#endif #endif /* BOOTSTATE_H */ -- cgit v1.2.3