Lines Matching refs:tf
23 extern void trap_pop(TrapFrame *tf);
24 extern void Debug_Breakpoint(TrapFrame *tf);
25 extern void Debug_HaltIPI(TrapFrame *tf);
95 Trap_Dump(TrapFrame *tf)
99 tf->vector, tf->errcode);
109 tf->cs, tf->rip, tf->ss, tf->rsp);
111 tf->rflags, read_ds(), read_es(), read_fs(), read_gs());
113 tf->rax, tf->rbx, tf->rcx);
115 tf->rdx, tf->rsi, tf->rdi);
117 tf->rbp, tf->r8, tf->r9);
119 tf->r10, tf->r11, tf->r12);
121 tf->r13, tf->r14, tf->r15);
125 Trap_StackDump(TrapFrame *tf)
131 for (rsp = tf->rsp; (rsp & 0xFFF) != 0; rsp += 8) {
146 trap_entry(TrapFrame *tf)
149 intStats[tf->vector]++;
152 if (tf->vector == T_NMI) {
154 kprintf("Kernel Fault: Vector %d\n", tf->vector);
155 Trap_Dump(tf);
156 Debug_Breakpoint(tf);
161 if (tf->cs == SEL_KCS)
164 if (tf->vector == T_BP || tf->vector == T_DE) {
165 Debug_Breakpoint(tf);
170 if ((tf->vector == T_PF) &&
171 (tf->rip >= (uint64_t)©_unsafe) &&
172 (tf->rip <= (uint64_t)©_unsafe_done)) {
174 tf->rip = (uint64_t)©_unsafe_fault;
179 if ((tf->vector == T_PF) &&
180 (tf->rip >= (uint64_t)©str_unsafe) &&
181 (tf->rip <= (uint64_t)©str_unsafe_done)) {
183 tf->rip = (uint64_t)©str_unsafe_fault;
188 if (tf->vector <= T_CPU_LAST)
191 kprintf("Kernel Fault: Vector %d\n", tf->vector);
192 Trap_Dump(tf);
193 Debug_Breakpoint(tf);
200 switch (tf->vector)
209 Debug_Breakpoint(tf);
213 Trap_Dump(tf);
214 Trap_StackDump(tf);
215 Debug_Breakpoint(tf);
218 VLOG(syscall, "Syscall %016llx\n", tf->rdi);
219 tf->rax = Syscall_Entry(tf->rdi, tf->rsi, tf->rdx, tf->rcx, tf->r8, tf->r9);
220 VLOG(syscall, "Return %016llx\n", tf->rax);
226 if (tf->vector >= T_IRQ_BASE && tf->vector <= T_IRQ_MAX)
229 IRQ_Handler(tf->vector - T_IRQ_BASE);
230 if (tf->vector == T_IRQ_TIMER) {
239 if (tf->vector == T_DEBUGIPI) {
240 Debug_HaltIPI(tf);
245 if (tf->vector == T_CROSSCALL)
253 if (tf->vector == T_IRQ_SPURIOUS)
258 if (tf->vector == T_IRQ_ERROR)
264 if (tf->vector == T_IRQ_THERMAL)
271 kprintf("Unhandled Interrupt 0x%x!\n", tf->vector);
272 Trap_Dump(tf);