summaryrefslogtreecommitdiff
path: root/src/lib/cbmem_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/cbmem_common.c')
-rw-r--r--src/lib/cbmem_common.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/lib/cbmem_common.c b/src/lib/cbmem_common.c
index e9beb5fe6a..496bafa986 100644
--- a/src/lib/cbmem_common.c
+++ b/src/lib/cbmem_common.c
@@ -20,30 +20,28 @@
#include <cbmem.h>
#include <bootstate.h>
#include <rules.h>
+#include <symbols.h>
#if IS_ENABLED(CONFIG_ARCH_X86) && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)
#include <arch/acpi.h>
#endif
-/* FIXME: Remove after CBMEM_INIT_HOOKS. */
-#include <console/cbmem_console.h>
-#include <timestamp.h>
-
-
-/* FIXME: Replace with CBMEM_INIT_HOOKS API. */
-#if !IS_ENABLED(CONFIG_ARCH_X86)
void cbmem_run_init_hooks(void)
{
- /* Relocate CBMEM console. */
- cbmemc_reinit();
+ cbmem_init_hook_t *init_hook_ptr = (cbmem_init_hook_t*) &_cbmem_init_hooks;
+ cbmem_init_hook_t *einit_hook_ptr = (cbmem_init_hook_t*) &_ecbmem_init_hooks;
- /* Relocate timestamps stash. */
- timestamp_reinit();
+ if (_cbmem_init_hooks_size == 0)
+ return;
+
+ while (init_hook_ptr != einit_hook_ptr) {
+ (*init_hook_ptr)();
+ init_hook_ptr++;
+ }
}
void __attribute__((weak)) cbmem_fail_resume(void)
{
}
-#endif
#if ENV_RAMSTAGE && !IS_ENABLED(CONFIG_EARLY_CBMEM_INIT)
static void init_cbmem_post_device(void *unused)