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

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since cf7b3e0 was cf7b3e0, checked in by Martin Decky <martin@…>, 16 years ago

various fixes and cleanup

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