aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/label.h
blob: a1f6fa5ab0ee28a816347213e0ee5cca842d6831 (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
/*
 * setjmp and longjmp, but our own because some (stupid) c libraries
 * assume longjmp is only used to move up the stack, and error out
 * if you do otherwise.
 */

typedef struct Label Label;
#define LABELDPC 0

#if defined (__i386__) && (defined(__FreeBSD__) || defined(__linux__))
struct Label
{
	ulong pc;
	ulong bx;
	ulong sp;
	ulong bp;
	ulong si;
	ulong di;
};
#elif defined(__APPLE__)
struct Label
{
	ulong	pc;		/* lr */
	ulong	cr;		/* mfcr */
	ulong	ctr;		/* mfcr */
	ulong	xer;		/* mfcr */
	ulong	sp;		/* callee saved: r1 */
	ulong	toc;		/* callee saved: r2 */
	ulong	gpr[19];	/* callee saved: r13-r31 */
// XXX: currently do not save vector registers or floating-point state
//	ulong	pad;
//	uvlong	fpr[18];	/* callee saved: f14-f31 */
//	ulong	vr[4*12];	/* callee saved: v20-v31, 256-bits each */
};
#else
#error "Unknown or unsupported architecture"
#endif