Lines Matching +full:tf +full:- +full:a
3 /*-
4 * SPDX-License-Identifier: BSD-4-Clause
7 * Copyright (c) 1994-1998 Mark Brinicombe.
31 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
79 struct trapframe *tf = td->td_frame; in exec_setregs() local
81 memset(tf, 0, sizeof(*tf)); in exec_setregs()
82 tf->tf_usr_sp = stack; in exec_setregs()
83 tf->tf_usr_lr = imgp->entry_addr; in exec_setregs()
84 tf->tf_svc_lr = 0x77777777; in exec_setregs()
85 tf->tf_pc = imgp->entry_addr; in exec_setregs()
86 tf->tf_spsr = PSR_USR32_MODE; in exec_setregs()
87 if ((register_t)imgp->entry_addr & 1) in exec_setregs()
88 tf->tf_spsr |= PSR_T; in exec_setregs()
101 P_SHOULDSTOP(td->td_proc)); in get_vfpcontext()
103 pcb = td->td_pcb; in get_vfpcontext()
106 vfp_store(&pcb->pcb_vfpstate, false); in get_vfpcontext()
109 KASSERT(pcb->pcb_vfpsaved == &pcb->pcb_vfpstate, in get_vfpcontext()
113 memcpy(vfp->mcv_reg, pcb->pcb_vfpstate.reg, in get_vfpcontext()
114 sizeof(vfp->mcv_reg)); in get_vfpcontext()
115 vfp->mcv_fpscr = pcb->pcb_vfpstate.fpscr; in get_vfpcontext()
127 pcb = td->td_pcb; in set_vfpcontext()
133 KASSERT(pcb->pcb_vfpsaved == &pcb->pcb_vfpstate, in set_vfpcontext()
135 memcpy(pcb->pcb_vfpstate.reg, vfp->mcv_reg, in set_vfpcontext()
136 sizeof(pcb->pcb_vfpstate.reg)); in set_vfpcontext()
137 pcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr; in set_vfpcontext()
172 struct trapframe *tf = td->td_frame; in get_mcontext() local
173 __greg_t *gr = mcp->__gregs; in get_mcontext()
177 gr[_REG_CPSR] = tf->tf_spsr & ~PSR_C; in get_mcontext()
179 gr[_REG_R0] = tf->tf_r0; in get_mcontext()
180 gr[_REG_CPSR] = tf->tf_spsr; in get_mcontext()
182 gr[_REG_R1] = tf->tf_r1; in get_mcontext()
183 gr[_REG_R2] = tf->tf_r2; in get_mcontext()
184 gr[_REG_R3] = tf->tf_r3; in get_mcontext()
185 gr[_REG_R4] = tf->tf_r4; in get_mcontext()
186 gr[_REG_R5] = tf->tf_r5; in get_mcontext()
187 gr[_REG_R6] = tf->tf_r6; in get_mcontext()
188 gr[_REG_R7] = tf->tf_r7; in get_mcontext()
189 gr[_REG_R8] = tf->tf_r8; in get_mcontext()
190 gr[_REG_R9] = tf->tf_r9; in get_mcontext()
191 gr[_REG_R10] = tf->tf_r10; in get_mcontext()
192 gr[_REG_R11] = tf->tf_r11; in get_mcontext()
193 gr[_REG_R12] = tf->tf_r12; in get_mcontext()
194 gr[_REG_SP] = tf->tf_usr_sp; in get_mcontext()
195 gr[_REG_LR] = tf->tf_usr_lr; in get_mcontext()
196 gr[_REG_PC] = tf->tf_pc; in get_mcontext()
198 mcp->mc_vfp_size = 0; in get_mcontext()
199 mcp->mc_vfp_ptr = NULL; in get_mcontext()
200 memset(&mcp->mc_spare, 0, sizeof(mcp->mc_spare)); in get_mcontext()
215 struct trapframe *tf = td->td_frame; in set_mcontext() local
216 const __greg_t *gr = mcp->__gregs; in set_mcontext()
229 if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_size != sizeof(mc_vfp)) { in set_mcontext()
231 td->td_proc->p_comm, __func__, in set_mcontext()
232 mcp->mc_vfp_size, mcp->mc_vfp_size); in set_mcontext()
233 } else if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_ptr == NULL) { in set_mcontext()
235 td->td_proc->p_comm, __func__); in set_mcontext()
239 if (mcp->mc_vfp_size == sizeof(mc_vfp) && mcp->mc_vfp_ptr != NULL) { in set_mcontext()
240 if (copyin(mcp->mc_vfp_ptr, &mc_vfp, sizeof(mc_vfp)) != 0) in set_mcontext()
247 tf->tf_r0 = gr[_REG_R0]; in set_mcontext()
248 tf->tf_r1 = gr[_REG_R1]; in set_mcontext()
249 tf->tf_r2 = gr[_REG_R2]; in set_mcontext()
250 tf->tf_r3 = gr[_REG_R3]; in set_mcontext()
251 tf->tf_r4 = gr[_REG_R4]; in set_mcontext()
252 tf->tf_r5 = gr[_REG_R5]; in set_mcontext()
253 tf->tf_r6 = gr[_REG_R6]; in set_mcontext()
254 tf->tf_r7 = gr[_REG_R7]; in set_mcontext()
255 tf->tf_r8 = gr[_REG_R8]; in set_mcontext()
256 tf->tf_r9 = gr[_REG_R9]; in set_mcontext()
257 tf->tf_r10 = gr[_REG_R10]; in set_mcontext()
258 tf->tf_r11 = gr[_REG_R11]; in set_mcontext()
259 tf->tf_r12 = gr[_REG_R12]; in set_mcontext()
260 tf->tf_usr_sp = gr[_REG_SP]; in set_mcontext()
261 tf->tf_usr_lr = gr[_REG_LR]; in set_mcontext()
262 tf->tf_pc = gr[_REG_PC]; in set_mcontext()
263 tf->tf_spsr = gr[_REG_CPSR]; in set_mcontext()
276 struct trapframe *tf; in sendsig() local
284 p = td->td_proc; in sendsig()
286 sig = ksi->ksi_signo; in sendsig()
287 psp = p->p_sigacts; in sendsig()
288 mtx_assert(&psp->ps_mtx, MA_OWNED); in sendsig()
289 tf = td->td_frame; in sendsig()
290 onstack = sigonstack(tf->tf_usr_sp); in sendsig()
292 CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, in sendsig()
296 if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && in sendsig()
297 SIGISMEMBER(psp->ps_sigonstack, sig)) { in sendsig()
298 fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + in sendsig()
299 td->td_sigstk.ss_size); in sendsig()
301 td->td_sigstk.ss_flags |= SS_ONSTACK; in sendsig()
304 fp = (struct sigframe *)td->td_frame->tf_usr_sp; in sendsig()
307 fp--; in sendsig()
317 frame.sf_uc.uc_mcontext.mc_vfp_size = sizeof(fp->sf_vfp); in sendsig()
318 frame.sf_uc.uc_mcontext.mc_vfp_ptr = &fp->sf_vfp; in sendsig()
324 frame.sf_si = ksi->ksi_info; in sendsig()
326 frame.sf_uc.uc_stack = td->td_sigstk; in sendsig()
327 frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) != 0 ? in sendsig()
329 mtx_unlock(&psp->ps_mtx); in sendsig()
330 PROC_UNLOCK(td->td_proc); in sendsig()
343 * trampoline version numbers are coordinated with machine- in sendsig()
347 tf->tf_r0 = sig; in sendsig()
348 tf->tf_r1 = (register_t)&fp->sf_si; in sendsig()
349 tf->tf_r2 = (register_t)&fp->sf_uc; in sendsig()
352 tf->tf_r5 = (register_t)&fp->sf_uc; in sendsig()
353 tf->tf_pc = (register_t)catcher; in sendsig()
354 tf->tf_usr_sp = (register_t)fp; in sendsig()
355 sysent = p->p_sysent; in sendsig()
357 tf->tf_usr_lr = (register_t)PROC_SIGCODE(p); in sendsig()
359 tf->tf_usr_lr = (register_t)(PROC_PS_STRINGS(p) - in sendsig()
360 *(sysent->sv_szsigcode)); in sendsig()
363 tf->tf_spsr |= PSR_T; in sendsig()
365 tf->tf_spsr &= ~PSR_T; in sendsig()
367 CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_usr_lr, in sendsig()
368 tf->tf_usr_sp); in sendsig()
371 mtx_lock(&psp->ps_mtx); in sendsig()
382 if (copyin(uap->sigcntxp, &uc, sizeof(uc))) in sys_sigreturn()