Skip to content

Commit

Permalink
setup: use tail-call for kernel_main jump
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Suggested-By: Mathias Krause <[email protected]>
  • Loading branch information
wipawel authored and 82marbag committed Oct 8, 2021
1 parent 4431f14 commit 6de0aa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void __noreturn __text_init kernel_start(uint32_t multiboot_magic,
init_keyboard(get_bsp_cpu_id());

/* Jump from .text.init section to .text */
asm volatile("push %0; ret" ::"r"(&kernel_main));
asm volatile("jmp kernel_main");

UNREACHABLE();
}

0 comments on commit 6de0aa7

Please sign in to comment.