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;
280 ucode = (int)tf->tf_type; /* XXX not POSIX */
284 switch (tf->tf_type) {
287 addr = tf->tf_sfar;
290 sig = trap_pfault(td, tf);
293 sig = rwindow_load(td, tf, 2);
296 sig = rwindow_load(td, tf, 1);
309 if (tf->tf_type > T_MAX)
311 tf->tf_type);
312 else if (trap_sig[tf->tf_type] == -1)
314 trap_msg[tf->tf_type]);
315 sig = trap_sig[tf->tf_type];
323 tf->tf_type);
332 ksi.ksi_trapno = (int)tf->tf_type;
336 userret(td, tf);
338 KASSERT((tf->tf_type & T_KERNEL) != 0,
346 switch (tf->tf_type & ~T_KERNEL) {
349 error = (kdb_trap(tf->tf_type, 0, tf) == 0);
350 TF_DONE(tf);
355 error = db_watch_trap(tf);
361 error = trap_pfault(td, tf);
365 if ((tf->tf_sfsr & MMU_SFSR_FV) != 0 &&
366 MMU_SFSR_GET_ASI(tf->tf_sfsr) == ASI_AIUP) {
367 if (tf->tf_tpc >= (u_long)copy_nofault_begin &&
368 tf->tf_tpc <= (u_long)copy_nofault_end) {
369 tf->tf_tpc = (u_long)copy_fault;
370 tf->tf_tnpc = tf->tf_tpc + 4;
374 if (tf->tf_tpc >= (u_long)fs_nofault_begin &&
375 tf->tf_tpc <= (u_long)fs_nofault_end) {
376 tf->tf_tpc = (u_long)fs_fault;
377 tf->tf_tnpc = tf->tf_tpc + 4;
391 if (tf->tf_tpc > (u_long)fas_nofault_begin &&
392 tf->tf_tpc < (u_long)fas_nofault_end) {
395 tf->tf_tpc = (u_long)fas_fault;
396 tf->tf_tnpc = tf->tf_tpc + 4;
411 tf->tf_type &= ~T_KERNEL;
412 if (tf->tf_type > T_MAX)
414 tf->tf_type);
415 panic("trap: %s (kernel)", trap_msg[tf->tf_type]);
447 trap_pfault(struct thread *td, struct trapframe *tf)
467 ctx = TLB_TAR_CTX(tf->tf_tar);
468 type = tf->tf_type & ~T_KERNEL;
469 va = TLB_TAR_VA(tf->tf_tar);
484 if ((tf->tf_tstate & TSTATE_PRIV) != 0 &&
485 (tf->tf_tpc >= (u_long)fs_nofault_intr_begin &&
486 tf->tf_tpc <= (u_long)fs_nofault_intr_end)) {
487 tf->tf_tpc = (u_long)fs_fault;
488 tf->tf_tnpc = tf->tf_tpc + 4;
500 KASSERT(tf->tf_tstate & TSTATE_PRIV,
503 if (tf->tf_tpc >= (u_long)copy_nofault_begin &&
504 tf->tf_tpc <= (u_long)copy_nofault_end) {
508 tf->tf_tpc = (u_long)copy_fault;
509 tf->tf_tnpc = tf->tf_tpc + 4;
525 if (ctx != TLB_CTX_KERNEL && (tf->tf_tstate & TSTATE_PRIV) != 0) {
526 if (tf->tf_tpc >= (u_long)fs_nofault_begin &&
527 tf->tf_tpc <= (u_long)fs_nofault_end) {
528 tf->tf_tpc = (u_long)fs_fault;
529 tf->tf_tnpc = tf->tf_tpc + 4;
532 if (tf->tf_tpc >= (u_long)copy_nofault_begin &&
533 tf->tf_tpc <= (u_long)copy_nofault_end) {
534 tf->tf_tpc = (u_long)copy_fault;
535 tf->tf_tnpc = tf->tf_tpc + 4;
548 struct trapframe *tf;
557 tf = td->td_frame;
562 sa->code = tf->tf_global[1];
565 sa->code = tf->tf_out[reg++];
581 bcopy(&tf->tf_out[reg], sa->args, sizeof(sa->args[0]) * regcnt);
583 error = copyin((void *)(tf->tf_out[6] + SPOFF +
603 syscall(struct trapframe *tf)
609 td->td_frame = tf;
618 td->td_pcb->pcb_tpc = tf->tf_tpc;
619 TF_DONE(tf);