:: commit b70966e12d0817c66c3cd64191f13c5295cfa056

mintsuki <mintsuki@protonmail.com> — 2021-12-12 17:25

parents: 90a07f0da6

Revert "menu: Entry assembly fixes"

This reverts commit 90a07f0da6f7569adf11f58dc4ab7259c3404dce.
diff --git a/stage23/menu.c b/stage23/menu.c
index fb063ca5..b04c1066 100644
--- a/stage23/menu.c
+++ b/stage23/menu.c
@@ -539,7 +539,6 @@ __attribute__((noreturn, naked))
 void menu(__attribute__((unused)) bool timeout_enabled) {
 #if defined (__i386__)
     asm volatile (
-        "pop %eax\n\t"
         "call 1f\n\t"
         "1:\n\t"
         "pop %eax\n\t"
@@ -547,17 +546,14 @@ void menu(__attribute__((unused)) bool timeout_enabled) {
         "cmpl $0, (%eax)\n\t"
         "jne 1f\n\t"
         "mov %esp, (%eax)\n\t"
-        "jmp 3f\n\t"
+        "jmp _menu\n\t"
         "1:\n\t"
         "mov (%esp), %edi\n\t"
         "mov (%eax), %esp\n\t"
         "push %edi\n\t"
-        "jmp 3f\n\t"
+        "call _menu\n\t"
         "2:\n\t"
-        ".long 0\n\t"
-        "3:\n\t"
-        "push $0\n\t"
-        "jmp _menu"
+        ".long 0"
     );
 #elif defined (__x86_64__)
     asm volatile (
@@ -565,11 +561,9 @@ void menu(__attribute__((unused)) bool timeout_enabled) {
         "cmp %rax, stack_at_first_entry(%rip)\n\t"
         "jne 1f\n\t"
         "mov %rsp, stack_at_first_entry(%rip)\n\t"
-        "jmp 2f\n\t"
+        "jmp _menu\n\t"
         "1:\n\t"
         "mov stack_at_first_entry(%rip), %rsp\n\t"
-        "2:\n\t"
-        "push $0\n\t"
         "jmp _menu"
     );
 #endif
tab: 248 wrap: offon