diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-03-25 02:34:12 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-03-25 02:34:12 +0000 |
commit | 27cf67733936abd75fcb1f8da765977cd75906ee (patch) | |
tree | f894211a8a0c77b402dd3250b2bee2d17dcfe13f /apps/codecs.h | |
parent | bc2f8fd8f38a3e010cd67bbac358f6e9991153c6 (diff) | |
download | rockbox-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/codecs.h')
-rw-r--r-- | apps/codecs.h | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/apps/codecs.h b/apps/codecs.h index ad6b831b61..fb5675fd84 100644 --- a/apps/codecs.h +++ b/apps/codecs.h | |||
@@ -80,12 +80,12 @@ | |||
80 | #define CODEC_ENC_MAGIC 0x52454E43 /* RENC */ | 80 | #define CODEC_ENC_MAGIC 0x52454E43 /* RENC */ |
81 | 81 | ||
82 | /* increase this every time the api struct changes */ | 82 | /* increase this every time the api struct changes */ |
83 | #define CODEC_API_VERSION 22 | 83 | #define CODEC_API_VERSION 23 |
84 | 84 | ||
85 | /* update this to latest version if a change to the api struct breaks | 85 | /* update this to latest version if a change to the api struct breaks |
86 | backwards compatibility (and please take the opportunity to sort in any | 86 | backwards compatibility (and please take the opportunity to sort in any |
87 | new function which are "waiting" at the end of the function table) */ | 87 | new function which are "waiting" at the end of the function table) */ |
88 | #define CODEC_MIN_API_VERSION 22 | 88 | #define CODEC_MIN_API_VERSION 23 |
89 | 89 | ||
90 | /* codec return codes */ | 90 | /* codec return codes */ |
91 | enum codec_status { | 91 | enum codec_status { |
@@ -118,6 +118,9 @@ struct codec_api { | |||
118 | /* If seek_time != 0, codec should seek to that song position (in ms) | 118 | /* If seek_time != 0, codec should seek to that song position (in ms) |
119 | if codec supports seeking. */ | 119 | if codec supports seeking. */ |
120 | long seek_time; | 120 | long seek_time; |
121 | |||
122 | /* The dsp instance to be used for audio output */ | ||
123 | struct dsp_config *dsp; | ||
121 | 124 | ||
122 | /* Returns buffer to malloc array. Only codeclib should need this. */ | 125 | /* Returns buffer to malloc array. Only codeclib should need this. */ |
123 | void* (*get_codec_memory)(size_t *size); | 126 | void* (*get_codec_memory)(size_t *size); |
@@ -160,6 +163,28 @@ struct codec_api { | |||
160 | void (*PREFIX(sleep))(int ticks); | 163 | void (*PREFIX(sleep))(int ticks); |
161 | void (*yield)(void); | 164 | void (*yield)(void); |
162 | 165 | ||
166 | #if NUM_CORES > 1 | ||
167 | struct thread_entry * | ||
168 | (*create_thread)(void (*function)(void), void* stack, | ||
169 | size_t stack_size, unsigned flags, const char *name | ||
170 | IF_PRIO(, int priority) | ||
171 | IF_COP(, unsigned int core)); | ||
172 | |||
173 | void (*thread_thaw)(struct thread_entry *thread); | ||
174 | void (*thread_wait)(struct thread_entry *thread); | ||
175 | void (*semaphore_init)(struct semaphore *s, int max, int start); | ||
176 | void (*semaphore_wait)(struct semaphore *s); | ||
177 | void (*semaphore_release)(struct semaphore *s); | ||
178 | void (*event_init)(struct event *e, unsigned int flags); | ||
179 | void (*event_wait)(struct event *e, unsigned int for_state); | ||
180 | void (*event_set_state)(struct event *e, unsigned int state); | ||
181 | #endif /* NUM_CORES */ | ||
182 | |||
183 | #ifdef CACHE_FUNCTIONS_AS_CALL | ||
184 | void (*flush_icache)(void); | ||
185 | void (*invalidate_icache)(void); | ||
186 | #endif | ||
187 | |||
163 | /* strings and memory */ | 188 | /* strings and memory */ |
164 | char* (*strcpy)(char *dst, const char *src); | 189 | char* (*strcpy)(char *dst, const char *src); |
165 | char* (*strncpy)(char *dst, const char *src, size_t length); | 190 | char* (*strncpy)(char *dst, const char *src, size_t length); |
@@ -218,29 +243,6 @@ struct codec_api { | |||
218 | /* new stuff at the end, sort into place next time | 243 | /* new stuff at the end, sort into place next time |
219 | the API gets incompatible */ | 244 | the API gets incompatible */ |
220 | 245 | ||
221 | #ifdef CACHE_FUNCTIONS_AS_CALL | ||
222 | void (*flush_icache)(void); | ||
223 | void (*invalidate_icache)(void); | ||
224 | #endif | ||
225 | |||
226 | struct dsp_config *dsp; | ||
227 | |||
228 | #if NUM_CORES > 1 | ||
229 | struct thread_entry * | ||
230 | (*create_thread)(void (*function)(void), void* stack, | ||
231 | int stack_size, unsigned flags, const char *name | ||
232 | IF_PRIO(, int priority) | ||
233 | IF_COP(, unsigned int core)); | ||
234 | |||
235 | void (*thread_thaw)(struct thread_entry *thread); | ||
236 | void (*thread_wait)(struct thread_entry *thread); | ||
237 | void (*semaphore_init)(struct semaphore *s, int max, int start); | ||
238 | void (*semaphore_wait)(struct semaphore *s); | ||
239 | void (*semaphore_release)(struct semaphore *s); | ||
240 | void (*event_init)(struct event *e, unsigned int flags); | ||
241 | void (*event_wait)(struct event *e, unsigned int for_state); | ||
242 | void (*event_set_state)(struct event *e, unsigned int state); | ||
243 | #endif /* NUM_CORES */ | ||
244 | }; | 246 | }; |
245 | 247 | ||
246 | /* codec header */ | 248 | /* codec header */ |