Rev 3425 | Rev 3606 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3425 | Rev 3431 | ||
---|---|---|---|
Line 99... | Line 99... | ||
99 | /** Dispatch system call */ |
99 | /** Dispatch system call */ |
100 | unative_t syscall_handler(unative_t a1, unative_t a2, unative_t a3, |
100 | unative_t syscall_handler(unative_t a1, unative_t a2, unative_t a3, |
101 | unative_t a4, unative_t a5, unative_t a6, unative_t id) |
101 | unative_t a4, unative_t a5, unative_t a6, unative_t id) |
102 | { |
102 | { |
103 | unative_t rc; |
103 | unative_t rc; |
- | 104 | ||
- | 105 | #ifdef CONFIG_UDEBUG |
|
104 | istate_t fake_state; |
106 | istate_t fake_state; |
105 | 107 | ||
106 | THREAD->udebug.uspace_state = &fake_state; |
108 | THREAD->udebug.uspace_state = &fake_state; |
107 | udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false); |
109 | udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, 0, false); |
- | 110 | #endif |
|
108 | 111 | ||
109 | if (id < SYSCALL_END) { |
112 | if (id < SYSCALL_END) { |
- | 113 | #ifdef CONFIG_UDEBUG |
|
110 | udebug_stoppable_begin(); |
114 | udebug_stoppable_begin(); |
- | 115 | #endif |
|
111 | rc = syscall_table[id](a1, a2, a3, a4, a5, a6); |
116 | rc = syscall_table[id](a1, a2, a3, a4, a5, a6); |
112 | } else { |
117 | } else { |
113 | printf("Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id); |
118 | printf("Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id); |
114 | task_kill(TASK->taskid); |
119 | task_kill(TASK->taskid); |
115 | thread_exit(); |
120 | thread_exit(); |
116 | } |
121 | } |
117 | 122 | ||
118 | if (THREAD->interrupted) |
123 | if (THREAD->interrupted) |
119 | thread_exit(); |
124 | thread_exit(); |
120 | 125 | ||
- | 126 | #ifdef CONFIG_UDEBUG |
|
121 | udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true); |
127 | udebug_syscall_event(a1, a2, a3, a4, a5, a6, id, rc, true); |
122 | udebug_stoppable_end(); |
128 | udebug_stoppable_end(); |
123 | THREAD->udebug.uspace_state = NULL; |
129 | THREAD->udebug.uspace_state = NULL; |
- | 130 | #endif |
|
124 | 131 | ||
125 | return rc; |
132 | return rc; |
126 | } |
133 | } |
127 | 134 | ||
128 | syshandler_t syscall_table[SYSCALL_END] = { |
135 | syshandler_t syscall_table[SYSCALL_END] = { |