Lines Matching refs:tf

88 void trap(struct trapframe *tf);
89 void syscall(struct trapframe *tf);
92 static int trap_pfault(struct thread *td, struct trapframe *tf);
255 trap(struct trapframe *tf)
267 trap_msg[tf->tf_type & ~T_KERNEL],
268 (TRAPF_USERMODE(tf) ? "user" : "kernel"), rdpr(pil));
272 if ((tf->tf_tstate & TSTATE_PRIV) == 0) {
278 td->td_frame = tf;
279 addr = tf->tf_tpc;
283 switch (tf->tf_type) {
286 addr = tf->tf_sfar;
289 sig = trap_pfault(td, tf);
292 sig = rwindow_load(td, tf, 2);
295 sig = rwindow_load(td, tf, 1);
304 if (tf->tf_type > T_MAX)
306 tf->tf_type);
307 else if (trap_sig[tf->tf_type] == -1)
309 trap_msg[tf->tf_type]);
310 sig = trap_sig[tf->tf_type];
318 tf->tf_type);
325 ksi.ksi_code = (int)tf->tf_type; /* XXX not POSIX */
327 ksi.ksi_trapno = (int)tf->tf_type;
331 userret(td, tf);
334 KASSERT((tf->tf_type & T_KERNEL) != 0,
342 switch (tf->tf_type & ~T_KERNEL) {
345 error = (kdb_trap(tf->tf_type, 0, tf) == 0);
346 TF_DONE(tf);
351 error = db_watch_trap(tf);
357 error = trap_pfault(td, tf);
361 if ((tf->tf_sfsr & MMU_SFSR_FV) != 0 &&
362 MMU_SFSR_GET_ASI(tf->tf_sfsr) == ASI_AIUP) {
363 if (tf->tf_tpc >= (u_long)copy_nofault_begin &&
364 tf->tf_tpc <= (u_long)copy_nofault_end) {
365 tf->tf_tpc = (u_long)copy_fault;
366 tf->tf_tnpc = tf->tf_tpc + 4;
370 if (tf->tf_tpc >= (u_long)fs_nofault_begin &&
371 tf->tf_tpc <= (u_long)fs_nofault_end) {
372 tf->tf_tpc = (u_long)fs_fault;
373 tf->tf_tnpc = tf->tf_tpc + 4;
387 if (tf->tf_tpc > (u_long)fas_nofault_begin &&
388 tf->tf_tpc < (u_long)fas_nofault_end) {
391 tf->tf_tpc = (u_long)fas_fault;
392 tf->tf_tnpc = tf->tf_tpc + 4;
407 tf->tf_type &= ~T_KERNEL;
408 if (tf->tf_type > T_MAX)
410 tf->tf_type);
411 panic("trap: %s (kernel)", trap_msg[tf->tf_type]);
443 trap_pfault(struct thread *td, struct trapframe *tf)
463 ctx = TLB_TAR_CTX(tf->tf_tar);
464 type = tf->tf_type & ~T_KERNEL;
465 va = TLB_TAR_VA(tf->tf_tar);
480 if ((tf->tf_tstate & TSTATE_PRIV) != 0 &&
481 (tf->tf_tpc >= (u_long)fs_nofault_intr_begin &&
482 tf->tf_tpc <= (u_long)fs_nofault_intr_end)) {
483 tf->tf_tpc = (u_long)fs_fault;
484 tf->tf_tnpc = tf->tf_tpc + 4;
516 KASSERT(tf->tf_tstate & TSTATE_PRIV,
519 if (tf->tf_tpc >= (u_long)copy_nofault_begin &&
520 tf->tf_tpc <= (u_long)copy_nofault_end) {
524 tf->tf_tpc = (u_long)copy_fault;
525 tf->tf_tnpc = tf->tf_tpc + 4;
543 if (ctx != TLB_CTX_KERNEL && (tf->tf_tstate & TSTATE_PRIV) != 0) {
544 if (tf->tf_tpc >= (u_long)fs_nofault_begin &&
545 tf->tf_tpc <= (u_long)fs_nofault_end) {
546 tf->tf_tpc = (u_long)fs_fault;
547 tf->tf_tnpc = tf->tf_tpc + 4;
550 if (tf->tf_tpc >= (u_long)copy_nofault_begin &&
551 tf->tf_tpc <= (u_long)copy_nofault_end) {
552 tf->tf_tpc = (u_long)copy_fault;
553 tf->tf_tnpc = tf->tf_tpc + 4;
566 struct trapframe *tf;
574 tf = td->td_frame;
578 sa->code = tf->tf_global[1];
581 sa->code = tf->tf_out[reg++];
597 bcopy(&tf->tf_out[reg], sa->args, sizeof(sa->args[0]) * regcnt);
599 error = copyin((void *)(tf->tf_out[6] + SPOFF +
619 syscall(struct trapframe *tf)
626 td->td_frame = tf;
635 td->td_pcb->pcb_tpc = tf->tf_tpc;
636 TF_DONE(tf);