source: bootcd/isolinux/syslinux-6.03/gpxe/src/arch/i386/include/setjmp.h

Last change on this file was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 804 bytes
Line 
1#ifndef ETHERBOOT_SETJMP_H
2#define ETHERBOOT_SETJMP_H
3
4FILE_LICENCE ( GPL2_OR_LATER );
5
6#include <stdint.h>
7#include <realmode.h>
8
9/** A jump buffer */
10typedef struct {
11        uint32_t retaddr;
12        uint32_t ebx;
13        uint32_t esp;
14        uint32_t ebp;
15        uint32_t esi;
16        uint32_t edi;
17} jmp_buf[1];
18
19/** A real-mode-extended jump buffer */
20typedef struct {
21        jmp_buf env;
22        uint16_t rm_ss;
23        uint16_t rm_sp;
24} rmjmp_buf[1];
25
26extern int __asmcall setjmp ( jmp_buf env );
27extern void __asmcall longjmp ( jmp_buf env, int val );
28
29#define rmsetjmp( _env ) ( {                    \
30        (_env)->rm_ss = rm_ss;                  \
31        (_env)->rm_sp = rm_sp;                  \
32        setjmp ( (_env)->env ); } )             \
33
34#define rmlongjmp( _env, _val ) do {            \
35        rm_ss = (_env)->rm_ss;                  \
36        rm_sp = (_env)->rm_sp;                  \
37        longjmp ( (_env)->env, (_val) );        \
38        } while ( 0 )
39
40#endif /* ETHERBOOT_SETJMP_H */
Note: See TracBrowser for help on using the repository browser.