Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARM linux kernel head-common.S

I was looking head-common.S

at the __mmap_switched:

.long   init_thread_union + THREAD_START_SP @ sp //for stack pointer

THREAD_START_SP is defined THREAD_SIZE(8192) - 8 in "thread+info.h"

set stack size 8KB(8129) and minus 8byte.

why minus 8byte?

i suspect, i think DA(decrement after) right?

like image 211
csms Avatar asked May 30 '26 14:05

csms


1 Answers

The 8 bytes aligned is the requirement in APCS.

In APCS, the chapter 5.2.1 The Stack,

The stack must also conform to the following constraint at a public interface:

SP mod 8 = 0. The stack must be double-word aligned.

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.swdev.abi/index.html

like image 79
jumper Avatar answered Jun 01 '26 17:06

jumper