source: mainline/contrib/arch/kernel/kernel.adl@ f1380b7

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since f1380b7 was f1380b7, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 7 years ago

style: Remove trailing whitespace on _all_ lines, including empty ones, remaining files.

  • Property mode set to 100644
File size: 8.0 KB
Line 
1/*****************************
2 * Kernel syscall interfaces *
3 *****************************/
4
5interface sys_kio {
6 /* Print using kernel facility */
7 sysarg_t sys_kio(int fd, const void *buf, size_t size);
8 protocol:
9 ?sys_kio*
10};
11
12interface sys_console {
13 /* Enable kernel console */
14 sysarg_t sys_debug_enable_console(void);
15
16 /* Disable kernel console */
17 sysarg_t sys_debug_disable_console(void);
18 protocol:
19 (
20 ?sys_debug_enable_console +
21 ?sys_debug_disable_console
22 )*
23};
24
25interface sys_thread {
26 /* Create new thread */
27 sysarg_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, size_t name_len, thread_id_t *uspace_thread_id);
28
29 /* Terminate current thread */
30 sysarg_t sys_thread_exit(int uspace_status);
31
32 /* Get current thread id */
33 sysarg_t sys_thread_get_id(thread_id_t *uspace_thread_id);
34 protocol:
35 (
36 ?sys_thread_create +
37 ?sys_thread_get_id +
38 ?sys_thread_exit
39 )*
40};
41
42interface sys_task {
43 /* Set name fo the current task */
44 sysarg_t sys_task_set_name(const char *uspace_name, size_t name_len);
45
46 /* Get current task id */
47 sysarg_t sys_task_get_id(task_id_t *uspace_task_id);
48 protocol:
49 (
50 ?sys_task_set_name +
51 ?sys_task_get_id
52 )*
53};
54
55interface sys_program {
56 /* Spawn a new instance of clonable loader service */
57 sysarg_t sys_program_spawn_loader(char *uspace_name, size_t name_len);
58 protocol:
59 ?sys_program_spawn_loader*
60};
61
62interface sys_futex {
63 /* Sleep in a futex wait queue */
64 sysarg_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags);
65
66 /* Wakeup one thread waiting in futex wait queue */
67 sysarg_t sys_futex_wakeup(uintptr_t uaddr);
68 protocol:
69 (
70 ?sys_futex_sleep_timeout +
71 ?sys_futex_wakeup
72 )*
73};
74
75interface sys_smc {
76 /* Enforce self-modifying code cache coherency */
77 sysarg_t sys_smc_coherence(uintptr_t va, size_t size);
78 protocol:
79 ?sys_smc_coherence*
80};
81
82interface sys_as {
83 /* Create new address space area */
84 sysarg_t sys_as_area_create(uintptr_t address, size_t size, int flags);
85
86 /* Resize an address space area */
87 sysarg_t sys_as_area_resize(uinptr_t address, size_t size, int flags);
88
89 /* Change flags of an address space area */
90 sysarg_t sys_as_area_change_flags(uintptr_t address, int flags);
91
92 /* Destroy an address space area */
93 sysarg_t sys_as_area_destroy(uintptr_t address);
94 protocol:
95 (
96 ?sys_as_area_create +
97 ?sys_as_area_resize +
98 ?sys_as_area_change_flags +
99 ?sys_as_area_destroy
100 )*
101};
102
103interface sys_ipc {
104 /* Fast synchronous IPC call */
105 sysarg_t sys_ipc_call_sync_fast(sysarg_t phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, ipc_data_t *data);
106
107 /* Slow synchronous IPC call */
108 sysarg_t sys_ipc_call_sync_slow(sysarg_t phoneid, ipc_data_t *question, ipc_data_t *answer);
109
110 /* Fast asynchronous IPC call */
111 sysarg_t sys_ipc_call_async_fast(sysarg_t phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4);
112
113 /* Slow asynchronous IPC call */
114 sysarg_t sys_ipc_call_async_slow(sysarg_t phoneid, ipc_data_t *data);
115
116 /* Fast forward a received IPC call to another destination */
117 sysarg_t sys_ipc_forward_fast(sysarg_t callid, sysarg_t phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2, int mode);
118
119 /* Slow forward a received IPC call to another destination */
120 sysarg_t sys_ipc_forward_slow(sysarg_t callid, sysarg_t phoneid, ipc_data_t *data, int mode);
121
122 /* Fast answer an IPC call */
123 sysarg_t sys_ipc_answer_fast(sysarg_t callid, sysarg_t retval, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4);
124
125 /* Slow answer an IPC call */
126 sysarg_t sys_ipc_answer_slow(sysarg_t callid, ipc_data_t *data);
127
128 /* Hang up a phone */
129 sysarg_t sys_ipc_hangup(int phoneid);
130
131 /* Wait for an incoming IPC call or answer */
132 sysarg_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int flags);
133
134 /* Interrupt one thread of the current task from waiting on IPC call */
135 sysarg_t sys_ipc_poke(void);
136 protocol:
137 (
138 ?sys_ipc_call_sync_fast +
139 ?sys_ipc_call_sync_slow +
140 ?sys_ipc_call_async_fast +
141 ?sys_ipc_call_async_slow +
142 ?sys_ipc_forward_fast +
143 ?sys_ipc_forward_slow +
144 ?sys_ipc_answer_fast +
145 ?sys_ipc_answer_slow +
146 ?sys_ipc_hangup +
147 ?sys_ipc_wait_for_call +
148 ?sys_ipc_poke
149 )*
150};
151
152interface sys_event {
153 /* Subscribe to kernel event notifications */
154 sysarg_t sys_event_subscribe(sysarg_t evno, sysarg_t method);
155 protocol:
156 ?sys_event_subscribe*
157};
158
159interface sys_cap {
160 /* Grant capabilities to a task */
161#ifdef __32_BITS__
162 sysarg_t sys_cap_grant(sysarg64_t *uspace_taskid, cap_t caps);
163#endif
164
165#ifdef __64_BITS__
166 sysarg_t sys_cap_grant(sysarg_t taskid, cap_t caps);
167#endif
168
169 /* Revoke capabilities from a task */
170#ifdef __32_BITS__
171 sysarg_t sys_cap_revoke(sysarg64_t *uspace_taskid, cap_t caps);
172#endif
173
174#ifdef __64_BITS__
175 sysarg_t sys_cap_revoke(sysarg_t taskid, cap_t caps);
176#endif
177 protocol:
178 (
179 ?sys_cap_grant +
180 ?sys_cap_rewoke
181 )*
182};
183
184interface sys_ddi {
185 /* Enable access I/O address space for the current task */
186 sysarg_t sys_enable_iospace(ddi_ioarg_t *uspace_io_arg);
187
188 /* Map physical memory to the current task's address space */
189 sysarg_t sys_physmem_map(sysarg_t phys_base, sysarg_t virt_base, sysarg_t pages, sysarg_t flags);
190
191 /* Enable or disable preemption */
192 sysarg_t sys_preempt_control(int enable);
193
194 /* Assign unique device number */
195 sysarg_t sys_device_assign_devno(void);
196
197 /* Connect an IRQ handler to the current task */
198 sysarg_t sys_register_irq(inr_t inr, devno_t devno, sysarg_t method, irq_code_t *ucode);
199
200 /* Disconnect an IRQ handler from the current task */
201 sysarg_t sys_unregister_irq(inr_t inr, devno_t devno);
202 protocol:
203 (
204 ?sys_enable_iospace +
205 ?sys_physmem_map +
206 ?sys_device_assign_devno +
207 ?sys_preempt_control +
208 ?sys_register_irq +
209 ?sys_unregister_irq
210 )*
211};
212
213interface sys_sysinfo {
214 /* Check for sysinfo key validity */
215 sysarg_t sys_sysinfo_valid(sysarg_t ptr, sysarg_t len);
216
217 /* Get sysinfo key value */
218 sysarg_t sys_sysinfo_value(unatice_t ptr, sysarg_t len);
219 protocol:
220 (
221 ?sys_sysinfo_valid +
222 ?sys_sysinfo_value
223 )*
224};
225
226interface sys_debug {
227 /* Connect to the kernel debugging answerbox of a given task */
228#ifdef __32_BITS__
229 sysarg_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid);
230#endif
231
232#ifdef __64_BITS__
233 sysarg_t sys_ipc_connect_kbox(sysarg_t taskid);
234#endif
235 protocol:
236 ?sys_ipc_connect_kbox*
237};
238
239
240/*****************************************************
241 * Primitive kernel components (exported subsystems) *
242 *****************************************************/
243
244frame sys_console {
245 provides:
246 sys_kio sys_kio;
247 sys_console sys_console;
248};
249
250frame sys_proc {
251 provides:
252 sys_tls sys_tls;
253 sys_thread sys_thread;
254 sys_task sys_task;
255 sys_program sys_program;
256};
257
258frame sys_synch {
259 provides:
260 sys_futex sys_futex;
261 sys_smc sys_smc;
262};
263
264frame sys_mm {
265 provides:
266 sys_as sys_as;
267};
268
269frame sys_ipc {
270 provides:
271 sys_ipc sys_ipc;
272 sys_event sys_event;
273};
274
275frame sys_security {
276 provides:
277 sys_cap sys_cap;
278};
279
280frame sys_ddi {
281 provides:
282 sys_ddi sys_ddi;
283};
284
285frame sys_sysinfo {
286 provides:
287 sys_sysinfo sys_sysinfo;
288};
289
290frame sys_debug {
291 provides:
292 sys_debug sys_debug;
293};
294
295
296/******************************
297 * Composite kernel component *
298 ******************************/
299
300architecture kernel {
301 inst sys_console sys_console;
302 inst sys_proc sys_proc;
303 inst sys_synch sys_synch;
304 inst sys_mm sys_mm;
305 inst sys_ipc sys_ipc;
306 inst sys_security sys_security;
307 inst sys_ddi sys_ddi;
308 inst sys_sysinfo sys_sysinfo;
309 inst sys_debug sys_debug;
310
311 delegate sys_kio to sys_console:sys_kio;
312 delegate sys_console to sys_console:sys_console;
313 delegate sys_tls to sys_proc:sys_tls;
314 delegate sys_thread to sys_proc:sys_thread;
315 delegate sys_task to sys_proc:sys_task;
316 delegate sys_program to sys_proc:sys_program;
317 delegate sys_futex to sys_synch:sys_futex;
318 delegate sys_smc to sys_synch:sys_smc;
319 delegate sys_as to sys_mm:sys_as;
320 delegate sys_ipc to sys_ipc:sys_ipc;
321 delegate sys_event to sys_ipc:sys_event;
322 delegate sys_cap to sys_security:sys_cap;
323 delegate sys_ddi to sys_ddi:sys_ddi;
324 delegate sys_sysinfo to sys_sysinfo:sys_sysinfo;
325 delegate sys_debug to sys_debug:sys_debug;
326};
Note: See TracBrowser for help on using the repository browser.