diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/gcov-glue.c | 12 | ||||
-rw-r--r-- | src/lib/hardwaremain.c | 5 | ||||
-rw-r--r-- | src/lib/selfboot.c | 4 |
3 files changed, 8 insertions, 13 deletions
diff --git a/src/lib/gcov-glue.c b/src/lib/gcov-glue.c index 4e2b2908b3..ab9062b497 100644 --- a/src/lib/gcov-glue.c +++ b/src/lib/gcov-glue.c @@ -18,8 +18,8 @@ */ #include <stdint.h> +#include <bootstate.h> #include <cbmem.h> -#include <coverage.h> typedef struct file { uint32_t magic; @@ -128,7 +128,7 @@ static void setbuf(FILE *stream, char *buf) gcc_assert(buf == 0); } -void coverage_init(void) +static void coverage_init(void *unused) { extern long __CTOR_LIST__; typedef void (*func_ptr)(void) ; @@ -142,7 +142,7 @@ void coverage_init(void) } void __gcov_flush(void); -void coverage_exit(void) +static void coverage_exit(void *unused) { #if CONFIG_DEBUG_COVERAGE printk(BIOS_DEBUG, "Syncing coverage data.\n"); @@ -150,4 +150,8 @@ void coverage_exit(void) __gcov_flush(); } - +BOOT_STATE_INIT_ENTRIES(gcov_bscb) = { + BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_ENTRY, coverage_init, NULL), + BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, coverage_exit, NULL), + BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, coverage_exit, NULL), +}; diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c index d8b9d433f6..e4b2659515 100644 --- a/src/lib/hardwaremain.c +++ b/src/lib/hardwaremain.c @@ -38,7 +38,6 @@ #include <arch/acpi.h> #endif #include <cbmem.h> -#include <coverage.h> #include <timestamp.h> #if BOOT_STATE_DEBUG @@ -331,10 +330,6 @@ void hardwaremain(int boot_complete) timestamp_stash(TS_START_RAMSTAGE); post_code(POST_ENTRY_RAMSTAGE); -#if CONFIG_COVERAGE - coverage_init(); -#endif - /* console_init() MUST PRECEDE ALL printk()! */ console_init(); diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index be03b853a6..934c13196c 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -33,7 +33,6 @@ #if CONFIG_COLLECT_TIMESTAMPS #include <timestamp.h> #endif -#include <coverage.h> /* Maximum physical address we can use for the coreboot bounce buffer. */ #ifndef MAX_ADDR @@ -537,9 +536,6 @@ int selfboot(struct lb_memory *mem, struct cbfs_payload *payload) #if CONFIG_COLLECT_TIMESTAMPS timestamp_add_now(TS_SELFBOOT_JUMP); #endif -#if CONFIG_COVERAGE - coverage_exit(); -#endif /* Tear down the caching of the ROM. */ if (disable_cache_rom) |