static void start_thread_if_necessary(uint32_t cpu_index_self) { #if QORIQ_THREAD_COUNT > 1 uint32_t i; for (i = 1; i < QORIQ_THREAD_COUNT; ++i) { uint32_t cpu_index_next = cpu_index_self + i; if ( is_started_by_u_boot(cpu_index_self) && cpu_index_next < rtems_configuration_get_maximum_processors() && _SMP_Should_start_processor(cpu_index_next) ) { /* Thread Initial Next Instruction Address (INIA) */ PPC_SET_THREAD_MGMT_REGISTER(321, (uint32_t) _start_thread); /* Thread Initial Machine State (IMSR) */ PPC_SET_THREAD_MGMT_REGISTER(289, QORIQ_INITIAL_MSR); /* Thread Enable Set (TENS) */ PPC_SET_SPECIAL_PURPOSE_REGISTER(438, 1U << i); } } #endif }
bool _CPU_SMP_Start_processor(uint32_t cpu_index) { #if QORIQ_THREAD_COUNT > 1 if (is_started_by_u_boot(cpu_index)) { qoriq_start_spin_table *spin_table = get_spin_table(cpu_index); return release_processor(spin_table, cpu_index); } else { return _SMP_Should_start_processor(cpu_index - 1); } #else qoriq_start_spin_table *spin_table = get_spin_table(cpu_index); return release_processor(spin_table, cpu_index); #endif }
void _SMP_Start_multitasking_on_secondary_processor( void ) { Per_CPU_Control *self_cpu = _Per_CPU_Get(); uint32_t cpu_index_self = _Per_CPU_Get_index( self_cpu ); if ( cpu_index_self >= rtems_configuration_get_maximum_processors() ) { _SMP_Fatal( SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR ); } if ( !_SMP_Should_start_processor( cpu_index_self ) ) { _SMP_Fatal( SMP_FATAL_MULTITASKING_START_ON_UNASSIGNED_PROCESSOR ); } _Per_CPU_State_change( self_cpu, PER_CPU_STATE_READY_TO_START_MULTITASKING ); _Thread_Start_multitasking(); }
bool _CPU_SMP_Start_processor(uint32_t cpu_index) { #if QORIQ_THREAD_COUNT > 1 if (is_started_by_u_boot(cpu_index)) { uboot_spin_table *spin_table = &((uboot_spin_table *) SPIN_TABLE)[cpu_index / 2 - 1]; release_processor(spin_table, cpu_index); return true; } else { return _SMP_Should_start_processor(cpu_index - 1); } #else uboot_spin_table *spin_table = (uboot_spin_table *) SPIN_TABLE; release_processor(spin_table, cpu_index); return true; #endif }