From 27cf67733936abd75fcb1f8da765977cd75906ee Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Tue, 25 Mar 2008 02:34:12 +0000 Subject: 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 --- apps/plugin.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'apps/plugin.h') diff --git a/apps/plugin.h b/apps/plugin.h index cd42656..5762473 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -119,12 +119,12 @@ #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 100 +#define PLUGIN_API_VERSION 101 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 100 +#define PLUGIN_MIN_API_VERSION 101 /* plugin return codes */ enum plugin_status { @@ -351,19 +351,16 @@ struct plugin_api { /* kernel/ system */ void (*PREFIX(sleep))(int ticks); void (*yield)(void); -#ifdef HAVE_PRIORITY_SCHEDULING - void (*priority_yield)(void); -#endif volatile long* current_tick; long (*default_event_handler)(long event); long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter); struct thread_entry* threads; struct thread_entry* (*create_thread)(void (*function)(void), void* stack, - int stack_size, unsigned flags, + size_t stack_size, unsigned flags, const char *name IF_PRIO(, int priority) IF_COP(, unsigned int core)); - void (*remove_thread)(struct thread_entry *thread); + void (*thread_exit)(void); void (*thread_wait)(struct thread_entry *thread); #if CONFIG_CODEC == SWCODEC void (*mutex_init)(struct mutex *m); @@ -405,7 +402,8 @@ struct plugin_api { int ticks); #if CONFIG_CODEC == SWCODEC void (*queue_enable_queue_send)(struct event_queue *q, - struct queue_sender_list *send); + struct queue_sender_list *send, + struct thread_entry *owner); bool (*queue_empty)(const struct event_queue *q); void (*queue_wait)(struct event_queue *q, struct queue_event *ev); intptr_t (*queue_send)(struct event_queue *q, long id, -- cgit v1.1