aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-04-27 13:48:24 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-04-27 13:48:24 -0700
commit071394c8fe611d6c75338d80dfafc76264599096 (patch)
tree7c6b2e4d85d348ffd1ef75a3f0055e988a8404d0
parent6c0fb9ea3e8ac6ecf7c9fe3f8708999c0031e9b6 (diff)
downloadsyslinux.git-071394c8fe611d6c75338d80dfafc76264599096.tar.gz
syslinux.git-071394c8fe611d6c75338d80dfafc76264599096.tar.xz
syslinux.git-071394c8fe611d6c75338d80dfafc76264599096.zip
bcopyxx: align the relocated code to a 16-byte boundary
Align the relocated bcopyxx code to a 16-byte boundary. There are CPUs which have errata relating to GDTs which are not 16-byte aligned. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/bcopyxx.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/bcopyxx.inc b/core/bcopyxx.inc
index b237b005..06b03b2a 100644
--- a/core/bcopyxx.inc
+++ b/core/bcopyxx.inc
@@ -205,7 +205,8 @@ pm_bcopy:
;
pm_shuffle:
mov ebx,edi ; EBX <- descriptor list
- lea edx,[edi+ecx] ; EDX <- shuffler end location
+ lea edx,[edi+ecx+15] ; EDX <- where to relocate our code to
+ and edx,~15 ; Align 16 to benefit the GDT
call pm_bcopy
mov edi,edx
mov esi,bcopyxx_start
@@ -299,7 +300,8 @@ bcopyxx_len equ $-bcopyxx_start
bcopyxx_dwords equ bcopyxx_len >> 2
bcopyxx_stack equ 128 ; We want this much stack
-bcopyxx_safe equ bcopyxx_len + bcopyxx_stack
+ ; The +15 is for alignment
+bcopyxx_safe equ bcopyxx_len + bcopyxx_stack + 15
;
; Space for a dummy task state segment. It should never be actually