emu.h 861 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. /*
  15. * Later versions of Linux seemed to need large stack for gethostbyname()
  16. * so we had this at 128k, which is excessive. More recently, we've
  17. * reduced it again after testing stack usage by gethostbyname.
  18. */
  19. #define KSTACK (16 * 1024)
  20. #ifndef USE_PTHREADS
  21. static __inline Proc *getup(void) {
  22. Proc *p;
  23. __asm__( "move %0, $29\n\t"
  24. : "=r" (p)
  25. );
  26. return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
  27. }
  28. #else
  29. extern Proc* getup(void);
  30. #endif
  31. #define up (getup())
  32. typedef sigjmp_buf osjmpbuf;
  33. #define ossetjmp(buf) sigsetjmp(buf, 1)