summaryrefslogtreecommitdiff
path: root/lib/libc_r/arch/mips/uthread_machdep.h
blob: 89fb399d629dc48fa4e51f49c25a3fc196d6588a (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
/*
 * OpenBSD/mips machine-dependent thread macros
 *
 * $OpenBSD: uthread_machdep.h,v 1.4 1999/11/25 07:01:28 d Exp $
 */

#include <machine/regnum.h>
#include <machine/signal.h>

/* floating point state is saved by setjmp/longjmp */

#define _thread_machdep_save_float_state(thr) 		/* no need */
#define _thread_machdep_restore_float_state(thr) 	/* no need */

/* initialise the jmpbuf stack frame so it continues from entry */
#define _thread_machdep_thread_create(thr, entry, pattr)	\
	{							\
	    struct sigcontext *j = &(thr)->saved_jmp_buf;	\
								\
	    /* initialise to sane values */			\
	    _thread_machdep_setjmp(j);				\
	    /* entry */						\
	    j->sc_regs[RA] = j->sc_pc; /* for gdb */		\
	    j->sc_pc = (int)entry;				\
	    /* stack */						\
	    j->sc_regs[SP] = (int) (thr)->stack->base		\
				+ (thr)->stack->size		\
				- sizeof(double);		\
	}

#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 {
	/* nothing needed */
};