[syslinux:firmware] Architecture dependency in LZO data compression library in subdirectory core /lzo/ is taken care to be able to build fo i386 for x86_64.

syslinux-bot for chandramouli narayanan mouli at linux.intel.com
Fri Nov 9 09:06:19 PST 2012


Commit-ID:  3f7a44b8c18d9c9916b279872a0ef8701179e2e8
Gitweb:     http://www.syslinux.org/commit/3f7a44b8c18d9c9916b279872a0ef8701179e2e8
Author:     chandramouli narayanan <mouli at linux.intel.com>
AuthorDate: Mon, 25 Jun 2012 12:36:11 -0700
Committer:  chandramouli narayanan <mouli at linux.intel.com>
CommitDate: Mon, 25 Jun 2012 12:36:11 -0700

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.

---
 core/call16.c      |   10 +++++++++-
 core/lzo/enter.ash |   11 +++++++++++
 core/lzo/leave.ash |   11 +++++++++++
 core/lzo/lzo_asm.h |    4 +++-
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/core/call16.c b/core/call16.c
index 095f814..0943a72 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 49c455d..e865c4c 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 9550b46..f77e2ef 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 55fdf6d..5e870b8 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>


More information about the Syslinux-commits mailing list