History

20110225-1058

forsyth committed 15 years ago

Commit 270c1bb1 parent 534c87e20 files · +538 −0Browse files

Unified · Split

20 files
  1. DragonFly/386/include/emu.h +30 −0
  2. FreeBSD/386/include/emu.h +30 −0
  3. Hp/s800/include/emu.h +21 −0
  4. Irix/mips/include/emu.h +22 −0
  5. Linux/386/include/emu.h +33 −0
  6. Linux/arm/include/emu.h +33 −0
  7. Linux/power/include/emu.h +33 −0
  8. Linux/spim/include/emu.h +35 −0
  9. MacOSX/386/include/emu.h +34 −0
  10. MacOSX/power/include/emu.h +22 −0
  11. NetBSD/386/include/emu.h +30 −0
  12. Nt/386/include/emu.h +24 −0
  13. OpenBSD/386/include/emu.h +30 −0
  14. Plan9/386/include/emu.h +22 −0
  15. Plan9/arm/include/emu.h +22 −0
  16. Plan9/mips/include/emu.h +23 −0
  17. Plan9/power/include/emu.h +30 −0
  18. Plan9/sparc/include/emu.h +22 −0
  19. Solaris/386/include/emu.h +21 −0
  20. Solaris/sparc/include/emu.h +21 −0
