The call32() and call16_back() functions will always disable NMI and enable a20 (via the call32_prep() function) so it is safe to use the _nmi_off variant of transition32.
Signed-off-by: Kevin O'Connor kevin@koconnor.net --- src/romlayout.S | 1 + src/stacks.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/romlayout.S b/src/romlayout.S index e223cdc..fefc212 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -22,6 +22,7 @@ // %edx = return location (in 32bit mode) // Clobbers: ecx, flags, segment registers, cr0, idt/gdt DECLFUNC transition32 + .global transition32_nmi_off transition32: // Disable irqs (and clear direction flag) cli diff --git a/src/stacks.c b/src/stacks.c index a1b8677..850a335 100644 --- a/src/stacks.c +++ b/src/stacks.c @@ -223,7 +223,7 @@ call32(void *func, u32 eax, u32 errret)
// Transition to 32bit mode, call func, return to 16bit " movl $(" __stringify(BUILD_BIOS_ADDR) " + 1f), %%edx\n" - " jmp transition32\n" + " jmp transition32_nmi_off\n" ASM16_SWITCH32 "1:calll *%3\n" " movl $2f, %%edx\n" @@ -274,7 +274,7 @@ call16_back(u32 eax, u32 edx, void *func) " calll _cfunc16_call16_helper\n" // Return to 32bit and restore esp " movl $2f, %%edx\n" - " jmp transition32\n" + " jmp transition32_nmi_off\n" ASM32_BACK32 "2:addl %2, %%esp\n" : "+a" (eax), "+c"(thunk), "+r"(stackseg)