This commit is contained in:
rsc 2005-07-20 23:29:56 +00:00
parent 1d41999e22
commit b4b686415d
3 changed files with 12 additions and 5 deletions

View file

@ -1,4 +1,5 @@
typedef struct mcontext mcontext_t;
typedef struct ucontext ucontext_t;
extern int getcontext(ucontext_t*); extern int getcontext(ucontext_t*);
extern void setcontext(ucontext_t*); extern void setcontext(ucontext_t*);
@ -67,7 +68,7 @@ extern void makecontext(ucontext_t*, void(*)(), int, ...);
* $FreeBSD: src/sys/i386/include/ucontext.h,v 1.4 1999/10/11 20:33:09 luoqi Exp $ * $FreeBSD: src/sys/i386/include/ucontext.h,v 1.4 1999/10/11 20:33:09 luoqi Exp $
*/ */
typedef struct __mcontext { struct mcontext {
/* /*
* The first 20 fields must match the definition of * The first 20 fields must match the definition of
* sigcontext. So that we can support sigcontext * sigcontext. So that we can support sigcontext
@ -96,9 +97,9 @@ typedef struct __mcontext {
int mc_fpregs[28]; /* env87 + fpacc87 + u_long */ int mc_fpregs[28]; /* env87 + fpacc87 + u_long */
int __spare__[17]; int __spare__[17];
} mcontext_t; };
typedef struct __ucontext { struct ucontext {
/* /*
* Keep the order of the first two fields. Also, * Keep the order of the first two fields. Also,
* keep them the first two fields in the structure. * keep them the first two fields in the structure.
@ -113,6 +114,6 @@ typedef struct __ucontext {
struct __ucontext *uc_link; struct __ucontext *uc_link;
stack_t uc_stack; stack_t uc_stack;
int __spare__[8]; int __spare__[8];
} ucontext_t; };

View file

@ -23,6 +23,8 @@ case "$tag" in
*-Darwin-*) *-Darwin-*)
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o
;; ;;
386-OpenBSD-*)
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o
*-OpenBSD-*) *-OpenBSD-*)
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o $SYSNAME.o echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o $SYSNAME.o
;; ;;

View file

@ -28,6 +28,10 @@ extern void makecontext(ucontext_t*, void(*)(), int, ...);
#endif #endif
#if defined(__OpenBSD__) #if defined(__OpenBSD__)
# define mcontext libthread_mcontext
# define mcontext_t libthread_mcontext_t
# define ucontext libthread_ucontext
# define ucontext_t libthread_ucontext_t
# if defined __i386__ # if defined __i386__
# include "386-ucontext.h" # include "386-ucontext.h"
# else # else