summaryrefslogtreecommitdiff
path: root/arch/x86/boot
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2024-05-20 10:29:55 +0200
committerIngo Molnar <mingo@kernel.org>2024-05-21 13:36:36 +0200
commitb855cc58fc93c175fd5bb868d5e3a45cb3e1a42b (patch)
tree9f7665afde9c5bd0e582a33164f7cb31c0374ae3 /arch/x86/boot
parent41c14f1ac82cdb1e009d635ffd5ae5dc4cc3f036 (diff)
downloadlinux-b855cc58fc93c175fd5bb868d5e3a45cb3e1a42b.tar.gz
linux-b855cc58fc93c175fd5bb868d5e3a45cb3e1a42b.tar.bz2
linux-b855cc58fc93c175fd5bb868d5e3a45cb3e1a42b.zip
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
Diffstat (limited to 'arch/x86/boot')
-rw-r--r--arch/x86/boot/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
index 9049f390d834..ac78f8c01908 100644
--- a/arch/x86/boot/main.c
+++ b/arch/x86/boot/main.c
@@ -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)