Rev 1474 | Rev 1597 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1474 | Rev 1579 | ||
---|---|---|---|
Line 88... | Line 88... | ||
88 | 88 | ||
89 | /** Dispatch system call */ |
89 | /** Dispatch system call */ |
90 | __native syscall_handler(__native a1, __native a2, __native a3, |
90 | __native syscall_handler(__native a1, __native a2, __native a3, |
91 | __native a4, __native id) |
91 | __native a4, __native id) |
92 | { |
92 | { |
- | 93 | __native rc; |
|
- | 94 | ipl_t ipl; |
|
- | 95 | bool exit = false; |
|
- | 96 | ||
93 | if (id < SYSCALL_END) |
97 | if (id < SYSCALL_END) |
94 | return syscall_table[id](a1,a2,a3,a4); |
98 | rc = syscall_table[id](a1,a2,a3,a4); |
95 | else |
99 | else |
96 | panic("Undefined syscall %d", id); |
100 | panic("Undefined syscall %d", id); |
- | 101 | ||
- | 102 | ipl = interrupts_disable(); |
|
- | 103 | spinlock_lock(&THREAD->lock); |
|
- | 104 | if (THREAD->interrupted) |
|
- | 105 | exit = true; |
|
- | 106 | spinlock_unlock(&THREAD->lock); |
|
- | 107 | interrupts_restore(ipl); |
|
- | 108 | ||
- | 109 | if (exit) |
|
- | 110 | thread_exit(); |
|
- | 111 | ||
- | 112 | return rc; |
|
97 | } |
113 | } |
98 | 114 | ||
99 | syshandler_t syscall_table[SYSCALL_END] = { |
115 | syshandler_t syscall_table[SYSCALL_END] = { |
100 | sys_io, |
116 | sys_io, |
101 | sys_tls_set, |
117 | sys_tls_set, |