diff options
Diffstat (limited to 'uisimulator/sdl/kernel.c')
-rw-r--r-- | uisimulator/sdl/kernel.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c index b9ffe0eefe..bfe6062450 100644 --- a/uisimulator/sdl/kernel.c +++ b/uisimulator/sdl/kernel.c | |||
@@ -32,8 +32,10 @@ int set_irq_level (int level) | |||
32 | return (_lv = level); | 32 | return (_lv = level); |
33 | } | 33 | } |
34 | 34 | ||
35 | void queue_init(struct event_queue *q) | 35 | void queue_init(struct event_queue *q, bool register_queue) |
36 | { | 36 | { |
37 | (void)register_queue; | ||
38 | |||
37 | q->read = 0; | 39 | q->read = 0; |
38 | q->write = 0; | 40 | q->write = 0; |
39 | } | 41 | } |
@@ -47,7 +49,7 @@ void queue_wait(struct event_queue *q, struct event *ev) | |||
47 | { | 49 | { |
48 | while(q->read == q->write) | 50 | while(q->read == q->write) |
49 | { | 51 | { |
50 | switch_thread(); | 52 | switch_thread(true, NULL); |
51 | } | 53 | } |
52 | 54 | ||
53 | *ev = q->events[(q->read++) & QUEUE_LENGTH_MASK]; | 55 | *ev = q->events[(q->read++) & QUEUE_LENGTH_MASK]; |
@@ -97,8 +99,11 @@ void queue_clear(struct event_queue* q) | |||
97 | q->write = 0; | 99 | q->write = 0; |
98 | } | 100 | } |
99 | 101 | ||
100 | void switch_thread (void) | 102 | void switch_thread(bool save_context, struct thread_entry **blocked_list) |
101 | { | 103 | { |
104 | (void)save_context; | ||
105 | (void)blocked_list; | ||
106 | |||
102 | yield (); | 107 | yield (); |
103 | } | 108 | } |
104 | 109 | ||
@@ -160,7 +165,7 @@ void mutex_init(struct mutex *m) | |||
160 | void mutex_lock(struct mutex *m) | 165 | void mutex_lock(struct mutex *m) |
161 | { | 166 | { |
162 | while(m->locked) | 167 | while(m->locked) |
163 | switch_thread(); | 168 | switch_thread(true, NULL); |
164 | m->locked = true; | 169 | m->locked = true; |
165 | } | 170 | } |
166 | 171 | ||