DragonFly/386/include/emu.h+30−0
@@ -0,0 +1,30 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16#define KSTACK (32 * 1024)
17
18static __inline Proc *getup(void) {
19 Proc *p;
20 __asm__( "movl %%esp, %%eax\n\t"
21 : "=a" (p)
22 );
23 return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
24};
25
26#define up (getup())
27
28typedef sigjmp_buf osjmpbuf;
29#define ossetjmp(buf) sigsetjmp(buf, 1)
30
FreeBSD/386/include/emu.h+30−0
@@ -0,0 +1,30 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16#define KSTACK (32 * 1024)
17
18static __inline Proc *getup(void) {
19 Proc *p;
20 __asm__( "movl %%esp, %%eax\n\t"
21 : "=a" (p)
22 );
23 return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
24};
25
26#define up (getup())
27
28typedef sigjmp_buf osjmpbuf;
29#define ossetjmp(buf) sigsetjmp(buf, 1)
30
Hp/s800/include/emu.h+21−0
@@ -0,0 +1,21 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc* getup();
8#define up (getup())
9
10/*
11 * This structure must agree with FPsave and FPrestore asm routines
12 */
13typedef struct FPU FPU;
14struct FPU
15{
16 fp_control fsr;
17};
18
19typedef sigjmp_buf osjmpbuf;
20#define ossetjmp(buf) sigsetjmp(buf, 1)
21
Irix/mips/include/emu.h+22−0
@@ -0,0 +1,22 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc** Xup;
8#define up (*Xup)
9
10typedef struct FPU FPU;
11
12/*
13 * This structure must agree with FPsave and FPrestore asm routines
14 */
15struct FPU
16{
17 ulong fcr31;
18};
19
20typedef sigjmp_buf osjmpbuf;
21#define ossetjmp(buf) sigsetjmp(buf, 1)
22
Linux/386/include/emu.h+33−0
@@ -0,0 +1,33 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16#define KSTACK (16 * 1024)
17
18#ifndef USE_PTHREADS
19static __inline Proc *getup(void) {
20 Proc *p;
21 __asm__( "movl %%esp, %%eax\n\t"
22 : "=a" (p)
23 );
24 return *(Proc **)((uintptr)p & ~(KSTACK - 1));
25};
26#else
27extern Proc* getup(void);
28#endif
29
30#define up (getup())
31
32typedef sigjmp_buf osjmpbuf;
33#define ossetjmp(buf) sigsetjmp(buf, 1)
Linux/arm/include/emu.h+33−0
@@ -0,0 +1,33 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16#define KSTACK (16 * 1024)
17
18#ifndef USE_PTHREADS
19static __inline Proc *getup(void) {
20 Proc *p;
21 __asm__( "mov %0, %%sp;"
22 : "=r" (p)
23 );
24 return *(Proc **)((uintptr)p & ~(KSTACK - 1));
25};
26#else
27extern Proc* getup(void);
28#endif
29
30#define up (getup())
31
32typedef sigjmp_buf osjmpbuf;
33#define ossetjmp(buf) sigsetjmp(buf, 1)
Linux/power/include/emu.h+33−0
@@ -0,0 +1,33 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[18*8];
14};
15
16/*
17 * Later versions of Linux seemed to need large stack for gethostbyname()
18 * so we had this at 128k, which is excessive. More recently, we've
19 * reduced it again after testing stack usage by gethostbyname.
20 */
21#define KSTACK (16 * 1024)
22
23static __inline Proc *getup(void) {
24 Proc *p;
25 __asm__( "mr %0, 1" : "=r" (p));
26 return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
27};
28
29#define up (getup())
30
31typedef sigjmp_buf osjmpbuf;
32#define ossetjmp(buf) sigsetjmp(buf, 1)
33
Linux/spim/include/emu.h+35−0
@@ -0,0 +1,35 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16/*
17 * Later versions of Linux seemed to need large stack for gethostbyname()
18 * so we had this at 128k, which is excessive. More recently, we've
19 * reduced it again after testing stack usage by gethostbyname.
20 */
21#define KSTACK (16 * 1024)
22
23static __inline Proc *getup(void) {
24 Proc *p;
25 __asm__( "move %0, $29\n\t"
26 : "=r" (p)
27 );
28 return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
29};
30
31#define up (getup())
32
33typedef sigjmp_buf osjmpbuf;
34#define ossetjmp(buf) sigsetjmp(buf, 1)
35
MacOSX/386/include/emu.h+34−0
@@ -0,0 +1,34 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc *getup(void);
8#define up (getup())
9
10/*
11 * This structure must agree with FPsave and FPrestore asm routines
12 */
13
14// something is at odds between i386/fpu.h and some of the thread headers
15#define fp_control inffp_control
16#define fp_control_t inffp_control_t
17#define fp_status inffp_status
18#define fp_status_t inffp_status_t
19
20#include <architecture/i386/fpu.h>
21
22typedef struct FPU FPU;
23struct FPU
24{
25 fp_state_t env;
26};
27
28#undef fp_control
29#undef fp_control_t
30#undef fp_status
31#undef fp_status_t
32
33typedef sigjmp_buf osjmpbuf;
34#define ossetjmp(buf) sigsetjmp(buf, 1)
MacOSX/power/include/emu.h+22−0
@@ -0,0 +1,22 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc *getup(void);
8#define up (getup())
9
10/*
11 * This structure must agree with FPsave and FPrestore asm routines
12 */
13
14#include <architecture/ppc/fp_regs.h>
15
16typedef union {
17 double __dbl;
18 ppc_fp_scr_t __src;
19} FPU;
20
21typedef sigjmp_buf osjmpbuf;
22#define ossetjmp(buf) sigsetjmp(buf, 1)
NetBSD/386/include/emu.h+30−0
@@ -0,0 +1,30 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16#define KSTACK (32 * 1024)
17
18static __inline Proc *getup(void) {
19 Proc *p;
20 __asm__( "movl %%esp, %%eax\n\t"
21 : "=a" (p)
22 );
23 return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
24};
25
26#define up (getup())
27
28typedef sigjmp_buf osjmpbuf;
29#define ossetjmp(buf) sigsetjmp(buf, 1)
30
Nt/386/include/emu.h+24−0
@@ -0,0 +1,24 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16extern void sleep(int);
17
18/* Set up private thread space */
19extern __declspec(thread) Proc* up;
20#define Sleep NTsleep
21
22typedef jmp_buf osjmpbuf;
23#define ossetjmp(buf) setjmp(buf)
24
OpenBSD/386/include/emu.h+30−0
@@ -0,0 +1,30 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7/*
8 * This structure must agree with FPsave and FPrestore asm routines
9 */
10typedef struct FPU FPU;
11struct FPU
12{
13 uchar env[28];
14};
15
16#define KSTACK (32 * 1024)
17
18static __inline Proc *getup(void) {
19 Proc *p;
20 __asm__( "movl %%esp, %%eax\n\t"
21 : "=a" (p)
22 );
23 return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
24};
25
26#define up (getup())
27
28typedef sigjmp_buf osjmpbuf;
29#define ossetjmp(buf) sigsetjmp(buf, 1)
30
Plan9/386/include/emu.h+22−0
@@ -0,0 +1,22 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc** Xup;
8#define up (*Xup)
9
10typedef struct FPU FPU;
11
12/*
13 * This structure must agree with FPsave and FPrestore asm routines
14 */
15struct FPU
16{
17 uchar env[28];
18};
19
20typedef jmp_buf osjmpbuf;
21#define ossetjmp(buf) setjmp(buf)
22
Plan9/arm/include/emu.h+22−0
@@ -0,0 +1,22 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc** Xup;
8#define up (*Xup)
9
10typedef struct FPU FPU;
11
12/*
13 * This structure must agree with FPsave and FPrestore asm routines
14 */
15struct FPU
16{
17 int dummy[1]; /* XXX what goes here? */
18};
19
20typedef jmp_buf osjmpbuf;
21#define ossetjmp(buf) setjmp(buf)
22
Plan9/mips/include/emu.h+23−0
@@ -0,0 +1,23 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc** Xup;
8#define up (*Xup)
9
10typedef struct FPU FPU;
11
12
13/*
14 * This structure must agree with FPsave and FPrestore asm routines
15 */
16struct FPU
17{
18 uchar env[28];
19};
20
21typedef jmp_buf osjmpbuf;
22#define ossetjmp(buf) setjmp(buf)
23
Plan9/power/include/emu.h+30−0
@@ -0,0 +1,30 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc** Xup;
8#define up (*Xup)
9
10typedef struct FPU FPU;
11
12/*
13 * This structure must agree with FPsave and FPrestore asm routines
14 */
15typedef struct FPU FPU;
16struct FPU
17{
18 double fpreg[32];
19 union {
20 double fpscrd;
21 struct {
22 ulong pad;
23 ulong fpscr;
24 };
25 };
26};
27
28typedef jmp_buf osjmpbuf;
29#define ossetjmp(buf) setjmp(buf)
30
Plan9/sparc/include/emu.h+22−0
@@ -0,0 +1,22 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc** Xup;
8#define up (*Xup)
9
10typedef struct FPU FPU;
11
12/*
13 * This structure must agree with FPsave and FPrestore asm routines
14 */
15struct FPU
16{
17 ulong fsr;
18};
19
20typedef jmp_buf osjmpbuf;
21#define ossetjmp(buf) setjmp(buf)
22
Solaris/386/include/emu.h+21−0
@@ -0,0 +1,21 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc* getup(void);
8#define up (getup())
9
10/*
11 * This structure must agree with FPsave and FPrestore asm routines
12 */
13typedef struct FPU FPU;
14struct FPU
15{
16 uchar env[28];
17};
18
19typedef sigjmp_buf osjmpbuf;
20#define ossetjmp(buf) sigsetjmp(buf, 1)
21
Solaris/sparc/include/emu.h+21−0
@@ -0,0 +1,21 @@
1/*
2 * system- and machine-specific declarations for emu:
3 * floating-point save and restore, signal handling primitive, and
4 * implementation of the current-process variable `up'.
5 */
6
7extern Proc* getup(void);
8#define up (getup())
9
10/*
11 * This structure must agree with FPsave and FPrestore asm routines
12 */
13typedef struct FPU FPU;
14struct FPU
15{
16 ulong fsr;
17};
18
19typedef sigjmp_buf osjmpbuf;
20#define ossetjmp(buf) sigsetjmp(buf, 1)
21

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t