Rev 2071 | Rev 2131 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2119 | ||
---|---|---|---|
Line 65... | Line 65... | ||
65 | int rc; |
65 | int rc; |
66 | 66 | ||
67 | if (count > PAGE_SIZE) |
67 | if (count > PAGE_SIZE) |
68 | return ELIMIT; |
68 | return ELIMIT; |
69 | 69 | ||
70 | data = malloc(count, 0); |
70 | data = (char *) malloc(count, 0); |
71 | if (!data) |
71 | if (!data) |
72 | return ENOMEM; |
72 | return ENOMEM; |
73 | 73 | ||
74 | rc = copy_from_uspace(data, buf, count); |
74 | rc = copy_from_uspace(data, buf, count); |
75 | if (rc) { |
75 | if (rc) { |
Line 96... | Line 96... | ||
96 | unative_t a4, unative_t id) |
96 | unative_t a4, unative_t id) |
97 | { |
97 | { |
98 | unative_t rc; |
98 | unative_t rc; |
99 | 99 | ||
100 | if (id < SYSCALL_END) |
100 | if (id < SYSCALL_END) |
101 | rc = syscall_table[id](a1,a2,a3,a4); |
101 | rc = syscall_table[id](a1, a2, a3, a4); |
102 | else { |
102 | else { |
103 | klog_printf("TASK %lld: Unknown syscall id %d",TASK->taskid,id); |
103 | klog_printf("TASK %lld: Unknown syscall id %d",TASK->taskid,id); |
104 | task_kill(TASK->taskid); |
104 | task_kill(TASK->taskid); |
105 | thread_exit(); |
105 | thread_exit(); |
106 | } |
106 | } |
Line 110... | Line 110... | ||
110 | 110 | ||
111 | return rc; |
111 | return rc; |
112 | } |
112 | } |
113 | 113 | ||
114 | syshandler_t syscall_table[SYSCALL_END] = { |
114 | syshandler_t syscall_table[SYSCALL_END] = { |
115 | sys_io, |
115 | (syshandler_t) sys_io, |
116 | sys_tls_set, |
116 | (syshandler_t) sys_tls_set, |
117 | 117 | ||
118 | /* Thread and task related syscalls. */ |
118 | /* Thread and task related syscalls. */ |
119 | sys_thread_create, |
119 | (syshandler_t) sys_thread_create, |
120 | sys_thread_exit, |
120 | (syshandler_t) sys_thread_exit, |
121 | sys_task_get_id, |
121 | (syshandler_t) sys_task_get_id, |
122 | 122 | ||
123 | /* Synchronization related syscalls. */ |
123 | /* Synchronization related syscalls. */ |
124 | sys_futex_sleep_timeout, |
124 | (syshandler_t) sys_futex_sleep_timeout, |
125 | sys_futex_wakeup, |
125 | (syshandler_t) sys_futex_wakeup, |
126 | 126 | ||
127 | /* Address space related syscalls. */ |
127 | /* Address space related syscalls. */ |
128 | sys_as_area_create, |
128 | (syshandler_t) sys_as_area_create, |
129 | sys_as_area_resize, |
129 | (syshandler_t) sys_as_area_resize, |
130 | sys_as_area_destroy, |
130 | (syshandler_t) sys_as_area_destroy, |
131 | 131 | ||
132 | /* IPC related syscalls. */ |
132 | /* IPC related syscalls. */ |
133 | sys_ipc_call_sync_fast, |
133 | (syshandler_t) sys_ipc_call_sync_fast, |
134 | sys_ipc_call_sync, |
134 | (syshandler_t) sys_ipc_call_sync, |
135 | sys_ipc_call_async_fast, |
135 | (syshandler_t) sys_ipc_call_async_fast, |
136 | sys_ipc_call_async, |
136 | (syshandler_t) sys_ipc_call_async, |
137 | sys_ipc_answer_fast, |
137 | (syshandler_t) sys_ipc_answer_fast, |
138 | sys_ipc_answer, |
138 | (syshandler_t) sys_ipc_answer, |
139 | sys_ipc_forward_fast, |
139 | (syshandler_t) sys_ipc_forward_fast, |
140 | sys_ipc_wait_for_call, |
140 | (syshandler_t) sys_ipc_wait_for_call, |
141 | sys_ipc_hangup, |
141 | (syshandler_t) sys_ipc_hangup, |
142 | sys_ipc_register_irq, |
142 | (syshandler_t) sys_ipc_register_irq, |
143 | sys_ipc_unregister_irq, |
143 | (syshandler_t) sys_ipc_unregister_irq, |
144 | 144 | ||
145 | /* Capabilities related syscalls. */ |
145 | /* Capabilities related syscalls. */ |
146 | sys_cap_grant, |
146 | (syshandler_t) sys_cap_grant, |
147 | sys_cap_revoke, |
147 | (syshandler_t) sys_cap_revoke, |
148 | 148 | ||
149 | /* DDI related syscalls. */ |
149 | /* DDI related syscalls. */ |
150 | sys_physmem_map, |
150 | (syshandler_t) sys_physmem_map, |
151 | sys_iospace_enable, |
151 | (syshandler_t) sys_iospace_enable, |
152 | sys_preempt_control, |
152 | (syshandler_t) sys_preempt_control, |
153 | 153 | ||
154 | /* Sysinfo syscalls */ |
154 | /* Sysinfo syscalls */ |
155 | sys_sysinfo_valid, |
155 | (syshandler_t) sys_sysinfo_valid, |
156 | sys_sysinfo_value, |
156 | (syshandler_t) sys_sysinfo_value, |
157 | 157 | ||
158 | /* Debug calls */ |
158 | /* Debug calls */ |
159 | sys_debug_enable_console |
159 | (syshandler_t) sys_debug_enable_console |
160 | }; |
160 | }; |
161 | 161 | ||
162 | /** @} |
162 | /** @} |
163 | */ |
163 | */ |