Browse Source

[libc] Split rmsetjmp() and rmlongjmp() into a separate rmsetjmp.h

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
b9c4c2676b

+ 1
- 1
src/arch/i386/include/comboot.h View File

@@ -10,7 +10,7 @@
10 10
 FILE_LICENCE ( GPL2_OR_LATER );
11 11
 
12 12
 #include <stdint.h>
13
-#include <setjmp.h>
13
+#include <rmsetjmp.h>
14 14
 #include <ipxe/in.h>
15 15
 
16 16
 /** Segment used for COMBOOT PSP and image */

+ 1
- 1
src/arch/i386/include/pxe_call.h View File

@@ -10,7 +10,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
10 10
 
11 11
 #include <pxe_api.h>
12 12
 #include <realmode.h>
13
-#include <setjmp.h>
13
+#include <rmsetjmp.h>
14 14
 
15 15
 struct net_device;
16 16
 

+ 28
- 0
src/arch/i386/include/rmsetjmp.h View File

@@ -0,0 +1,28 @@
1
+#ifndef _RMSETJMP_H
2
+#define _RMSETJMP_H
3
+
4
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5
+
6
+#include <setjmp.h>
7
+#include <realmode.h>
8
+
9
+/** A real-mode-extended jump buffer */
10
+typedef struct {
11
+	/** Jump buffer */
12
+	jmp_buf env;
13
+	/** Real-mode stack pointer */
14
+	segoff_t rm_stack;
15
+} rmjmp_buf[1];
16
+
17
+#define rmsetjmp( _env ) ( {					\
18
+	(_env)->rm_stack.segment = rm_ss;			\
19
+	(_env)->rm_stack.offset = rm_sp;			\
20
+	setjmp ( (_env)->env ); } )				\
21
+
22
+#define rmlongjmp( _env, _val ) do {				\
23
+	rm_ss = (_env)->rm_stack.segment;			\
24
+	rm_sp = (_env)->rm_stack.offset;			\
25
+	longjmp ( (_env)->env, (_val) );			\
26
+	} while ( 0 )
27
+
28
+#endif /* _RMSETJMP_H */

+ 0
- 20
src/arch/i386/include/setjmp.h View File

@@ -4,7 +4,6 @@
4 4
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5 5
 
6 6
 #include <stdint.h>
7
-#include <realmode.h>
8 7
 
9 8
 /** A jump buffer */
10 9
 typedef struct {
@@ -22,29 +21,10 @@ typedef struct {
22 21
 	uint32_t ebp;
23 22
 } jmp_buf[1];
24 23
 
25
-/** A real-mode-extended jump buffer */
26
-typedef struct {
27
-	/** Jump buffer */
28
-	jmp_buf env;
29
-	/** Real-mode stack pointer */
30
-	segoff_t rm_stack;
31
-} rmjmp_buf[1];
32
-
33 24
 extern int __asmcall __attribute__ (( returns_twice ))
34 25
 setjmp ( jmp_buf env );
35 26
 
36 27
 extern void __asmcall __attribute__ (( noreturn ))
37 28
 longjmp ( jmp_buf env, int val );
38 29
 
39
-#define rmsetjmp( _env ) ( {					\
40
-	(_env)->rm_stack.segment = rm_ss;			\
41
-	(_env)->rm_stack.offset = rm_sp;			\
42
-	setjmp ( (_env)->env ); } )				\
43
-
44
-#define rmlongjmp( _env, _val ) do {				\
45
-	rm_ss = (_env)->rm_stack.segment;			\
46
-	rm_sp = (_env)->rm_stack.offset;			\
47
-	longjmp ( (_env)->env, (_val) );			\
48
-	} while ( 0 )
49
-
50 30
 #endif /* _SETJMP_H */

+ 1
- 1
src/arch/i386/interface/pxe/pxe_call.c View File

@@ -27,7 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
27 27
 #include <ipxe/init.h>
28 28
 #include <ipxe/profile.h>
29 29
 #include <ipxe/netdevice.h>
30
-#include <setjmp.h>
30
+#include <rmsetjmp.h>
31 31
 #include <registers.h>
32 32
 #include <biosint.h>
33 33
 #include <pxe.h>

+ 1
- 1
src/arch/i386/interface/pxe/pxe_preboot.c View File

@@ -33,7 +33,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
33 33
 #include <stdint.h>
34 34
 #include <string.h>
35 35
 #include <stdlib.h>
36
-#include <setjmp.h>
37 36
 #include <ipxe/uaccess.h>
38 37
 #include <ipxe/dhcp.h>
39 38
 #include <ipxe/fakedhcp.h>
@@ -44,6 +43,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
44 43
 #include <ipxe/if_ether.h>
45 44
 #include <basemem_packet.h>
46 45
 #include <biosint.h>
46
+#include <rmsetjmp.h>
47 47
 #include "pxe.h"
48 48
 #include "pxe_call.h"
49 49
 

+ 1
- 1
src/arch/i386/interface/syslinux/comboot_call.c View File

@@ -32,7 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
32 32
 #include <comboot.h>
33 33
 #include <bzimage.h>
34 34
 #include <pxe_call.h>
35
-#include <setjmp.h>
35
+#include <rmsetjmp.h>
36 36
 #include <string.h>
37 37
 #include <ipxe/posix_io.h>
38 38
 #include <ipxe/process.h>

Loading…
Cancel
Save