summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-06-04 12:48:08 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-06-04 12:48:08 +0000
commitaaea587b5d6e44d8cab1ee9d96ff78448f962c42 (patch)
treef5e73b0512b8faaf364f90b887491bea0b47e343
parent80f8b22357d4997c2025bee4660f726f3049fe74 (diff)
downloadrockbox-aaea587b5d6e44d8cab1ee9d96ff78448f962c42.tar.gz
rockbox-aaea587b5d6e44d8cab1ee9d96ff78448f962c42.zip
Added some kernel docs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@886 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/API49
1 files changed, 49 insertions, 0 deletions
diff --git a/firmware/API b/firmware/API
index 52f4876af2..c74aa20b0d 100644
--- a/firmware/API
+++ b/firmware/API
@@ -201,6 +201,10 @@ Various
201 201
202 #include <kernel.h> 202 #include <kernel.h>
203 203
204 void kernel_init(void)
205
206 Inits the kernel and starts the tick interrupt
207
204 void sleep(ticks) 208 void sleep(ticks)
205 209
206 Sleep a specified number of ticks, we have HZ ticks per second. 210 Sleep a specified number of ticks, we have HZ ticks per second.
@@ -211,3 +215,48 @@ Various
211 for something or similar, and also if you do anything that takes "a long 215 for something or similar, and also if you do anything that takes "a long
212 time". This function is the entire foundation that our "cooperative 216 time". This function is the entire foundation that our "cooperative
213 multitasking" is based on. Use it. 217 multitasking" is based on. Use it.
218
219 int set_irq_level(int level)
220
221 Sets the interrupt level (0 = lowest, 15 = highest) and returns the
222 previous level.
223
224 void queue_init(struct event_queue *q)
225
226 Initialize an event queue. The maximum number of events in a queue is
227 QUEUE_LENGTH-1.
228
229 void queue_wait(struct event_queue *q, struct event *ev)
230
231 Receive an event in a queue, blocking the thread if the queue is empty.
232
233 void queue_post(struct event_queue *q, int id, void *data)
234
235 Post an event to a queue.
236
237 bool queue_empty(struct event_queue* q)
238
239 Returns true if the queue is empty.
240
241 int tick_add_task(void (*f)(void))
242
243 Add a task to the tick task queue. The argument is a pointer to a
244 function that will be called every tick interrupt.
245 At most MAX_NUM_TICK_TASKS can be active at the same time.
246
247 int tick_remove_task(void (*f)(void))
248
249 Remove a task from the task queue.
250
251 void mutex_init(struct mutex *m)
252
253 Initialize a mutex.
254
255 void mutex_lock(struct mutex *m)
256
257 Lock a mutex. This will block the thread if the mutex is already locked.
258 Note that you will geta deadlock if you lock the mutex twice!
259
260void mutex_unlock(struct mutex *m)
261
262 Unlock a mutex.