提交 2dedcf9a 编写于 作者: M Mao Minkai 提交者: guzitao

sw64: clear .bss section using memset()

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5XTGY

--------------------------------
Signed-off-by: NMao Minkai <maominkai@wxiat.com>
Reviewed-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 c3084e72
......@@ -26,23 +26,11 @@ __start:
/* ... and find our stack ... */
ldi $30, ASM_THREAD_SIZE($8)
/* ... and then we can clear bss data. */
ldi $2, __bss_start
ldi $3, __bss_stop
/* 8 bytes alignment */
1: and $2, 0x7, $1 # align check
bne $1, 3f
2: subl $3, $2, $1 # align clear
ble $1, 4f
subl $1, 0x8, $1
ble $1, 3f
stl $31, 0($2)
addl $2, 8, $2
br $31, 2b
3: stb $31, 0($2) # non align clear
addl $2, 1, $2
subl $3, $2, $1
bgt $1, 1b
4:# finish clear
ldi $16, __bss_start
ldi $18, __bss_stop
subl $18, $16, $18
mov $31, $17
call $26, __constant_c_memset
#ifdef CONFIG_RELOCATABLE
ldi $30, -8($30)
stl $29, 0($30)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册