diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-03-13 21:33:26 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-03-13 21:33:26 -0400 |
commit | 68296e8ec0dbf6a06df8cd47c2939ac750fe164d (patch) | |
tree | beaf058fb69aa15eb7dd56f66a183547ba860990 | |
parent | aafa6575e0324958805be19460cd0fa29ded2cec (diff) | |
download | seabios-68296e8ec0dbf6a06df8cd47c2939ac750fe164d.tar.gz |
Fix bug in apm32protected_entry.
Order of stack was not correct.
New implementation still needs to be tested.
-rw-r--r-- | src/romlayout.S | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/romlayout.S b/src/romlayout.S index 2fd0f839..d11741e2 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -158,7 +158,7 @@ __call16_from32: pushl %eax // Jump to 16bit mode - ljmp $REAL_MODE_CS, $1f + ljmpw $REAL_MODE_CS, $1f .code16gcc 1: @@ -261,18 +261,24 @@ apm16protected_entry: .code32 .globl apm32protected_entry apm32protected_entry: - pushfw // save flags - pushw %cs // Setup for long jump to 16bitmode - incw (%esp) - pushw 1f - lcallw *(%esp) + pushfw + pushw %cs // Setup for long jump to 16bit mode + pushw $1f + incw 2(%esp) + ljmpw *(%esp) + .code16gcc +1: + ENTRY_ARG handle_1553 + + movw $2f,(%esp) // Setup for long jump back to 32bit mode + decw 2(%esp) + ljmpw *(%esp) + .code32 +2: addl $4, %esp // pop call address popfw lretl .code16gcc -1: // 16bit entry point for apm32 code. - ENTRY_ARG handle_1553 - lretw /**************************************************************** |