xref: /inferno-os/Linux/power/include/emu.h (revision 70847ce7c3d2ee9800014eb328f362b8e335ac76)
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[18*8];
14 };
15 
16 /*
17  * Later versions of Linux seemed to need large stack for gethostbyname()
18  * so we had this at 128k, which is excessive.  More recently, we've
19  * reduced it again after testing stack usage by gethostbyname.
20  */
21 #define KSTACK (16 * 1024)
22 
23 #ifndef USE_PTHREADS
getup(void)24 static __inline Proc *getup(void) {
25 	Proc *p;
26 	__asm__(	"mr	%0, 1" : "=r" (p));
27 	return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
28 }
29 #else
30 extern	Proc*	getup(void);
31 #endif
32 
33 #define	up	(getup())
34 
35 typedef sigjmp_buf osjmpbuf;
36 #define	ossetjmp(buf)	sigsetjmp(buf, 1)
37 
38