[syslinux:wip.makefixes] setjmp: for EFI, use setjmp() from gnu-efi
syslinux-bot for H. Peter Anvin (Intel)
hpa at zytor.com
Mon Mar 25 14:51:13 PDT 2019
Commit-ID: 80b516df534ff9d6cb0659d7eff6022d959cb334
Gitweb: https://www.syslinux.org/commit/80b516df534ff9d6cb0659d7eff6022d959cb334
Author: H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Sat, 23 Mar 2019 17:06:48 -0700
Committer: H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Sat, 23 Mar 2019 17:06:48 -0700
setjmp: for EFI, use setjmp() from gnu-efi
setjmp() is provided by gnu-efi, so if we are using gnu-efi, use the
version defined in <efi.h>, not the one from klibc.
Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>
---
com32/include/setjmp.h | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/com32/include/setjmp.h b/com32/include/setjmp.h
index e7090955..3403b72c 100644
--- a/com32/include/setjmp.h
+++ b/com32/include/setjmp.h
@@ -5,24 +5,32 @@
#ifndef _SETJMP_H
#define _SETJMP_H
-#include <klibc/extern.h>
-#include <klibc/compiler.h>
-#include <stddef.h>
-
-#if __SIZEOF_POINTER__ == 4
-#include <klibc/i386/archsetjmp.h>
-#elif __SIZEOF_POINTER__ == 8
-#include <klibc/x86_64/archsetjmp.h>
+#if defined(__FIRMWARE_EFI32__) || defined(__FIRMWARE_EFI64__)
+
+# include <efi.h>
+
#else
-#error "unsupported architecture"
-#endif
+
+# include <klibc/extern.h>
+# include <klibc/compiler.h>
+# include <stddef.h>
+
+# ifdef __i386__
+# include <klibc/i386/archsetjmp.h>
+# elif defined(__x86_64__)
+# include <klibc/x86_64/archsetjmp.h>
+# else
+# error "unsupported architecture"
+# endif
__extern int setjmp(jmp_buf);
__extern __noreturn longjmp(jmp_buf, int);
typedef jmp_buf sigjmp_buf;
-#define sigsetjmp(__env, __save) setjmp(__env)
-#define siglongjmp(__env, __val) longjmp(__env, __val)
+# define sigsetjmp(__env, __save) setjmp(__env)
+# define siglongjmp(__env, __val) longjmp(__env, __val)
+
+#endif
#endif /* _SETJMP_H */
More information about the Syslinux-commits
mailing list