bug fix for flag_sched_rr

This commit is contained in:
NIIBE Yutaka
2013-06-06 14:44:54 +09:00
parent c838e3f0e9
commit 0b46ccbae1
2 changed files with 2 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
* entry.c: Include sys.h for clock_init and gpio_init. * entry.c: Include sys.h for clock_init and gpio_init.
* chopstx.c (PREEMPTION_USEC): Fix the value. * chopstx.c (PREEMPTION_USEC): Fix the value.
(sched): Check tp != NULL to see flag_sched_rr.
2013-06-05 Niibe Yutaka <gniibe@fsij.org> 2013-06-05 Niibe Yutaka <gniibe@fsij.org>

View File

@@ -357,7 +357,7 @@ sched (void)
register struct chx_thread *tp asm ("r0"); register struct chx_thread *tp asm ("r0");
tp = chx_ready_pop (); tp = chx_ready_pop ();
if (tp->flag_sched_rr) if (tp && tp->flag_sched_rr)
{ {
chx_spin_lock (&q_timer.lock); chx_spin_lock (&q_timer.lock);
chx_timer_insert (tp, PREEMPTION_USEC); chx_timer_insert (tp, PREEMPTION_USEC);