Rev 1579 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1579 | Rev 1597 | ||
|---|---|---|---|
| Line 45... | Line 45... | ||
| 45 | #include <ddi/ddi.h> |
45 | #include <ddi/ddi.h> |
| 46 | #include <security/cap.h> |
46 | #include <security/cap.h> |
| 47 | #include <syscall/copy.h> |
47 | #include <syscall/copy.h> |
| 48 | #include <sysinfo/sysinfo.h> |
48 | #include <sysinfo/sysinfo.h> |
| 49 | #include <console/console.h> |
49 | #include <console/console.h> |
| - | 50 | #include <console/klog.h> |
|
| 50 | 51 | ||
| 51 | /** Print using kernel facility |
52 | /** Print using kernel facility |
| 52 | * |
53 | * |
| 53 | * Some simulators can print only through kernel. Userspace can use |
54 | * Some simulators can print only through kernel. Userspace can use |
| 54 | * this syscall to facilitate it. |
55 | * this syscall to facilitate it. |
| Line 89... | Line 90... | ||
| 89 | /** Dispatch system call */ |
90 | /** Dispatch system call */ |
| 90 | __native syscall_handler(__native a1, __native a2, __native a3, |
91 | __native syscall_handler(__native a1, __native a2, __native a3, |
| 91 | __native a4, __native id) |
92 | __native a4, __native id) |
| 92 | { |
93 | { |
| 93 | __native rc; |
94 | __native rc; |
| 94 | ipl_t ipl; |
- | |
| 95 | bool exit = false; |
- | |
| 96 | 95 | ||
| 97 | if (id < SYSCALL_END) |
96 | if (id < SYSCALL_END) |
| 98 | rc = syscall_table[id](a1,a2,a3,a4); |
97 | rc = syscall_table[id](a1,a2,a3,a4); |
| 99 | else |
98 | else { |
| 100 | panic("Undefined syscall %d", id); |
99 | klog_printf("TASK %lld: Unknown syscall id %d",TASK->taskid,id); |
| - | 100 | task_kill(TASK->taskid); |
|
| - | 101 | thread_exit(); |
|
| - | 102 | } |
|
| 101 | 103 | ||
| 102 | ipl = interrupts_disable(); |
- | |
| 103 | spinlock_lock(&THREAD->lock); |
- | |
| 104 | if (THREAD->interrupted) |
104 | if (THREAD->interrupted) |
| 105 | exit = true; |
- | |
| 106 | spinlock_unlock(&THREAD->lock); |
- | |
| 107 | interrupts_restore(ipl); |
- | |
| 108 | - | ||
| 109 | if (exit) |
- | |
| 110 | thread_exit(); |
105 | thread_exit(); |
| 111 | 106 | ||
| 112 | return rc; |
107 | return rc; |
| 113 | } |
108 | } |
| 114 | 109 | ||