summaryrefslogtreecommitdiff
path: root/lib/libc_r/arch/powerpc/uthread_machdep.h
blob: bd713b5ff0e8c47fe25d27ce44dee07f1a3958a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * OpenBSD/powerpc machine-dependent thread macros
 *
 * $OpenBSD: uthread_machdep.h,v 1.3 1999/04/21 03:45:21 rahnds Exp $
 */

/* save the floating point state of a thread */
#define _thread_machdep_save_float_state(thr) 		\
	{						\
		/* rahnds to fill in */			\
	}

/* restore the floating point state of a thread */
#define _thread_machdep_restore_float_state(thr) 	\
	{						\
		/* rahnds to fill in */			\
	}

#define JMP_r1  (0x04/4)
#define JMP_lr  (0x50/4)
/* initialise the jmpbuf stack frame so it continues from entry */
#define _thread_machdep_thread_create(thr, entry, pattr)	\
	{						\
		(thr)->saved_jmp_buf[JMP_lr] =		\
			(unsigned int) entry;		\
		(thr)->saved_jmp_buf[JMP_r1] =		\
			((unsigned int) (thr)->stack	\
			+ (pattr)->stacksize_attr	\
			- 0x4) & ~0xf;			\
		{					\
			unsigned int *pbacklink =	\
				(thr)->saved_jmp_buf[JMP_r1]; \
			*pbacklink = 0;			\
		}					\
	}

#define	_thread_machdep_longjmp(a,v)	longjmp(a,v)
#define	_thread_machdep_setjmp(a)	setjmp(a)

typedef jmp_buf _machdep_jmp_buf;

struct _machdep_struct {
        char            xxx;
};