diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-06 11:11:59 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-31 08:29:42 +0200 |
commit | 79e2d9b65efa5bd70ff12373b2454027a35b9788 (patch) | |
tree | e313708d829af0f507d3c69fb51ab5b70a7adf27 /cpukit/score/include/rtems/score/percpu.h | |
parent | tests/fatal: Fix test names (diff) | |
download | rtems-79e2d9b65efa5bd70ff12373b2454027a35b9788.tar.bz2 |
score: Add per-CPU state function
Add _Per_CPU_State_wait_for_ready_to_start_multitasking(). Add new
fatal SMP error SMP_FATAL_SHUTDOWN_EARLY.
Diffstat (limited to 'cpukit/score/include/rtems/score/percpu.h')
-rw-r--r-- | cpukit/score/include/rtems/score/percpu.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 607de545d6..75ff3e2b4d 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -472,6 +472,45 @@ void _Per_CPU_State_change( Per_CPU_State new_state ); +/** + * @brief Waits for all other processors to enter the ready to start + * multitasking state with a timeout in microseconds. + * + * In case one processor enters the shutdown state, this function does not + * return and terminates the system with the SMP_FATAL_SHUTDOWN_EARLY fatal SMP + * error. + * + * This function should be called only in _CPU_SMP_Initialize() if required by + * the CPU port or BSP. + * + * @code + * uint32_t _CPU_SMP_Initialize(uint32_t configured_cpu_count) + * { + * uint32_t cnt = MIN(get_hardware_cpu_count(), configured_cpu_count); + * uint32_t timeout = 123456; + * + * do_some_stuff(); + * + * return _Per_CPU_State_wait_for_ready_to_start_multitasking(cnt, timeout); + * } + * @endcode + * + * In case the timeout expires the count of processors is reduced to reflect + * the set of processors which is actually available at this point in time. + * + * @param[in] processor_count The processor count is the minimum value of the + * configured count of processors and the processor count offered by the actual + * hardware. + * @param[in] timeout_in_us The timeout in microseconds. + * + * @return The count of processors available for the application in the system. + * This value is less than or equal to the processor count. + */ +uint32_t _Per_CPU_State_wait_for_ready_to_start_multitasking( + uint32_t processor_count, + uint32_t timeout_in_us +); + #endif /* defined( RTEMS_SMP ) */ /* |