xref: /inferno-os/Linux/power/include/emu.h (revision 70847ce7c3d2ee9800014eb328f362b8e335ac76)
190ccc69fSforsyth /*
290ccc69fSforsyth  * system- and machine-specific declarations for emu:
390ccc69fSforsyth  * floating-point save and restore, signal handling primitive, and
490ccc69fSforsyth  * implementation of the current-process variable `up'.
590ccc69fSforsyth  */
690ccc69fSforsyth 
790ccc69fSforsyth /*
890ccc69fSforsyth  * This structure must agree with FPsave and FPrestore asm routines
990ccc69fSforsyth  */
1090ccc69fSforsyth typedef struct FPU FPU;
1190ccc69fSforsyth struct FPU
1290ccc69fSforsyth {
1390ccc69fSforsyth 	uchar	env[18*8];
1490ccc69fSforsyth };
1590ccc69fSforsyth 
1690ccc69fSforsyth /*
1790ccc69fSforsyth  * Later versions of Linux seemed to need large stack for gethostbyname()
1890ccc69fSforsyth  * so we had this at 128k, which is excessive.  More recently, we've
1990ccc69fSforsyth  * reduced it again after testing stack usage by gethostbyname.
2090ccc69fSforsyth  */
2190ccc69fSforsyth #define KSTACK (16 * 1024)
2290ccc69fSforsyth 
23*70847ce7Sforsyth #ifndef USE_PTHREADS
getup(void)2490ccc69fSforsyth static __inline Proc *getup(void) {
2590ccc69fSforsyth 	Proc *p;
2690ccc69fSforsyth 	__asm__(	"mr	%0, 1" : "=r" (p));
2790ccc69fSforsyth 	return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
28*70847ce7Sforsyth }
29*70847ce7Sforsyth #else
30*70847ce7Sforsyth extern	Proc*	getup(void);
31*70847ce7Sforsyth #endif
3290ccc69fSforsyth 
3390ccc69fSforsyth #define	up	(getup())
3490ccc69fSforsyth 
3590ccc69fSforsyth typedef sigjmp_buf osjmpbuf;
3690ccc69fSforsyth #define	ossetjmp(buf)	sigsetjmp(buf, 1)
3790ccc69fSforsyth 
38