summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/kernel.c3
-rw-r--r--uisimulator/sdl/thread-sdl.c13
2 files changed, 3 insertions, 13 deletions
diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c
index 17ca55a694..d67fb2b9f1 100644
--- a/uisimulator/sdl/kernel.c
+++ b/uisimulator/sdl/kernel.c
@@ -269,7 +269,6 @@ void queue_wait(struct event_queue *q, struct queue_event *ev)
269 { 269 {
270 do 270 do
271 { 271 {
272 cores[CURRENT_CORE].irq_level = oldlevel;
273 block_thread(&q->queue); 272 block_thread(&q->queue);
274 oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); 273 oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
275 } 274 }
@@ -304,7 +303,6 @@ void queue_wait_w_tmo(struct event_queue *q, struct queue_event *ev, int ticks)
304 303
305 if (q->read == q->write && ticks > 0) 304 if (q->read == q->write && ticks > 0)
306 { 305 {
307 cores[CURRENT_CORE].irq_level = oldlevel;
308 block_thread_w_tmo(&q->queue, ticks); 306 block_thread_w_tmo(&q->queue, ticks);
309 oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); 307 oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
310 } 308 }
@@ -379,7 +377,6 @@ intptr_t queue_send(struct event_queue *q, long id, intptr_t data)
379 377
380 wakeup_thread(&q->queue); 378 wakeup_thread(&q->queue);
381 379
382 cores[CURRENT_CORE].irq_level = oldlevel;
383 block_thread_no_listlock(spp); 380 block_thread_no_listlock(spp);
384 return thread_get_current()->retval; 381 return thread_get_current()->retval;
385 } 382 }
diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c
index b8297072f2..d1a8e60d01 100644
--- a/uisimulator/sdl/thread-sdl.c
+++ b/uisimulator/sdl/thread-sdl.c
@@ -135,8 +135,7 @@ bool thread_sdl_init(void *param)
135 running->name = "main"; 135 running->name = "main";
136 running->state = STATE_RUNNING; 136 running->state = STATE_RUNNING;
137 running->context.c = SDL_CreateCond(); 137 running->context.c = SDL_CreateCond();
138 cores[CURRENT_CORE].irq_level = STAY_IRQ_LEVEL; 138
139
140 if (running->context.c == NULL) 139 if (running->context.c == NULL)
141 { 140 {
142 fprintf(stderr, "Failed to create main condition variable\n"); 141 fprintf(stderr, "Failed to create main condition variable\n");
@@ -230,15 +229,9 @@ static void remove_from_list_l(struct thread_entry **list,
230 thread->l.next->l.prev = thread->l.prev; 229 thread->l.next->l.prev = thread->l.prev;
231} 230}
232 231
233static void run_blocking_ops(void) 232static inline void run_blocking_ops(void)
234{ 233{
235 int level = cores[CURRENT_CORE].irq_level; 234 set_irq_level(0);
236
237 if (level != STAY_IRQ_LEVEL)
238 {
239 cores[CURRENT_CORE].irq_level = STAY_IRQ_LEVEL;
240 set_irq_level(level);
241 }
242} 235}
243 236
244struct thread_entry *thread_get_current(void) 237struct thread_entry *thread_get_current(void)