Skip to content

Commit 783fbb9

Browse files
committed
using lea to determine the effective address of the boot stack
1 parent 69d0d0a commit 783fbb9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/arch/x86_64/start.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ pub unsafe extern "C" fn pre_main() -> ! {
2626
pub unsafe extern "C" fn _start() -> ! {
2727
asm!(
2828
// initialize stack pointer
29-
"mov rsp, {stack}",
30-
"add rsp, {size}",
29+
"lea rsp, [{stack}+{size}]",
3130
"call {pre_main}",
3231
stack = sym BOOT_STACK,
3332
size = const STACK_SIZE - 16,

0 commit comments

Comments
 (0)