Rev 3001 | Rev 3150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3001 | Rev 3149 | ||
|---|---|---|---|
| Line 49... | Line 49... | ||
| 49 | #include <ddi/ddi.h> |
49 | #include <ddi/ddi.h> |
| 50 | #include <security/cap.h> |
50 | #include <security/cap.h> |
| 51 | #include <syscall/copy.h> |
51 | #include <syscall/copy.h> |
| 52 | #include <sysinfo/sysinfo.h> |
52 | #include <sysinfo/sysinfo.h> |
| 53 | #include <console/console.h> |
53 | #include <console/console.h> |
| 54 | #include <console/klog.h> |
- | |
| 55 | 54 | ||
| 56 | /** Print using kernel facility |
55 | /** Print using kernel facility |
| 57 | * |
56 | * |
| 58 | * Some simulators can print only through kernel. Userspace can use |
- | |
| 59 | * this syscall to facilitate it. |
57 | * Print to kernel log. |
| - | 58 | * |
|
| 60 | */ |
59 | */ |
| 61 | static unative_t sys_io(int fd, const void * buf, size_t count) |
60 | static unative_t sys_io(int fd, const void * buf, size_t count) |
| 62 | { |
61 | { |
| 63 | size_t i; |
62 | size_t i; |
| 64 | char *data; |
63 | char *data; |
| Line 105... | Line 104... | ||
| 105 | unative_t rc; |
104 | unative_t rc; |
| 106 | 105 | ||
| 107 | if (id < SYSCALL_END) |
106 | if (id < SYSCALL_END) |
| 108 | rc = syscall_table[id](a1, a2, a3, a4, a5, a6); |
107 | rc = syscall_table[id](a1, a2, a3, a4, a5, a6); |
| 109 | else { |
108 | else { |
| 110 | klog_printf("TASK %llu: Unknown syscall id %lx", TASK->taskid, |
109 | printf("Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id); |
| 111 | id); |
- | |
| 112 | task_kill(TASK->taskid); |
110 | task_kill(TASK->taskid); |
| 113 | thread_exit(); |
111 | thread_exit(); |
| 114 | } |
112 | } |
| 115 | 113 | ||
| 116 | if (THREAD->interrupted) |
114 | if (THREAD->interrupted) |
| Line 125... | Line 123... | ||
| 125 | 123 | ||
| 126 | /* Thread and task related syscalls. */ |
124 | /* Thread and task related syscalls. */ |
| 127 | (syshandler_t) sys_thread_create, |
125 | (syshandler_t) sys_thread_create, |
| 128 | (syshandler_t) sys_thread_exit, |
126 | (syshandler_t) sys_thread_exit, |
| 129 | (syshandler_t) sys_thread_get_id, |
127 | (syshandler_t) sys_thread_get_id, |
| - | 128 | ||
| 130 | (syshandler_t) sys_task_get_id, |
129 | (syshandler_t) sys_task_get_id, |
| 131 | (syshandler_t) sys_task_spawn, |
130 | (syshandler_t) sys_task_spawn, |
| - | 131 | (syshandler_t) sys_task_spawn_loader, |
|
| 132 | 132 | ||
| 133 | /* Synchronization related syscalls. */ |
133 | /* Synchronization related syscalls. */ |
| 134 | (syshandler_t) sys_futex_sleep_timeout, |
134 | (syshandler_t) sys_futex_sleep_timeout, |
| 135 | (syshandler_t) sys_futex_wakeup, |
135 | (syshandler_t) sys_futex_wakeup, |
| 136 | 136 | ||