From 101ef0b528461a3fb662db150b16607430a2bd94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 18 Aug 2019 06:58:42 +0300 Subject: lib/bootblock: Add simplified entry with basetime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows for minor optimization as num_timestamps becomes a constant zero for a function with local scope. The loop with calls to timestamp_add() gets removed from bootblock. Change-Id: Id230075c0e76fe377b6ea8c8ddf8318e07d29b91 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/34972 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/lib/bootblock.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/lib/bootblock.c') diff --git a/src/lib/bootblock.c b/src/lib/bootblock.c index 3925e90afe..19841c6931 100644 --- a/src/lib/bootblock.c +++ b/src/lib/bootblock.c @@ -30,7 +30,15 @@ __weak void bootblock_soc_early_init(void) { /* do nothing */ } __weak void bootblock_soc_init(void) { /* do nothing */ } __weak void bootblock_mainboard_init(void) { /* do nothing */ } -asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp, +/* + * This is a the same as the bootblock main(), with the difference that it does + * not collect a timestamp. Instead it accepts the initial timestamp and + * possibly additional timestamp entries as arguments. This can be used in cases + * where earlier stamps are available. Note that this function is designed to be + * entered from C code. This function assumes that the timer has already been + * initialized, so it does not call init_timer(). + */ +static void bootblock_main_with_timestamp(uint64_t base_timestamp, struct timestamp_entry *timestamps, size_t num_timestamps) { /* Initialize timestamps if we have TIMESTAMP region in memlayout.ld. */ @@ -60,6 +68,11 @@ asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp, run_romstage(); } +void bootblock_main_with_basetime(uint64_t base_timestamp) +{ + bootblock_main_with_timestamp(base_timestamp, NULL, 0); +} + void main(void) { uint64_t base_timestamp = 0; -- cgit v1.2.3