diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-13 13:37:06 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-05-16 11:44:12 +0200 |
commit | 6c2eedc7dd86898dceb9bbbe96b02d94cb468e01 (patch) | |
tree | 59237dda2a2eab59ceb8cc209a45d8c3b635ce09 /cpukit/sapi | |
parent | fstests/fsstatvfs: Fix end of test message (diff) | |
download | rtems-6c2eedc7dd86898dceb9bbbe96b02d94cb468e01.tar.bz2 |
smp: Add maximum_processors field to config
Delete rtems_configuration_get_smp_maximum_processors(). Delete
rtems_configuration_smp_maximum_processors variable. Add
maximum_processors field to rtems_configuration_table if RTEMS_SMP is
defined. Add rtems_configuration_get_maximum_processors().
Diffstat (limited to 'cpukit/sapi')
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 13 | ||||
-rw-r--r-- | cpukit/sapi/include/rtems/config.h | 19 | ||||
-rw-r--r-- | cpukit/sapi/src/exinit.c | 2 |
3 files changed, 23 insertions, 11 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index c15c8a385c..2bd1444c18 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -2360,22 +2360,15 @@ const rtems_libio_helper rtems_fs_init_helper = #if defined(RTEMS_MULTIPROCESSING) CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ #endif + #ifdef RTEMS_SMP + CONFIGURE_SMP_MAXIMUM_PROCESSORS + #endif }; #endif #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ #if defined(RTEMS_SMP) - /** - * Instantiate the variable which specifies the number of CPUs - * in an SMP configuration. - */ - #if defined(CONFIGURE_INIT) - uint32_t rtems_configuration_smp_maximum_processors = \ - CONFIGURE_SMP_MAXIMUM_PROCESSORS; - #else - extern uint32_t rtems_configuration_smp_maximum_processors; - #endif /* * Instantiate the Per CPU information based upon the user configuration. */ diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h index 58d2d92fb5..d483471264 100644 --- a/cpukit/sapi/include/rtems/config.h +++ b/cpukit/sapi/include/rtems/config.h @@ -230,6 +230,9 @@ typedef struct { #if defined(RTEMS_MULTIPROCESSING) rtems_multiprocessing_table *User_multiprocessing_table; #endif + #ifdef RTEMS_SMP + uint32_t maximum_processors; + #endif } rtems_configuration_table; /** @@ -335,6 +338,22 @@ extern const rtems_configuration_table Configuration; NULL #endif +/** + * @brief Returns the configured maximum count of processors. + * + * The actual number of processors available for the application will be less + * than or equal to the configured maximum count of processors. + * + * @return The configured maximum count of processors. + */ +#ifdef RTEMS_SMP + #define rtems_configuration_get_maximum_processors() \ + (Configuration.maximum_processors) +#else + #define rtems_configuration_get_maximum_processors() \ + 1 +#endif + #define rtems_configuration_get_rtems_api_configuration() \ (&Configuration_RTEMS_API) diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c index 34e80750dd..a0abe111ab 100644 --- a/cpukit/sapi/src/exinit.c +++ b/cpukit/sapi/src/exinit.c @@ -164,7 +164,7 @@ void rtems_initialize_data_structures(void) */ #if defined(RTEMS_SMP) _SMP_Processor_count = - bsp_smp_initialize( rtems_configuration_smp_maximum_processors ); + bsp_smp_initialize( rtems_configuration_get_maximum_processors() ); #endif _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING ); |