From 236601217f7ecfb4a1511421299e77057cfdbde0 Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Wed, 8 Mar 2017 08:29:41 +0100 Subject: core: remove __early_bss Initialize the .bss section early from assembler before entering C code. As a result, the __early_bss qualifier is not needed anymore. Remove it, as well as the related symbols (__early_bss_start and __early_bss_end). This makes the code simpler hence easier to maintain, at the expense of initialization time, since .bss is cleared before CPU caches are turned on (and doing it later would mean some C function have been called already). Here are some performance numbers measured on HiKey. The "memset" column measures the time it takes to clear .bss in C, without this patch. The "assembly" column reports the time taken by the clear_bss loop in this patch. Timings were performed using CNTPCT. Worst case is a ~1 ms overhead in boot time. memset(): | assembly: ms (bytes) | ms (bytes) --------------+-------------- Aarch64 0.30 (72824) | 0.08 (73528) Aarch32 0.27 (65016) | 1.24 (65408) Aarch32/pager 0.03 (11328) | 0.23 (11736) Signed-off-by: Jerome Forissier Tested-by: Jerome Forissier (QEMU) Tested-by: Jerome Forissier (HiKey 32/64) Tested-by: Jerome Forissier (HiKey/pager) Reviewed-by: Jens Wiklander --- core/kernel/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/kernel') diff --git a/core/kernel/console.c b/core/kernel/console.c index ebd13b56..36eb38b3 100644 --- a/core/kernel/console.c +++ b/core/kernel/console.c @@ -37,7 +37,7 @@ #include #endif -static struct serial_chip *serial_console __early_bss; +static struct serial_chip *serial_console; void __weak console_putc(int ch) { -- cgit v1.2.3