Subversion Repositories HelenOS

Rev

Rev 2787 | Rev 2817 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2787 Rev 2799
Line 45... Line 45...
45
#include <console/chardev.h>
45
#include <console/chardev.h>
46
#include <console/cmd.h>
46
#include <console/cmd.h>
47
#include <panic.h>
47
#include <panic.h>
48
#include <print.h>
48
#include <print.h>
49
#include <symtab.h>
49
#include <symtab.h>
50
#include <tdebug/tdebug.h>
-
 
51
 
50
 
52
static struct {
51
static struct {
53
    const char *name;
52
    const char *name;
54
    iroutine f;
53
    iroutine f;
55
} exc_table[IVT_ITEMS];
54
} exc_table[IVT_ITEMS];
Line 85... Line 84...
85
 * CPU is interrupts_disable()'d.
84
 * CPU is interrupts_disable()'d.
86
 */
85
 */
87
void exc_dispatch(int n, istate_t *istate)
86
void exc_dispatch(int n, istate_t *istate)
88
{
87
{
89
    ASSERT(n < IVT_ITEMS);
88
    ASSERT(n < IVT_ITEMS);
90
 
-
 
91
    if (THREAD && istate_from_uspace(istate)) {
-
 
92
        /* Record userspace state */
-
 
93
        THREAD->tdebug.uspace_state = istate;
-
 
94
    }
89
   
95
 
-
 
96
    exc_table[n].f(n + IVT_FIRST, istate);
90
    exc_table[n].f(n + IVT_FIRST, istate);
97
 
-
 
98
    if (THREAD && istate_from_uspace(istate)) {
-
 
99
        /* Clear it again (mostly for dev. and debugging purposes) */
-
 
100
        THREAD->tdebug.uspace_state = NULL;
-
 
101
    }
-
 
102
 
-
 
103
    /* This is a safe place to exit exiting thread */
91
    /* This is a safe place to exit exiting thread */
104
    if (THREAD && THREAD->interrupted && istate_from_uspace(istate))
92
    if (THREAD && THREAD->interrupted && istate_from_uspace(istate))
105
        thread_exit();
93
        thread_exit();
106
}
94
}
107
 
95