diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-03-03 13:45:50 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-03-04 08:43:45 +0100 |
commit | 8b73ee50238d5f22db792bf8cc573a001f52065f (patch) | |
tree | c2522f35266d86ca51c74daae66bab4f09c7bae0 /cpukit/include/rtems/rtems/tasks.h | |
parent | config: Remove <rtems/btimer.h> include (diff) | |
download | rtems-8b73ee50238d5f22db792bf8cc573a001f52065f.tar.bz2 |
rtems: rtems_scheduler_get_processor_maximum()
In uniprocessor configurations, use compile-time constants for
rtems_scheduler_get_processor_maximum() and
rtems_scheduler_get_processor(). This helps compilers and static
analyzers to deduce that some loop bodies are only executed once and
some conditional statements have a fixed outcome (may improve code
generation and reduce false positives).
In SMP configurations, directly provide the internal implementation for
performance reasons.
Diffstat (limited to '')
-rw-r--r-- | cpukit/include/rtems/rtems/tasks.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h index 3519bbf795..a4af236b6b 100644 --- a/cpukit/include/rtems/rtems/tasks.h +++ b/cpukit/include/rtems/rtems/tasks.h @@ -21,6 +21,7 @@ #include <rtems/rtems/attr.h> #include <rtems/rtems/status.h> #include <rtems/rtems/types.h> +#include <rtems/score/smp.h> #ifdef __cplusplus extern "C" { @@ -600,7 +601,7 @@ rtems_status_code rtems_scheduler_ident_by_processor_set( * * @return The index of the current processor. */ -uint32_t rtems_scheduler_get_processor( void ); +#define rtems_scheduler_get_processor() _SMP_Get_current_processor() /** * @brief Returns the index of the current processor. @@ -633,7 +634,7 @@ rtems_get_current_processor( void ) * * @see rtems_scheduler_add_processor() and rtems_scheduler_remove_processor(). */ -RTEMS_CONST uint32_t rtems_scheduler_get_processor_maximum( void ); +#define rtems_scheduler_get_processor_maximum() _SMP_Get_processor_maximum() /** * @brief Returns the processor maximum supported by the system. |