summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorforsyth <forsyth@vitanuova.com>2011-02-25 10:59:02 +0000
committerforsyth <forsyth@vitanuova.com>2011-02-25 10:59:02 +0000
commit90ccc69f5be0b7e26c3607dac07340fe3e271509 (patch)
tree97f0ca5a225bf4efc8ee8a9e7403d34a41e17412
parent54d06533f3d8d73d9369206f7f5be71351cfbcf3 (diff)
20110225-1058
-rw-r--r--DragonFly/386/include/emu.h30
-rw-r--r--FreeBSD/386/include/emu.h30
-rw-r--r--Hp/s800/include/emu.h21
-rw-r--r--Irix/mips/include/emu.h22
-rw-r--r--Linux/386/include/emu.h33
-rw-r--r--Linux/arm/include/emu.h33
-rw-r--r--Linux/power/include/emu.h33
-rw-r--r--Linux/spim/include/emu.h35
-rw-r--r--MacOSX/386/include/emu.h34
-rw-r--r--MacOSX/power/include/emu.h22
-rw-r--r--NetBSD/386/include/emu.h30
-rwxr-xr-xNt/386/include/emu.h24
-rw-r--r--OpenBSD/386/include/emu.h30
-rw-r--r--Plan9/386/include/emu.h22
-rw-r--r--Plan9/arm/include/emu.h22
-rw-r--r--Plan9/mips/include/emu.h23
-rw-r--r--Plan9/power/include/emu.h30
-rw-r--r--Plan9/sparc/include/emu.h22
-rw-r--r--Solaris/386/include/emu.h21
-rw-r--r--Solaris/sparc/include/emu.h21
20 files changed, 538 insertions, 0 deletions
diff --git a/DragonFly/386/include/emu.h b/DragonFly/386/include/emu.h
new file mode 100644
index 00000000..5e03489b
--- /dev/null
+++ b/DragonFly/386/include/emu.h
@@ -0,0 +1,30 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+#define KSTACK (32 * 1024)
+
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "movl %%esp, %%eax\n\t"
+ : "=a" (p)
+ );
+ return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
+};
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/FreeBSD/386/include/emu.h b/FreeBSD/386/include/emu.h
new file mode 100644
index 00000000..5e03489b
--- /dev/null
+++ b/FreeBSD/386/include/emu.h
@@ -0,0 +1,30 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+#define KSTACK (32 * 1024)
+
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "movl %%esp, %%eax\n\t"
+ : "=a" (p)
+ );
+ return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
+};
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/Hp/s800/include/emu.h b/Hp/s800/include/emu.h
new file mode 100644
index 00000000..6bdc5056
--- /dev/null
+++ b/Hp/s800/include/emu.h
@@ -0,0 +1,21 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc* getup();
+#define up (getup())
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ fp_control fsr;
+};
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/Irix/mips/include/emu.h b/Irix/mips/include/emu.h
new file mode 100644
index 00000000..f3f7690e
--- /dev/null
+++ b/Irix/mips/include/emu.h
@@ -0,0 +1,22 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc** Xup;
+#define up (*Xup)
+
+typedef struct FPU FPU;
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+struct FPU
+{
+ ulong fcr31;
+};
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/Linux/386/include/emu.h b/Linux/386/include/emu.h
new file mode 100644
index 00000000..02bfa31e
--- /dev/null
+++ b/Linux/386/include/emu.h
@@ -0,0 +1,33 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+#define KSTACK (16 * 1024)
+
+#ifndef USE_PTHREADS
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "movl %%esp, %%eax\n\t"
+ : "=a" (p)
+ );
+ return *(Proc **)((uintptr)p & ~(KSTACK - 1));
+};
+#else
+extern Proc* getup(void);
+#endif
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
diff --git a/Linux/arm/include/emu.h b/Linux/arm/include/emu.h
new file mode 100644
index 00000000..da7b786f
--- /dev/null
+++ b/Linux/arm/include/emu.h
@@ -0,0 +1,33 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+#define KSTACK (16 * 1024)
+
+#ifndef USE_PTHREADS
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "mov %0, %%sp;"
+ : "=r" (p)
+ );
+ return *(Proc **)((uintptr)p & ~(KSTACK - 1));
+};
+#else
+extern Proc* getup(void);
+#endif
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
diff --git a/Linux/power/include/emu.h b/Linux/power/include/emu.h
new file mode 100644
index 00000000..b169fd7e
--- /dev/null
+++ b/Linux/power/include/emu.h
@@ -0,0 +1,33 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[18*8];
+};
+
+/*
+ * Later versions of Linux seemed to need large stack for gethostbyname()
+ * so we had this at 128k, which is excessive. More recently, we've
+ * reduced it again after testing stack usage by gethostbyname.
+ */
+#define KSTACK (16 * 1024)
+
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "mr %0, 1" : "=r" (p));
+ return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
+};
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/Linux/spim/include/emu.h b/Linux/spim/include/emu.h
new file mode 100644
index 00000000..9ca46903
--- /dev/null
+++ b/Linux/spim/include/emu.h
@@ -0,0 +1,35 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+/*
+ * Later versions of Linux seemed to need large stack for gethostbyname()
+ * so we had this at 128k, which is excessive. More recently, we've
+ * reduced it again after testing stack usage by gethostbyname.
+ */
+#define KSTACK (16 * 1024)
+
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "move %0, $29\n\t"
+ : "=r" (p)
+ );
+ return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
+};
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/MacOSX/386/include/emu.h b/MacOSX/386/include/emu.h
new file mode 100644
index 00000000..1e938b8d
--- /dev/null
+++ b/MacOSX/386/include/emu.h
@@ -0,0 +1,34 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc *getup(void);
+#define up (getup())
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+
+// something is at odds between i386/fpu.h and some of the thread headers
+#define fp_control inffp_control
+#define fp_control_t inffp_control_t
+#define fp_status inffp_status
+#define fp_status_t inffp_status_t
+
+#include <architecture/i386/fpu.h>
+
+typedef struct FPU FPU;
+struct FPU
+{
+ fp_state_t env;
+};
+
+#undef fp_control
+#undef fp_control_t
+#undef fp_status
+#undef fp_status_t
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
diff --git a/MacOSX/power/include/emu.h b/MacOSX/power/include/emu.h
new file mode 100644
index 00000000..acef66d0
--- /dev/null
+++ b/MacOSX/power/include/emu.h
@@ -0,0 +1,22 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc *getup(void);
+#define up (getup())
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+
+#include <architecture/ppc/fp_regs.h>
+
+typedef union {
+ double __dbl;
+ ppc_fp_scr_t __src;
+} FPU;
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
diff --git a/NetBSD/386/include/emu.h b/NetBSD/386/include/emu.h
new file mode 100644
index 00000000..5e03489b
--- /dev/null
+++ b/NetBSD/386/include/emu.h
@@ -0,0 +1,30 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+#define KSTACK (32 * 1024)
+
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "movl %%esp, %%eax\n\t"
+ : "=a" (p)
+ );
+ return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
+};
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/Nt/386/include/emu.h b/Nt/386/include/emu.h
new file mode 100755
index 00000000..d8645d8d
--- /dev/null
+++ b/Nt/386/include/emu.h
@@ -0,0 +1,24 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+extern void sleep(int);
+
+/* Set up private thread space */
+extern __declspec(thread) Proc* up;
+#define Sleep NTsleep
+
+typedef jmp_buf osjmpbuf;
+#define ossetjmp(buf) setjmp(buf)
+
diff --git a/OpenBSD/386/include/emu.h b/OpenBSD/386/include/emu.h
new file mode 100644
index 00000000..5e03489b
--- /dev/null
+++ b/OpenBSD/386/include/emu.h
@@ -0,0 +1,30 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+#define KSTACK (32 * 1024)
+
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "movl %%esp, %%eax\n\t"
+ : "=a" (p)
+ );
+ return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
+};
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/Plan9/386/include/emu.h b/Plan9/386/include/emu.h
new file mode 100644
index 00000000..1cc25b1c
--- /dev/null
+++ b/Plan9/386/include/emu.h
@@ -0,0 +1,22 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc** Xup;
+#define up (*Xup)
+
+typedef struct FPU FPU;
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+struct FPU
+{
+ uchar env[28];
+};
+
+typedef jmp_buf osjmpbuf;
+#define ossetjmp(buf) setjmp(buf)
+
diff --git a/Plan9/arm/include/emu.h b/Plan9/arm/include/emu.h
new file mode 100644
index 00000000..a2fac73a
--- /dev/null
+++ b/Plan9/arm/include/emu.h
@@ -0,0 +1,22 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc** Xup;
+#define up (*Xup)
+
+typedef struct FPU FPU;
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+struct FPU
+{
+ int dummy[1]; /* XXX what goes here? */
+};
+
+typedef jmp_buf osjmpbuf;
+#define ossetjmp(buf) setjmp(buf)
+
diff --git a/Plan9/mips/include/emu.h b/Plan9/mips/include/emu.h
new file mode 100644
index 00000000..b0babc4f
--- /dev/null
+++ b/Plan9/mips/include/emu.h
@@ -0,0 +1,23 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc** Xup;
+#define up (*Xup)
+
+typedef struct FPU FPU;
+
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+struct FPU
+{
+ uchar env[28];
+};
+
+typedef jmp_buf osjmpbuf;
+#define ossetjmp(buf) setjmp(buf)
+
diff --git a/Plan9/power/include/emu.h b/Plan9/power/include/emu.h
new file mode 100644
index 00000000..79a5c56e
--- /dev/null
+++ b/Plan9/power/include/emu.h
@@ -0,0 +1,30 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc** Xup;
+#define up (*Xup)
+
+typedef struct FPU FPU;
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ double fpreg[32];
+ union {
+ double fpscrd;
+ struct {
+ ulong pad;
+ ulong fpscr;
+ };
+ };
+};
+
+typedef jmp_buf osjmpbuf;
+#define ossetjmp(buf) setjmp(buf)
+
diff --git a/Plan9/sparc/include/emu.h b/Plan9/sparc/include/emu.h
new file mode 100644
index 00000000..c1758d0e
--- /dev/null
+++ b/Plan9/sparc/include/emu.h
@@ -0,0 +1,22 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc** Xup;
+#define up (*Xup)
+
+typedef struct FPU FPU;
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+struct FPU
+{
+ ulong fsr;
+};
+
+typedef jmp_buf osjmpbuf;
+#define ossetjmp(buf) setjmp(buf)
+
diff --git a/Solaris/386/include/emu.h b/Solaris/386/include/emu.h
new file mode 100644
index 00000000..18a87a9b
--- /dev/null
+++ b/Solaris/386/include/emu.h
@@ -0,0 +1,21 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc* getup(void);
+#define up (getup())
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
diff --git a/Solaris/sparc/include/emu.h b/Solaris/sparc/include/emu.h
new file mode 100644
index 00000000..9b5b1924
--- /dev/null
+++ b/Solaris/sparc/include/emu.h
@@ -0,0 +1,21 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc* getup(void);
+#define up (getup())
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ ulong fsr;
+};
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+