]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[libc] Split rmsetjmp() and rmlongjmp() into a separate rmsetjmp.h
authorMichael Brown <mcb30@ipxe.org>
Tue, 16 Feb 2016 15:48:03 +0000 (15:48 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 16 Feb 2016 16:06:25 +0000 (16:06 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/include/comboot.h
src/arch/i386/include/pxe_call.h
src/arch/i386/include/rmsetjmp.h [new file with mode: 0644]
src/arch/i386/include/setjmp.h
src/arch/i386/interface/pxe/pxe_call.c
src/arch/i386/interface/pxe/pxe_preboot.c
src/arch/i386/interface/syslinux/comboot_call.c

index 2d2f04fe173bd16f33a0d4563ef7bf5ca1d77891..5cb1ba54c958ff6d2c0a37321c11f1f1115856f7 100644 (file)
@@ -10,7 +10,7 @@
 FILE_LICENCE ( GPL2_OR_LATER );
 
 #include <stdint.h>
-#include <setjmp.h>
+#include <rmsetjmp.h>
 #include <ipxe/in.h>
 
 /** Segment used for COMBOOT PSP and image */
index cbd548318734a652c6d05020cc459d4132bfa79b..2ad0a9505c543e0ed18ff5e3e6f4061f2e8b66c6 100644 (file)
@@ -10,7 +10,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #include <pxe_api.h>
 #include <realmode.h>
-#include <setjmp.h>
+#include <rmsetjmp.h>
 
 struct net_device;
 
diff --git a/src/arch/i386/include/rmsetjmp.h b/src/arch/i386/include/rmsetjmp.h
new file mode 100644 (file)
index 0000000..3470be4
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _RMSETJMP_H
+#define _RMSETJMP_H
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#include <setjmp.h>
+#include <realmode.h>
+
+/** A real-mode-extended jump buffer */
+typedef struct {
+       /** Jump buffer */
+       jmp_buf env;
+       /** Real-mode stack pointer */
+       segoff_t rm_stack;
+} rmjmp_buf[1];
+
+#define rmsetjmp( _env ) ( {                                   \
+       (_env)->rm_stack.segment = rm_ss;                       \
+       (_env)->rm_stack.offset = rm_sp;                        \
+       setjmp ( (_env)->env ); } )                             \
+
+#define rmlongjmp( _env, _val ) do {                           \
+       rm_ss = (_env)->rm_stack.segment;                       \
+       rm_sp = (_env)->rm_stack.offset;                        \
+       longjmp ( (_env)->env, (_val) );                        \
+       } while ( 0 )
+
+#endif /* _RMSETJMP_H */
index fe1a9ef4d8dcdb7d163a04242564e502408a1296..98566696a04a2848323368bcf3bc98df538f2cc6 100644 (file)
@@ -4,7 +4,6 @@
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #include <stdint.h>
-#include <realmode.h>
 
 /** A jump buffer */
 typedef struct {
@@ -22,29 +21,10 @@ typedef struct {
        uint32_t ebp;
 } jmp_buf[1];
 
-/** A real-mode-extended jump buffer */
-typedef struct {
-       /** Jump buffer */
-       jmp_buf env;
-       /** Real-mode stack pointer */
-       segoff_t rm_stack;
-} rmjmp_buf[1];
-
 extern int __asmcall __attribute__ (( returns_twice ))
 setjmp ( jmp_buf env );
 
 extern void __asmcall __attribute__ (( noreturn ))
 longjmp ( jmp_buf env, int val );
 
-#define rmsetjmp( _env ) ( {                                   \
-       (_env)->rm_stack.segment = rm_ss;                       \
-       (_env)->rm_stack.offset = rm_sp;                        \
-       setjmp ( (_env)->env ); } )                             \
-
-#define rmlongjmp( _env, _val ) do {                           \
-       rm_ss = (_env)->rm_stack.segment;                       \
-       rm_sp = (_env)->rm_stack.offset;                        \
-       longjmp ( (_env)->env, (_val) );                        \
-       } while ( 0 )
-
 #endif /* _SETJMP_H */
index ed17a96a1b16abac602be94efff2cd3bcd5055c0..414b356d524d95f286b585f0b8899799c7a162d2 100644 (file)
@@ -27,7 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <ipxe/init.h>
 #include <ipxe/profile.h>
 #include <ipxe/netdevice.h>
-#include <setjmp.h>
+#include <rmsetjmp.h>
 #include <registers.h>
 #include <biosint.h>
 #include <pxe.h>
index cc9c052edf78c840add0ca6af532a817b4d39936..09e721b3437fbed0fd87abd1581f32b516910981 100644 (file)
@@ -33,7 +33,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <stdint.h>
 #include <string.h>
 #include <stdlib.h>
-#include <setjmp.h>
 #include <ipxe/uaccess.h>
 #include <ipxe/dhcp.h>
 #include <ipxe/fakedhcp.h>
@@ -44,6 +43,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 #include <ipxe/if_ether.h>
 #include <basemem_packet.h>
 #include <biosint.h>
+#include <rmsetjmp.h>
 #include "pxe.h"
 #include "pxe_call.h"
 
index 69d94c407ad3652bdd583a33b2fa8151bdbb1788..d70340c6554796d8e4d926d00f33509e9dbddb31 100644 (file)
@@ -32,7 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <comboot.h>
 #include <bzimage.h>
 #include <pxe_call.h>
-#include <setjmp.h>
+#include <rmsetjmp.h>
 #include <string.h>
 #include <ipxe/posix_io.h>
 #include <ipxe/process.h>