diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-04 21:56:06 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-04 21:56:06 -0700 |
commit | 23bd63a7019775ef320550183ae7757e2da24350 (patch) | |
tree | 1fe2ebd65ba9e30c86d179cca927ce690810a93c | |
parent | 28027a6a855c1401717663968a3e2fb30832f86c (diff) | |
download | syslinux-23bd63a7019775ef320550183ae7757e2da24350.tar.gz |
bcopyxx: EDX already points to the GDT; no reason to recompute
We already have the EDX register pointing to the GDT, so recomputing
the address of the GDT is completely pointless. This shaves an
additional few bytes off the bcopyxx safe area (now down to 543 bytes
including the 128-byte stack and the 15-byte alignment slop.)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | core/bcopyxx.inc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/bcopyxx.inc b/core/bcopyxx.inc index 4d0266e6..4689788e 100644 --- a/core/bcopyxx.inc +++ b/core/bcopyxx.inc @@ -239,19 +239,16 @@ pm_shuffle: jmp edi ; Protected mode entry ; We have a real-mode entry point, so we need to return - ; to real mode... + ; to real mode. Note: EDX already points to the GDT. pm_shuffle_real_mode: - call .here -.here: pop ebx mov eax,edi - add ebx,bcopy_gdt-.here - mov [ebx+PM_CS16+2],ax - mov [ebx+PM_DS16+2],ax + mov [edx+PM_CS16+2],ax + mov [edx+PM_DS16+2],ax shr eax,16 - mov [ebx+PM_CS16+4],al - mov [ebx+PM_CS16+7],ah - mov [ebx+PM_DS16+4],al - mov [ebx+PM_DS16+7],ah + mov [edx+PM_CS16+4],al + mov [edx+PM_CS16+7],ah + mov [edx+PM_DS16+4],al + mov [edx+PM_DS16+7],ah mov eax,cr0 and al,~1 popfd ; Clean the flags |