瀏覽代碼

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 年之前
父節點
當前提交
b9c4c2676b

+ 1
- 1
src/arch/i386/include/comboot.h 查看文件

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

+ 1
- 1
src/arch/i386/include/pxe_call.h 查看文件

10
 
10
 
11
 #include <pxe_api.h>
11
 #include <pxe_api.h>
12
 #include <realmode.h>
12
 #include <realmode.h>
13
-#include <setjmp.h>
13
+#include <rmsetjmp.h>
14
 
14
 
15
 struct net_device;
15
 struct net_device;
16
 
16
 

+ 28
- 0
src/arch/i386/include/rmsetjmp.h 查看文件

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 查看文件

4
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
4
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5
 
5
 
6
 #include <stdint.h>
6
 #include <stdint.h>
7
-#include <realmode.h>
8
 
7
 
9
 /** A jump buffer */
8
 /** A jump buffer */
10
 typedef struct {
9
 typedef struct {
22
 	uint32_t ebp;
21
 	uint32_t ebp;
23
 } jmp_buf[1];
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
 extern int __asmcall __attribute__ (( returns_twice ))
24
 extern int __asmcall __attribute__ (( returns_twice ))
34
 setjmp ( jmp_buf env );
25
 setjmp ( jmp_buf env );
35
 
26
 
36
 extern void __asmcall __attribute__ (( noreturn ))
27
 extern void __asmcall __attribute__ (( noreturn ))
37
 longjmp ( jmp_buf env, int val );
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
 #endif /* _SETJMP_H */
30
 #endif /* _SETJMP_H */

+ 1
- 1
src/arch/i386/interface/pxe/pxe_call.c 查看文件

27
 #include <ipxe/init.h>
27
 #include <ipxe/init.h>
28
 #include <ipxe/profile.h>
28
 #include <ipxe/profile.h>
29
 #include <ipxe/netdevice.h>
29
 #include <ipxe/netdevice.h>
30
-#include <setjmp.h>
30
+#include <rmsetjmp.h>
31
 #include <registers.h>
31
 #include <registers.h>
32
 #include <biosint.h>
32
 #include <biosint.h>
33
 #include <pxe.h>
33
 #include <pxe.h>

+ 1
- 1
src/arch/i386/interface/pxe/pxe_preboot.c 查看文件

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

+ 1
- 1
src/arch/i386/interface/syslinux/comboot_call.c 查看文件

32
 #include <comboot.h>
32
 #include <comboot.h>
33
 #include <bzimage.h>
33
 #include <bzimage.h>
34
 #include <pxe_call.h>
34
 #include <pxe_call.h>
35
-#include <setjmp.h>
35
+#include <rmsetjmp.h>
36
 #include <string.h>
36
 #include <string.h>
37
 #include <ipxe/posix_io.h>
37
 #include <ipxe/posix_io.h>
38
 #include <ipxe/process.h>
38
 #include <ipxe/process.h>

Loading…
取消
儲存