Rev 2745 | Rev 2817 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2745 | Rev 2787 | ||
---|---|---|---|
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> |
|
50 | 51 | ||
51 | static struct { |
52 | static struct { |
52 | const char *name; |
53 | const char *name; |
53 | iroutine f; |
54 | iroutine f; |
54 | } exc_table[IVT_ITEMS]; |
55 | } exc_table[IVT_ITEMS]; |
Line 84... | Line 85... | ||
84 | * CPU is interrupts_disable()'d. |
85 | * CPU is interrupts_disable()'d. |
85 | */ |
86 | */ |
86 | void exc_dispatch(int n, istate_t *istate) |
87 | void exc_dispatch(int n, istate_t *istate) |
87 | { |
88 | { |
88 | ASSERT(n < IVT_ITEMS); |
89 | ASSERT(n < IVT_ITEMS); |
- | 90 | ||
- | 91 | if (THREAD && istate_from_uspace(istate)) { |
|
- | 92 | /* Record userspace state */ |
|
- | 93 | THREAD->tdebug.uspace_state = istate; |
|
89 | 94 | } |
|
- | 95 | ||
90 | exc_table[n].f(n + IVT_FIRST, istate); |
96 | 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 | ||
91 | /* This is a safe place to exit exiting thread */ |
103 | /* This is a safe place to exit exiting thread */ |
92 | if (THREAD && THREAD->interrupted && istate_from_uspace(istate)) |
104 | if (THREAD && THREAD->interrupted && istate_from_uspace(istate)) |
93 | thread_exit(); |
105 | thread_exit(); |
94 | } |
106 | } |
95 | 107 |