emu.h 850 B

12345678910111213141516171819202122232425262728293031323334353637
  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[18*8];
  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__( "mr %0, 1" : "=r" (p));
  24. return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
  25. }
  26. #else
  27. extern Proc* getup(void);
  28. #endif
  29. #define up (getup())
  30. typedef sigjmp_buf osjmpbuf;
  31. #define ossetjmp(buf) sigsetjmp(buf, 1)