Example #1
0
File: faults.c Project: ajithat/lk
void x86_syscall_handler(struct x86_iframe *frame)
{
	exception_die(frame, "unhandled syscall, halting\n");
}
Example #2
0
void x86_unhandled_exception(struct x86_iframe *frame)
{
	exception_die(frame, "unhandled exception, halting\n");
}
Example #3
0
void x86_invop_handler(struct x86_iframe *frame)
{
	exception_die(frame, "unhandled invalid op, halting\n");
}
Example #4
0
void x86_gpf_handler(struct x86_iframe *frame)
{
	exception_die(frame, "unhandled gpf, halting\n");
}
Example #5
0
File: faults.c Project: taphier/lk
void x86_pfe_handler(struct x86_iframe *frame)
{
    /* Handle a page fault exception */
    uint32_t error_code;
    thread_t *current_thread;
    error_code = frame->err_code;

#ifdef PAGE_FAULT_DEBUG_INFO
    addr_t v_addr, ssp, esp, ip, rip;
    v_addr = x86_get_cr2();

    ssp = frame->user_ss & X86_8BYTE_MASK;
    esp = frame->user_esp;
    ip  = frame->cs & X86_8BYTE_MASK;
    rip = frame->eip;

    dprintf(CRITICAL, "<PAGE FAULT> Instruction Pointer   = 0x%x:0x%x\n",
            (unsigned int)ip,
            (unsigned int)rip);
    dprintf(CRITICAL, "<PAGE FAULT> Stack Pointer         = 0x%x:0x%x\n",
            (unsigned int)ssp,
            (unsigned int)esp);
    dprintf(CRITICAL, "<PAGE FAULT> Fault Linear Address = 0x%x\n",
            (unsigned int)v_addr);
    dprintf(CRITICAL, "<PAGE FAULT> Error Code Value      = 0x%x\n",
            error_code);
    dprintf(CRITICAL, "<PAGE FAULT> Error Code Type = %s %s %s%s, %s\n",
            error_code & PFEX_U ? "user" : "supervisor",
            error_code & PFEX_W ? "write" : "read",
            error_code & PFEX_I ? "instruction" : "data",
            error_code & PFEX_RSV ? " rsv" : "",
            error_code & PFEX_P ? "protection violation" : "page not present");
#endif

    current_thread = get_current_thread();
    dump_thread(current_thread);

    if (error_code & PFEX_U) {
        // User mode page fault
        switch (error_code) {
            case 4:
            case 5:
            case 6:
            case 7:
#ifdef PAGE_FAULT_DEBUG_INFO
                thread_detach(current_thread);
#else
                thread_exit(current_thread->retcode);
#endif
                break;
        }
    } else {
        // Supervisor mode page fault
        switch (error_code) {

            case 0:
            case 1:
            case 2:
            case 3:
                exception_die(frame, "Page Fault exception, halting\n");
                break;
        }
    }
}
Example #6
0
void arm_syscall_handler(struct arm_fault_frame *frame)
{
	exception_die(frame, "unhandled syscall, halting\n");
}