Lines Matching defs:tcb

37 #define	DTV_OFFSET		offsetof(struct tcb, tcb_tp.tp_dtv)
47 struct tcb;
52 * sure that there will not be any padding in struct tcb after the
60 struct tcb {
71 struct tcb *kcb_curtcb;
72 struct tcb kcb_faketcb;
75 static __inline struct tcb *
80 return ((struct tcb *)(tp - offsetof(struct tcb, tcb_tp)));
84 ia64_set_tcb(struct tcb *tcb)
88 __asm __volatile("mov %0 = %1;;" : "=r"(tp) : "r"(&tcb->tcb_tp));
92 * The kcb and tcb constructors.
94 struct tcb *_tcb_ctor(struct pthread *, int);
95 void _tcb_dtor(struct tcb *);
103 /* There is no thread yet; use the fake tcb. */
127 struct tcb *tcb;
131 tcb = ia64_get_tcb();
132 if (tcb->tcb_isfake != 0) {
139 flags = tcb->tcb_tmbx.tm_flags;
140 tcb->tcb_tmbx.tm_flags |= TMF_NOUPCALL;
141 crit = tcb->tcb_curkcb->kcb_kmbx.km_curthread;
142 tcb->tcb_curkcb->kcb_kmbx.km_curthread = NULL;
143 tcb->tcb_tmbx.tm_flags = flags;
151 struct tcb *tcb;
153 tcb = ia64_get_tcb();
154 /* No need to do anything if this is a fake tcb. */
155 if (tcb->tcb_isfake == 0)
156 tcb->tcb_curkcb->kcb_kmbx.km_curthread = crit;
162 struct tcb *tcb;
166 tcb = ia64_get_tcb();
167 if (tcb->tcb_isfake != 0) {
174 flags = tcb->tcb_tmbx.tm_flags;
175 tcb->tcb_tmbx.tm_flags |= TMF_NOUPCALL;
176 ret = (tcb->tcb_curkcb->kcb_kmbx.km_curthread == NULL);
177 tcb->tcb_tmbx.tm_flags = flags;
183 _tcb_set(struct kcb *kcb, struct tcb *tcb)
185 if (tcb == NULL)
186 tcb = &kcb->kcb_faketcb;
187 kcb->kcb_curtcb = tcb;
188 tcb->tcb_curkcb = kcb;
189 ia64_set_tcb(tcb);
192 static __inline struct tcb *
222 _thread_enter_uts(struct tcb *tcb, struct kcb *kcb)
224 if (_ia64_save_context(&tcb->tcb_tmbx.tm_context.uc_mcontext) == 0) {
225 /* Make the fake tcb the current thread. */
238 _thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
242 _tcb_set(kcb, tcb);
243 mc = &tcb->tcb_tmbx.tm_context.uc_mcontext;
249 mc->mc_special.isr = (intptr_t)&tcb->tcb_tmbx;
254 kse_switchin(&tcb->tcb_tmbx, KSE_SWITCHIN_SETTMBX);
256 kse_switchin(&tcb->tcb_tmbx, 0);
259 _ia64_restore_context(mc, (intptr_t)&tcb->tcb_tmbx,