pthread_md.h (133801) | pthread_md.h (133806) |
---|---|
1/* 2 * Copyright 2004 by Peter Grehan. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/* 2 * Copyright 2004 by Peter Grehan. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/lib/libkse/arch/powerpc/include/pthread_md.h 133801 2004-08-16 03:27:29Z davidxu $ | 27 * $FreeBSD: head/lib/libkse/arch/powerpc/include/pthread_md.h 133806 2004-08-16 05:41:39Z grehan $ |
28 */ 29 30/* 31 * Machine-dependent thread prototypes/definitions for the thread kernel. 32 */ 33#ifndef _PTHREAD_MD_H_ 34#define _PTHREAD_MD_H_ 35 36#include <sys/kse.h> 37#include <stddef.h> 38#include <ucontext.h> 39 40extern void _ppc32_enter_uts(struct kse_mailbox *, kse_func_t, void *, size_t); 41extern int _ppc32_setcontext(mcontext_t *, intptr_t, intptr_t *); 42extern int _ppc32_getcontext(mcontext_t *); 43 44#define KSE_STACKSIZE 16384 | 28 */ 29 30/* 31 * Machine-dependent thread prototypes/definitions for the thread kernel. 32 */ 33#ifndef _PTHREAD_MD_H_ 34#define _PTHREAD_MD_H_ 35 36#include <sys/kse.h> 37#include <stddef.h> 38#include <ucontext.h> 39 40extern void _ppc32_enter_uts(struct kse_mailbox *, kse_func_t, void *, size_t); 41extern int _ppc32_setcontext(mcontext_t *, intptr_t, intptr_t *); 42extern int _ppc32_getcontext(mcontext_t *); 43 44#define KSE_STACKSIZE 16384 |
45#define DTV_OFFSET offsetof(struct tcb, tcb.tcb_tp.tp_dtv) | 45#define DTV_OFFSET offsetof(struct tcb, tcb_tp.tp_tdv) |
46 47#define THR_GETCONTEXT(ucp) _ppc32_getcontext(&(ucp)->uc_mcontext) 48#define THR_SETCONTEXT(ucp) _ppc32_setcontext(&(ucp)->uc_mcontext, 0, NULL) 49 50#define PER_THREAD 51 52struct kcb; 53struct kse; --- 34 unchanged lines hidden (view full) --- 88#define TP_OFFSET 0x7008 89register uint8_t *_tpr __asm("%r2"); 90 91#define _tcb ((struct tcb *)(_tpr - TP_OFFSET - offsetof(struct tcb, tcb_tp))) 92 93/* 94 * The kcb and tcb constructors. 95 */ | 46 47#define THR_GETCONTEXT(ucp) _ppc32_getcontext(&(ucp)->uc_mcontext) 48#define THR_SETCONTEXT(ucp) _ppc32_setcontext(&(ucp)->uc_mcontext, 0, NULL) 49 50#define PER_THREAD 51 52struct kcb; 53struct kse; --- 34 unchanged lines hidden (view full) --- 88#define TP_OFFSET 0x7008 89register uint8_t *_tpr __asm("%r2"); 90 91#define _tcb ((struct tcb *)(_tpr - TP_OFFSET - offsetof(struct tcb, tcb_tp))) 92 93/* 94 * The kcb and tcb constructors. 95 */ |
96struct tcb *_tcb_ctor(struct pthread *); | 96struct tcb *_tcb_ctor(struct pthread *, int); |
97void _tcb_dtor(struct tcb *); 98struct kcb *_kcb_ctor(struct kse *kse); 99void _kcb_dtor(struct kcb *); 100 101/* Called from the KSE to set its private data. */ 102static __inline void 103_kcb_set(struct kcb *kcb) 104{ --- 154 unchanged lines hidden --- | 97void _tcb_dtor(struct tcb *); 98struct kcb *_kcb_ctor(struct kse *kse); 99void _kcb_dtor(struct kcb *); 100 101/* Called from the KSE to set its private data. */ 102static __inline void 103_kcb_set(struct kcb *kcb) 104{ --- 154 unchanged lines hidden --- |