Skip to content

Commit 740a3e6

Browse files
committed
sh: Enable skipping of bss on debug platforms for sh32 also.
This enables the same functionality that sh64 has for sh32. When running on simulated hardware or via remote memory via the debug interface, memory is gauranteed to be zero on boot already, and skipping the zeroing of BSS has measurable boot time benefits. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 8a65505 commit 740a3e6

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

arch/sh/Kconfig.debug

+12-3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ config IRQSTACKS
9898
for handling hard and soft interrupts. This can help avoid
9999
overflowing the process kernel stacks.
100100

101+
config SH_NO_BSS_INIT
102+
bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
103+
depends on DEBUG_KERNEL
104+
default n
105+
help
106+
If running in painfully slow environments, such as an RTL
107+
simulation or from remote memory via SHdebug, where the memory
108+
can already be gauranteed to ber zeroed on boot, say Y.
109+
110+
For all other cases, say N. If this option seems perplexing, or
111+
you aren't sure, say N.
112+
101113
config MORE_COMPILE_OPTIONS
102114
bool "Add any additional compile options"
103115
help
@@ -125,9 +137,6 @@ config SH_ALPHANUMERIC
125137
bool "Enable debug outputs to on-board alphanumeric display"
126138
depends on SH_CAYMAN
127139

128-
config SH_NO_BSS_INIT
129-
bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
130-
131140
endif
132141

133142
endmenu

arch/sh/kernel/head_32.S

+10-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,14 @@ ENTRY(_stext)
8080
mov.l 7f, r0
8181
ldc r0, r7_bank ! ... and initial thread_info
8282
#endif
83-
84-
! Clear BSS area
83+
84+
#ifndef CONFIG_SH_NO_BSS_INIT
85+
/*
86+
* Don't clear BSS if running on slow platforms such as an RTL simulation,
87+
* remote memory via SHdebug link, etc. For these the memory can be guaranteed
88+
* to be all zero on boot anyway.
89+
*/
90+
! Clear BSS area
8591
#ifdef CONFIG_SMP
8692
mov.l 3f, r0
8793
cmp/eq #0, r0 ! skip clear if set to zero
@@ -97,6 +103,8 @@ ENTRY(_stext)
97103
mov.l r0,@-r2
98104

99105
10:
106+
#endif
107+
100108
! Additional CPU initialization
101109
mov.l 6f, r0
102110
jsr @r0

0 commit comments

Comments
 (0)