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 #ifndef USE_PTHREADS 18 #define KSTACK (16 * 1024) /* must be power of two */ 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 #define KSTACK (32 * 1024) /* need not be power of two */ 28 extern Proc* getup(void); 29 #endif 30 31 #define up (getup()) 32 33 typedef sigjmp_buf osjmpbuf; 34 #define ossetjmp(buf) sigsetjmp(buf, 1) 35