diff options
author | Michael Brown | 2016-02-16 16:48:03 +0100 |
---|---|---|
committer | Michael Brown | 2016-02-16 17:06:25 +0100 |
commit | b9c4c2676bf8e3851eebaf22930512bbae9d5612 (patch) | |
tree | 4f68ea17c7fef9e3a0022d7ecd5c7d4615611052 /src/arch/i386 | |
parent | [prefix] Pad .text16 and .data16 segment sizes at build time (diff) | |
download | ipxe-b9c4c2676bf8e3851eebaf22930512bbae9d5612.tar.gz ipxe-b9c4c2676bf8e3851eebaf22930512bbae9d5612.tar.xz ipxe-b9c4c2676bf8e3851eebaf22930512bbae9d5612.zip |
[libc] Split rmsetjmp() and rmlongjmp() into a separate rmsetjmp.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386')
-rw-r--r-- | src/arch/i386/include/comboot.h | 2 | ||||
-rw-r--r-- | src/arch/i386/include/pxe_call.h | 2 | ||||
-rw-r--r-- | src/arch/i386/include/rmsetjmp.h | 28 | ||||
-rw-r--r-- | src/arch/i386/include/setjmp.h | 20 | ||||
-rw-r--r-- | src/arch/i386/interface/pxe/pxe_call.c | 2 | ||||
-rw-r--r-- | src/arch/i386/interface/pxe/pxe_preboot.c | 2 | ||||
-rw-r--r-- | src/arch/i386/interface/syslinux/comboot_call.c | 2 |
7 files changed, 33 insertions, 25 deletions
diff --git a/src/arch/i386/include/comboot.h b/src/arch/i386/include/comboot.h index 2d2f04fe..5cb1ba54 100644 --- a/src/arch/i386/include/comboot.h +++ b/src/arch/i386/include/comboot.h @@ -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 */ diff --git a/src/arch/i386/include/pxe_call.h b/src/arch/i386/include/pxe_call.h index cbd54831..2ad0a950 100644 --- a/src/arch/i386/include/pxe_call.h +++ b/src/arch/i386/include/pxe_call.h @@ -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 index 00000000..3470be47 --- /dev/null +++ b/src/arch/i386/include/rmsetjmp.h @@ -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 */ diff --git a/src/arch/i386/include/setjmp.h b/src/arch/i386/include/setjmp.h index fe1a9ef4..98566696 100644 --- a/src/arch/i386/include/setjmp.h +++ b/src/arch/i386/include/setjmp.h @@ -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 */ diff --git a/src/arch/i386/interface/pxe/pxe_call.c b/src/arch/i386/interface/pxe/pxe_call.c index ed17a96a..414b356d 100644 --- a/src/arch/i386/interface/pxe/pxe_call.c +++ b/src/arch/i386/interface/pxe/pxe_call.c @@ -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> diff --git a/src/arch/i386/interface/pxe/pxe_preboot.c b/src/arch/i386/interface/pxe/pxe_preboot.c index cc9c052e..09e721b3 100644 --- a/src/arch/i386/interface/pxe/pxe_preboot.c +++ b/src/arch/i386/interface/pxe/pxe_preboot.c @@ -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" diff --git a/src/arch/i386/interface/syslinux/comboot_call.c b/src/arch/i386/interface/syslinux/comboot_call.c index 69d94c40..d70340c6 100644 --- a/src/arch/i386/interface/syslinux/comboot_call.c +++ b/src/arch/i386/interface/syslinux/comboot_call.c @@ -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> |