summaryrefslogtreecommitdiff
path: root/src/libc/setjmp.h
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-10 21:26:24 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-10 21:26:24 +0200
commitd6d1bdfefafff50b7b6d15d218c0a188570be541 (patch)
tree15ee8de727d0be5d126efda146b2879de0a72773 /src/libc/setjmp.h
parenteea5bf4b859eb56c5772c58ca54937a90a10e7ee (diff)
downloadabaos-d6d1bdfefafff50b7b6d15d218c0a188570be541.tar.gz
abaos-d6d1bdfefafff50b7b6d15d218c0a188570be541.tar.bz2
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
Diffstat (limited to 'src/libc/setjmp.h')
-rw-r--r--src/libc/setjmp.h24
1 files changed, 24 insertions, 0 deletions
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 <stdint.h>
+
+// 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
+