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 31