aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib/sys/farcall.c
diff options
context:
space:
mode:
authorchandramouli narayanan <mouli@linux.intel.com>2012-06-25 12:34:46 -0700
committerchandramouli narayanan <mouli@linux.intel.com>2012-06-25 12:34:46 -0700
commit5caee9aeaf89dbbc45269737cc1dac7de070b867 (patch)
tree5284cfb67697c00d34cfca692e2da52f22e9716d /com32/lib/sys/farcall.c
parentc53187e1adc326c3246917cb936cbab020b4d820 (diff)
downloadsyslinux-5caee9aeaf89dbbc45269737cc1dac7de070b867.tar.gz
syslinux-5caee9aeaf89dbbc45269737cc1dac7de070b867.tar.xz
syslinux-5caee9aeaf89dbbc45269737cc1dac7de070b867.zip
This patch implements the setjmp/longjmp, memcpy, memmove, memset and mempcpy functions
as appropriate for the architecture. The code came from klibc. com32/lib has i386 and x86_64 sub directories implementing the code. The code in com32/lib/libgcc/__muldi3.S essentially has fixes for building x86_64. The file x86_init_fpu.c is split into the respective architecture specific files and reside under com32/lib/sys/i386 and com32/lib/sys/x86_64. The file com32/lib/sys/farcall.c has fixes for architecture-specific code. The com32 lib dependends on it. Remanants of the unused old i386-only files, if any, need to be pruned.
Diffstat (limited to 'com32/lib/sys/farcall.c')
-rw-r--r--com32/lib/sys/farcall.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/com32/lib/sys/farcall.c b/com32/lib/sys/farcall.c
index 988ee6d2..2749083e 100644
--- a/com32/lib/sys/farcall.c
+++ b/com32/lib/sys/farcall.c
@@ -6,9 +6,17 @@
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;
}