aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include
diff options
context:
space:
mode:
Diffstat (limited to 'com32/include')
-rw-r--r--com32/include/alloca.h12
-rw-r--r--com32/include/endian.h15
-rw-r--r--com32/include/klibc/endian.h38
-rw-r--r--com32/include/setjmp.h27
-rw-r--r--com32/include/sys/time.h6
-rw-r--r--com32/include/time.h6
6 files changed, 80 insertions, 24 deletions
diff --git a/com32/include/alloca.h b/com32/include/alloca.h
new file mode 100644
index 00000000..91ef4c0d
--- /dev/null
+++ b/com32/include/alloca.h
@@ -0,0 +1,12 @@
+/*
+ * alloca.h
+ *
+ * Just call the builtin alloca() function
+ */
+
+#ifndef _ALLOCA_H
+#define _ALLOCA_H
+
+#define alloca(size) __builtin_alloca(size)
+
+#endif /* _ALLOCA_H */
diff --git a/com32/include/endian.h b/com32/include/endian.h
new file mode 100644
index 00000000..a6cd6d9b
--- /dev/null
+++ b/com32/include/endian.h
@@ -0,0 +1,15 @@
+/*
+ * endian.h
+ */
+
+#ifndef _ENDIAN_H
+#define _ENDIAN_H
+
+#include <klibc/endian.h>
+
+#define LITTLE_ENDIAN __LITTLE_ENDIAN
+#define BIG_ENDIAN __BIG_ENDIAN
+#define PDP_ENDIAN __PDP_ENDIAN
+#define BYTE_ORDER __BYTE_ORDER
+
+#endif /* _ENDIAN_H */
diff --git a/com32/include/klibc/endian.h b/com32/include/klibc/endian.h
new file mode 100644
index 00000000..7537a47e
--- /dev/null
+++ b/com32/include/klibc/endian.h
@@ -0,0 +1,38 @@
+/*
+ * klibc/endian.h
+ *
+ * Like <endian.h>, but export only double-underscore symbols
+ */
+
+#ifndef _KLIBC_ENDIAN_H
+#define _KLIBC_ENDIAN_H
+
+#define __LITTLE_ENDIAN /* we're on i386, littleendian */
+
+/* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
+ __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
+ defined with __BYTE_ORDER defining which is actually used... */
+
+#if defined(__LITTLE_ENDIAN)
+# undef __LITTLE_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#elif defined(__BIG_ENDIAN)
+# undef __BIG_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __BIG_ENDIAN
+#elif defined(__PDP_ENDIAN)
+# undef __PDP_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __PDP_ENDIAN
+#else
+# error "Unknown byte order!"
+#endif
+
+#endif /* _KLIBC_ENDIAN_H */
diff --git a/com32/include/setjmp.h b/com32/include/setjmp.h
index b504eb6d..11b18fbd 100644
--- a/com32/include/setjmp.h
+++ b/com32/include/setjmp.h
@@ -8,36 +8,15 @@
#include <klibc/extern.h>
#include <klibc/compiler.h>
#include <stddef.h>
-#include <signal.h>
#include <klibc/archsetjmp.h>
__extern int setjmp(jmp_buf);
__extern __noreturn longjmp(jmp_buf, int);
-/*
- Whose bright idea was it to add unrelated functionality to just about
- the only function in the standard C library (setjmp) which cannot be
- wrapped by an ordinary function wrapper? Anyway, the damage is done,
- and therefore, this wrapper *must* be inline. However, gcc will
- complain if this is an inline function for unknown reason, and
- therefore sigsetjmp() needs to be a macro.
-*/
-
-struct __sigjmp_buf {
- jmp_buf __jmpbuf;
- sigset_t __sigs;
-};
-
-typedef struct __sigjmp_buf sigjmp_buf[1];
-
-#define sigsetjmp(__env, __save) \
-({ \
- struct __sigjmp_buf *__e = (__env); \
- sigprocmask(0, NULL, &__e->__sigs); \
- setjmp(__e->__jmpbuf); \
-})
+typedef jmp_buf sigjmp_buf;
-__extern __noreturn siglongjmp(sigjmp_buf, int);
+#define sigsetjmp(__env, __save) setjmp(__env)
+#define siglongjmp(__env, __val) longjmp(__env, __val)
#endif /* _SETJMP_H */
diff --git a/com32/include/sys/time.h b/com32/include/sys/time.h
new file mode 100644
index 00000000..c5bff0da
--- /dev/null
+++ b/com32/include/sys/time.h
@@ -0,0 +1,6 @@
+#ifndef _SYS_TIME_H
+#define _SYS_TIME_H
+
+/* empty */
+
+#endif
diff --git a/com32/include/time.h b/com32/include/time.h
index e69de29b..259386a6 100644
--- a/com32/include/time.h
+++ b/com32/include/time.h
@@ -0,0 +1,6 @@
+#ifndef _TIME_H
+#define _TIME_H
+
+/* empty */
+
+#endif