summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-03-25 02:34:12 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-03-25 02:34:12 +0000
commit27cf67733936abd75fcb1f8da765977cd75906ee (patch)
treef894211a8a0c77b402dd3250b2bee2d17dcfe13f /apps/plugin.h
parentbc2f8fd8f38a3e010cd67bbac358f6e9991153c6 (diff)
downloadrockbox-27cf67733936abd75fcb1f8da765977cd75906ee.tar.gz
rockbox-27cf67733936abd75fcb1f8da765977cd75906ee.zip
Add a complete priority inheritance implementation to the scheduler (all mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index cd426564ba..57624739c7 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -119,12 +119,12 @@
119#define PLUGIN_MAGIC 0x526F634B /* RocK */ 119#define PLUGIN_MAGIC 0x526F634B /* RocK */
120 120
121/* increase this every time the api struct changes */ 121/* increase this every time the api struct changes */
122#define PLUGIN_API_VERSION 100 122#define PLUGIN_API_VERSION 101
123 123
124/* update this to latest version if a change to the api struct breaks 124/* update this to latest version if a change to the api struct breaks
125 backwards compatibility (and please take the opportunity to sort in any 125 backwards compatibility (and please take the opportunity to sort in any
126 new function which are "waiting" at the end of the function table) */ 126 new function which are "waiting" at the end of the function table) */
127#define PLUGIN_MIN_API_VERSION 100 127#define PLUGIN_MIN_API_VERSION 101
128 128
129/* plugin return codes */ 129/* plugin return codes */
130enum plugin_status { 130enum plugin_status {
@@ -351,19 +351,16 @@ struct plugin_api {
351 /* kernel/ system */ 351 /* kernel/ system */
352 void (*PREFIX(sleep))(int ticks); 352 void (*PREFIX(sleep))(int ticks);
353 void (*yield)(void); 353 void (*yield)(void);
354#ifdef HAVE_PRIORITY_SCHEDULING
355 void (*priority_yield)(void);
356#endif
357 volatile long* current_tick; 354 volatile long* current_tick;
358 long (*default_event_handler)(long event); 355 long (*default_event_handler)(long event);
359 long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter); 356 long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter);
360 struct thread_entry* threads; 357 struct thread_entry* threads;
361 struct thread_entry* (*create_thread)(void (*function)(void), void* stack, 358 struct thread_entry* (*create_thread)(void (*function)(void), void* stack,
362 int stack_size, unsigned flags, 359 size_t stack_size, unsigned flags,
363 const char *name 360 const char *name
364 IF_PRIO(, int priority) 361 IF_PRIO(, int priority)
365 IF_COP(, unsigned int core)); 362 IF_COP(, unsigned int core));
366 void (*remove_thread)(struct thread_entry *thread); 363 void (*thread_exit)(void);
367 void (*thread_wait)(struct thread_entry *thread); 364 void (*thread_wait)(struct thread_entry *thread);
368#if CONFIG_CODEC == SWCODEC 365#if CONFIG_CODEC == SWCODEC
369 void (*mutex_init)(struct mutex *m); 366 void (*mutex_init)(struct mutex *m);
@@ -405,7 +402,8 @@ struct plugin_api {
405 int ticks); 402 int ticks);
406#if CONFIG_CODEC == SWCODEC 403#if CONFIG_CODEC == SWCODEC
407 void (*queue_enable_queue_send)(struct event_queue *q, 404 void (*queue_enable_queue_send)(struct event_queue *q,
408 struct queue_sender_list *send); 405 struct queue_sender_list *send,
406 struct thread_entry *owner);
409 bool (*queue_empty)(const struct event_queue *q); 407 bool (*queue_empty)(const struct event_queue *q);
410 void (*queue_wait)(struct event_queue *q, struct queue_event *ev); 408 void (*queue_wait)(struct event_queue *q, struct queue_event *ev);
411 intptr_t (*queue_send)(struct event_queue *q, long id, 409 intptr_t (*queue_send)(struct event_queue *q, long id,