summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-09-02 17:34:04 -0500
committerAaron Durbin <adurbin@chromium.org>2015-09-04 21:01:58 +0000
commit4d3de7e328fd92498fd7cf149a0aa887e33f8dfd (patch)
treeee9d7e90560ce453a801eb09f2c02a5b5c86a50b /src/include
parentc6a177d50064a22215c8f682e1d16043d5470fa8 (diff)
downloadcoreboot-4d3de7e328fd92498fd7cf149a0aa887e33f8dfd.tar.xz
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 <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11492 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/bootstate.h10
1 files changed, 7 insertions, 3 deletions
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 <rules.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
@@ -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 */