aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-09-30 09:37:26 -0400
committerKevin O'Connor <kevin@koconnor.net>2014-09-30 09:42:55 -0400
commitd5c61747e4c1f041264aa0cf133b76fc9ae5a692 (patch)
tree862b3526b602d02a8dd69c08880f94a3b4ed72cc /src
parent12085439561f44107c7d3bea5a333a90ea987643 (diff)
downloadseabios-d5c61747e4c1f041264aa0cf133b76fc9ae5a692.tar.gz
pmm: Fix entry point to support non-zero %ss
If the pmm entry point was called with a non-zero stack segment, the pointer to the arguments on the stack would not be valid once the code transitioned to 32bit mode. Fix by adding the stack segment offset into the args pointer. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/romlayout.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/romlayout.S b/src/romlayout.S
index a3ba965e..028d1e8d 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -321,10 +321,11 @@ entry_pmm:
pushl %edx
pushw %es
pushw %ds
- movw %ss, %cx // Move %ss to %ds
+ movl %ss, %ecx // Move %ss to %ds
movw %cx, %ds
+ shll $4, %ecx
movl $_cfunc32flat_handle_pmm, %eax // Setup: call32(handle_pmm, args, -1)
- leal 28(%esp), %edx // %edx points to start of args
+ leal 28(%esp, %ecx), %edx // %edx points to start of args
movl $-1, %ecx
calll call32
movw %ax, 12(%esp) // Modify %ax:%dx to return %eax