emu.h 593 B

123456789101112131415161718192021222324252627282930
  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. * This structure must agree with FPsave and FPrestore asm routines
  8. */
  9. typedef struct FPU FPU;
  10. struct FPU
  11. {
  12. uchar env[28];
  13. };
  14. #define KSTACK (32 * 1024)
  15. static __inline Proc *getup(void) {
  16. Proc *p;
  17. __asm__( "movl %%esp, %%eax\n\t"
  18. : "=a" (p)
  19. );
  20. return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
  21. };
  22. #define up (getup())
  23. typedef sigjmp_buf osjmpbuf;
  24. #define ossetjmp(buf) sigsetjmp(buf, 1)