mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-04 12:16:51 -04:00
x86/boot: Use current_stack_pointer to avoid asm() in init_heap()
Use current_stack_pointer to avoid asm() in the calculation of stack_end in init_heap(). The new code is more readable and results in exactly the same object file. Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20240520083011.135342-1-ubizjak@gmail.com
This commit is contained in:
@@ -119,9 +119,8 @@ static void init_heap(void)
|
||||
char *stack_end;
|
||||
|
||||
if (boot_params.hdr.loadflags & CAN_USE_HEAP) {
|
||||
asm("leal %n1(%%esp),%0"
|
||||
: "=r" (stack_end) : "i" (STACK_SIZE));
|
||||
|
||||
stack_end = (char *)
|
||||
(current_stack_pointer - STACK_SIZE);
|
||||
heap_end = (char *)
|
||||
((size_t)boot_params.hdr.heap_end_ptr + 0x200);
|
||||
if (heap_end > stack_end)
|
||||
|
||||
Reference in New Issue
Block a user