summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/bootstate.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/bootstate.h b/src/include/bootstate.h
index 9fac70113e..a64446a4a1 100644
--- a/src/include/bootstate.h
+++ b/src/include/bootstate.h
@@ -2,6 +2,7 @@
#ifndef BOOTSTATE_H
#define BOOTSTATE_H
+#include <assert.h>
#include <string.h>
#include <stddef.h>
/* Only declare main() when in ramstage. */
@@ -105,6 +106,15 @@ struct boot_state_callback {
#endif
};
+static inline const char *bscb_location(const struct boot_state_callback *bscb)
+{
+#if CONFIG(DEBUG_BOOT_STATE)
+ return bscb->location;
+#else
+ return dead_code_t(const char *);
+#endif
+}
+
#if CONFIG(DEBUG_BOOT_STATE)
#define BOOT_STATE_CALLBACK_LOC __FILE__ ":" STRINGIFY(__LINE__)
#define BOOT_STATE_CALLBACK_INIT_DEBUG .location = BOOT_STATE_CALLBACK_LOC,