forked from Imagelibrary/rtems
@@ -139,9 +139,7 @@ rtems_isr Clock_isr(
|
||||
|
||||
if (!rtems_configuration_is_smp_enabled()) {
|
||||
while (
|
||||
_Thread_Heir == _Thread_Executing
|
||||
&& _Thread_Executing->Start.Entry.Kinds.Idle.entry
|
||||
== rtems_configuration_get_idle_task()
|
||||
_Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle
|
||||
) {
|
||||
ISR_lock_Context lock_context;
|
||||
|
||||
|
||||
@@ -132,8 +132,7 @@ void Clock_isr(void *arg_unused)
|
||||
#ifdef CLOCK_DRIVER_USE_FAST_IDLE
|
||||
do {
|
||||
tlib_tc_tick();
|
||||
} while ( _Thread_Executing == _Thread_Idle &&
|
||||
_Thread_Heir == _Thread_Executing);
|
||||
} while ( _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle );
|
||||
|
||||
return;
|
||||
|
||||
|
||||
@@ -37,11 +37,7 @@ static rtems_isr clockISR(rtems_vector_number vector) {
|
||||
#if CLOCK_DRIVER_USE_FAST_IDLE
|
||||
do {
|
||||
rtems_clock_tick();
|
||||
} while (
|
||||
_Thread_Heir == _Thread_Executing
|
||||
&& _Thread_Executing->Start.Entry.Kinds.Idle.entry
|
||||
== rtems_configuration_get_idle_task()
|
||||
);
|
||||
} while ( _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle );
|
||||
#else
|
||||
rtems_clock_tick();
|
||||
#endif
|
||||
|
||||
@@ -105,11 +105,7 @@ static void clockHandler(void)
|
||||
tb = ppc_time_base();
|
||||
rtems_timecounter_tick();
|
||||
|
||||
while (
|
||||
_Thread_Heir == _Thread_Executing
|
||||
&& _Thread_Executing->Start.Entry.Kinds.Idle.entry
|
||||
== rtems_configuration_get_idle_task()
|
||||
) {
|
||||
while ( _Thread_Heir == _Thread_Executing && _Thread_Executing->is_idle ) {
|
||||
tb += Clock_Decrementer_value;
|
||||
ppc_set_time_base( tb );
|
||||
rtems_timecounter_tick();
|
||||
|
||||
@@ -754,6 +754,8 @@ struct _Thread_Control {
|
||||
SMP_lock_Stats Potpourri_stats;
|
||||
#endif
|
||||
|
||||
/** This field is true if the thread is an idle thread. */
|
||||
bool is_idle;
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
/** This field is true if the thread is offered globally */
|
||||
bool is_global;
|
||||
|
||||
@@ -72,6 +72,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
|
||||
cpu->heir =
|
||||
cpu->executing = idle;
|
||||
|
||||
idle->is_idle = true;
|
||||
idle->Start.Entry.adaptor = _Thread_Entry_adaptor_idle;
|
||||
idle->Start.Entry.Kinds.Idle.entry = rtems_configuration_get_idle_task();
|
||||
|
||||
|
||||
@@ -173,18 +173,12 @@ bool interrupt_critical_section_test_support_delay(void)
|
||||
return interrupt_critical_busy_wait();
|
||||
}
|
||||
|
||||
static bool is_idle( const Thread_Control *thread )
|
||||
{
|
||||
return thread->Start.Entry.Kinds.Idle.entry
|
||||
== rtems_configuration_get_idle_task();
|
||||
}
|
||||
|
||||
static void thread_switch( Thread_Control *executing, Thread_Control *heir )
|
||||
{
|
||||
(void) executing;
|
||||
(void) heir;
|
||||
|
||||
if ( interrupt_critical.t1 == 0 && is_idle( heir ) ) {
|
||||
if ( interrupt_critical.t1 == 0 && heir->is_idle ) {
|
||||
interrupt_critical.t1 = rtems_clock_get_uptime_nanoseconds();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user