diff options
author | chandramouli narayanan <mouli@linux.intel.com> | 2012-06-25 12:36:11 -0700 |
---|---|---|
committer | chandramouli narayanan <mouli@linux.intel.com> | 2012-06-25 12:36:11 -0700 |
commit | 3f7a44b8c18d9c9916b279872a0ef8701179e2e8 (patch) | |
tree | e70ed542afa525fa91d3f2bc4ef7b9fdaf01e2aa | |
parent | 5caee9aeaf89dbbc45269737cc1dac7de070b867 (diff) | |
download | syslinux-3f7a44b8c18d9c9916b279872a0ef8701179e2e8.tar.gz syslinux-3f7a44b8c18d9c9916b279872a0ef8701179e2e8.tar.xz syslinux-3f7a44b8c18d9c9916b279872a0ef8701179e2e8.zip |
Architecture dependency in LZO data compression library in subdirectory core/lzo/
is taken care to be able to build fo i386 for x86_64.
The implementation of eflags() in call16.c supported only 32bit, but now includes x86_64
as well. com32 lib build depends on it.
The file comboot.inc needed alignment specification for the variable ConfigName
in order to keep the linker happy. It's not clear why this would be needed for EFI.
Remanants of the unused old i386-only files, if any, need to be pruned.
-rw-r--r-- | core/call16.c | 10 | ||||
-rw-r--r-- | core/lzo/enter.ash | 11 | ||||
-rw-r--r-- | core/lzo/leave.ash | 11 | ||||
-rw-r--r-- | core/lzo/lzo_asm.h | 4 |
4 files changed, 34 insertions, 2 deletions
diff --git a/core/call16.c b/core/call16.c index 095f814f..0943a721 100644 --- a/core/call16.c +++ b/core/call16.c @@ -24,9 +24,17 @@ const com32sys_t zero_regs; /* Common all-zero register set */ static inline uint32_t eflags(void) { - uint32_t v; + //uint32_t v; +#if __SIZEOF_POINTER__ == 4 + uint32_t v; asm volatile("pushfl ; popl %0" : "=rm" (v)); +#elif __SIZEOF_POINTER__ == 8 + uint64_t v; + asm volatile("pushfq ; pop %0" : "=rm" (v)); +#else +#error "Unable to build for to-be-defined architecture type" +#endif return v; } diff --git a/core/lzo/enter.ash b/core/lzo/enter.ash index 49c455d6..e865c4cb 100644 --- a/core/lzo/enter.ash +++ b/core/lzo/enter.ash @@ -42,12 +42,23 @@ // ************************************************************************/ +#if __SIZEOF_POINTER__ == 4 pushl %ebp pushl %edi pushl %esi pushl %ebx pushl %ecx pushl %edx +#elif __SIZEOF_POINTER__ == 8 + push %rbp + push %rdi + push %rsi + push %rbx + push %rcx + push %rdx +#else +#error "unsupported architecture" +#endif subl $12,%esp cld diff --git a/core/lzo/leave.ash b/core/lzo/leave.ash index 9550b46f..f77e2efd 100644 --- a/core/lzo/leave.ash +++ b/core/lzo/leave.ash @@ -62,12 +62,23 @@ negl %eax addl $12,%esp +#if __SIZEOF_POINTER__ == 4 popl %edx popl %ecx popl %ebx popl %esi popl %edi popl %ebp +#elif __SIZEOF_POINTER__ == 8 + pop %rdx + pop %rcx + pop %rbx + pop %rsi + pop %rdi + pop %rbp +#else +#error "unsupported architecture" +#endif #if 1 ret #else diff --git a/core/lzo/lzo_asm.h b/core/lzo/lzo_asm.h index 55fdf6d1..5e870b85 100644 --- a/core/lzo/lzo_asm.h +++ b/core/lzo/lzo_asm.h @@ -42,10 +42,12 @@ // <asmconfig.h> ************************************************************************/ +/*support both i386 and x86_64 */ +/* #if !defined(__i386__) # error #endif - +*/ #if !defined(IN_CONFIGURE) #if defined(LZO_HAVE_CONFIG_H) # include <config.h> |