Unified · Split
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct FPU | ||
| 12 | { | ||
| 13 | uchar env[28]; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define KSTACK (32 * 1024) | ||
| 17 | |||
| 18 | static __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 | |||
| 28 | typedef sigjmp_buf osjmpbuf; | ||
| 29 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 30 | |||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct FPU | ||
| 12 | { | ||
| 13 | uchar env[28]; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define KSTACK (32 * 1024) | ||
| 17 | |||
| 18 | static __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 | |||
| 28 | typedef sigjmp_buf osjmpbuf; | ||
| 29 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 30 | |||
| @@ -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 | |||
| 7 | extern Proc* getup(); | ||
| 8 | #define up (getup()) | ||
| 9 | |||
| 10 | /* | ||
| 11 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 12 | */ | ||
| 13 | typedef struct FPU FPU; | ||
| 14 | struct FPU | ||
| 15 | { | ||
| 16 | fp_control fsr; | ||
| 17 | }; | ||
| 18 | |||
| 19 | typedef sigjmp_buf osjmpbuf; | ||
| 20 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 21 | |||
| @@ -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 | |||
| 7 | extern Proc** Xup; | ||
| 8 | #define up (*Xup) | ||
| 9 | |||
| 10 | typedef struct FPU FPU; | ||
| 11 | |||
| 12 | /* | ||
| 13 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 14 | */ | ||
| 15 | struct FPU | ||
| 16 | { | ||
| 17 | ulong fcr31; | ||
| 18 | }; | ||
| 19 | |||
| 20 | typedef sigjmp_buf osjmpbuf; | ||
| 21 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 22 | |||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct FPU | ||
| 12 | { | ||
| 13 | uchar env[28]; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define KSTACK (16 * 1024) | ||
| 17 | |||
| 18 | #ifndef USE_PTHREADS | ||
| 19 | static __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 | ||
| 27 | extern Proc* getup(void); | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #define up (getup()) | ||
| 31 | |||
| 32 | typedef sigjmp_buf osjmpbuf; | ||
| 33 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct FPU | ||
| 12 | { | ||
| 13 | uchar env[28]; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define KSTACK (16 * 1024) | ||
| 17 | |||
| 18 | #ifndef USE_PTHREADS | ||
| 19 | static __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 | ||
| 27 | extern Proc* getup(void); | ||
| 28 | #endif | ||
| 29 | |||
| 30 | #define up (getup()) | ||
| 31 | |||
| 32 | typedef sigjmp_buf osjmpbuf; | ||
| 33 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct 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 | |||
| 23 | static __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 | |||
| 31 | typedef sigjmp_buf osjmpbuf; | ||
| 32 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 33 | |||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct 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 | |||
| 23 | static __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 | |||
| 33 | typedef sigjmp_buf osjmpbuf; | ||
| 34 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 35 | |||
| @@ -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 | |||
| 7 | extern 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 | |||
| 22 | typedef struct FPU FPU; | ||
| 23 | struct 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 | |||
| 33 | typedef sigjmp_buf osjmpbuf; | ||
| 34 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| @@ -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 | |||
| 7 | extern 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 | |||
| 16 | typedef union { | ||
| 17 | double __dbl; | ||
| 18 | ppc_fp_scr_t __src; | ||
| 19 | } FPU; | ||
| 20 | |||
| 21 | typedef sigjmp_buf osjmpbuf; | ||
| 22 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct FPU | ||
| 12 | { | ||
| 13 | uchar env[28]; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define KSTACK (32 * 1024) | ||
| 17 | |||
| 18 | static __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 | |||
| 28 | typedef sigjmp_buf osjmpbuf; | ||
| 29 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 30 | |||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct FPU | ||
| 12 | { | ||
| 13 | uchar env[28]; | ||
| 14 | }; | ||
| 15 | |||
| 16 | extern void sleep(int); | ||
| 17 | |||
| 18 | /* Set up private thread space */ | ||
| 19 | extern __declspec(thread) Proc* up; | ||
| 20 | #define Sleep NTsleep | ||
| 21 | |||
| 22 | typedef jmp_buf osjmpbuf; | ||
| 23 | #define ossetjmp(buf) setjmp(buf) | ||
| 24 | |||
| @@ -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 | */ | ||
| 10 | typedef struct FPU FPU; | ||
| 11 | struct FPU | ||
| 12 | { | ||
| 13 | uchar env[28]; | ||
| 14 | }; | ||
| 15 | |||
| 16 | #define KSTACK (32 * 1024) | ||
| 17 | |||
| 18 | static __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 | |||
| 28 | typedef sigjmp_buf osjmpbuf; | ||
| 29 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 30 | |||
| @@ -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 | |||
| 7 | extern Proc** Xup; | ||
| 8 | #define up (*Xup) | ||
| 9 | |||
| 10 | typedef struct FPU FPU; | ||
| 11 | |||
| 12 | /* | ||
| 13 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 14 | */ | ||
| 15 | struct FPU | ||
| 16 | { | ||
| 17 | uchar env[28]; | ||
| 18 | }; | ||
| 19 | |||
| 20 | typedef jmp_buf osjmpbuf; | ||
| 21 | #define ossetjmp(buf) setjmp(buf) | ||
| 22 | |||
| @@ -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 | |||
| 7 | extern Proc** Xup; | ||
| 8 | #define up (*Xup) | ||
| 9 | |||
| 10 | typedef struct FPU FPU; | ||
| 11 | |||
| 12 | /* | ||
| 13 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 14 | */ | ||
| 15 | struct FPU | ||
| 16 | { | ||
| 17 | int dummy[1]; /* XXX what goes here? */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | typedef jmp_buf osjmpbuf; | ||
| 21 | #define ossetjmp(buf) setjmp(buf) | ||
| 22 | |||
| @@ -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 | |||
| 7 | extern Proc** Xup; | ||
| 8 | #define up (*Xup) | ||
| 9 | |||
| 10 | typedef struct FPU FPU; | ||
| 11 | |||
| 12 | |||
| 13 | /* | ||
| 14 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 15 | */ | ||
| 16 | struct FPU | ||
| 17 | { | ||
| 18 | uchar env[28]; | ||
| 19 | }; | ||
| 20 | |||
| 21 | typedef jmp_buf osjmpbuf; | ||
| 22 | #define ossetjmp(buf) setjmp(buf) | ||
| 23 | |||
| @@ -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 | extern Proc** Xup; | ||
| 8 | #define up (*Xup) | ||
| 9 | |||
| 10 | typedef struct FPU FPU; | ||
| 11 | |||
| 12 | /* | ||
| 13 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 14 | */ | ||
| 15 | typedef struct FPU FPU; | ||
| 16 | struct FPU | ||
| 17 | { | ||
| 18 | double fpreg[32]; | ||
| 19 | union { | ||
| 20 | double fpscrd; | ||
| 21 | struct { | ||
| 22 | ulong pad; | ||
| 23 | ulong fpscr; | ||
| 24 | }; | ||
| 25 | }; | ||
| 26 | }; | ||
| 27 | |||
| 28 | typedef jmp_buf osjmpbuf; | ||
| 29 | #define ossetjmp(buf) setjmp(buf) | ||
| 30 | |||
| @@ -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 | |||
| 7 | extern Proc** Xup; | ||
| 8 | #define up (*Xup) | ||
| 9 | |||
| 10 | typedef struct FPU FPU; | ||
| 11 | |||
| 12 | /* | ||
| 13 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 14 | */ | ||
| 15 | struct FPU | ||
| 16 | { | ||
| 17 | ulong fsr; | ||
| 18 | }; | ||
| 19 | |||
| 20 | typedef jmp_buf osjmpbuf; | ||
| 21 | #define ossetjmp(buf) setjmp(buf) | ||
| 22 | |||
| @@ -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 | |||
| 7 | extern Proc* getup(void); | ||
| 8 | #define up (getup()) | ||
| 9 | |||
| 10 | /* | ||
| 11 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 12 | */ | ||
| 13 | typedef struct FPU FPU; | ||
| 14 | struct FPU | ||
| 15 | { | ||
| 16 | uchar env[28]; | ||
| 17 | }; | ||
| 18 | |||
| 19 | typedef sigjmp_buf osjmpbuf; | ||
| 20 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 21 | |||
| @@ -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 | |||
| 7 | extern Proc* getup(void); | ||
| 8 | #define up (getup()) | ||
| 9 | |||
| 10 | /* | ||
| 11 | * This structure must agree with FPsave and FPrestore asm routines | ||
| 12 | */ | ||
| 13 | typedef struct FPU FPU; | ||
| 14 | struct FPU | ||
| 15 | { | ||
| 16 | ulong fsr; | ||
| 17 | }; | ||
| 18 | |||
| 19 | typedef sigjmp_buf osjmpbuf; | ||
| 20 | #define ossetjmp(buf) sigsetjmp(buf, 1) | ||
| 21 | |||