source: mainline/contrib/arch/kernel/kernel.adl@ 86018c1

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

streamline the behavior protocols
add support for initialization and finalization phase of protocols in ADL

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