From d6d1bdfefafff50b7b6d15d218c0a188570be541 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 10 Jun 2017 21:26:24 +0200 Subject: some big renames into subdirs of aspects updated README removed size_t in sys/types.h and sys/types.h itself, size_t is in stddef.h --- src/libc/setjmp.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/libc/setjmp.h (limited to 'src/libc/setjmp.h') diff --git a/src/libc/setjmp.h b/src/libc/setjmp.h new file mode 100644 index 0000000..5f987f1 --- /dev/null +++ b/src/libc/setjmp.h @@ -0,0 +1,24 @@ +#ifndef SETJMP_H +#define SETJMP_H + +#include + +// C99 states this should be an array so we can address it without +// the & operator, see prototypes of setjmp and longjmp +// eax, ecx and edx are scratch registers, save the others +// also store the jump address (eip) +typedef struct { + uint32_t ebx; + uint32_t esp; + uint32_t ebp; + uint32_t esi; + uint32_t edi; + uint32_t eip; +} jmp_buf[1]; + +int setjmp( jmp_buf env ); + +void longjmp( jmp_buf env, int val ); + +#endif // SETJMP_H + -- cgit v1.2.3-54-g00ecf