[PATCH 1/3] Optional CPU Set Handler initialization
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Dec 11 07:59:31 UTC 2015
Update #2408.
---
cpukit/sapi/src/exinit.c | 3 ---
cpukit/score/include/rtems/score/cpusetimpl.h | 12 ------------
cpukit/score/include/rtems/sysinit.h | 1 +
cpukit/score/src/cpuset.c | 9 ++++++++-
doc/user/init.t | 4 ++++
5 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
index 1f482f0..08249dd 100644
--- a/cpukit/sapi/src/exinit.c
+++ b/cpukit/sapi/src/exinit.c
@@ -37,7 +37,6 @@
#include <rtems/score/apiext.h>
#include <rtems/score/apimutex.h>
#include <rtems/score/copyrt.h>
-#include <rtems/score/cpusetimpl.h>
#include <rtems/score/heap.h>
#include <rtems/score/interr.h>
#include <rtems/score/isr.h>
@@ -127,8 +126,6 @@ static void rtems_initialize_data_structures(void)
_SMP_Handler_initialize();
- _CPU_set_Handler_initialization();
-
/* MANAGERS */
_RTEMS_API_Initialize();
diff --git a/cpukit/score/include/rtems/score/cpusetimpl.h b/cpukit/score/include/rtems/score/cpusetimpl.h
index 226c3a1..f9a0f0f 100644
--- a/cpukit/score/include/rtems/score/cpusetimpl.h
+++ b/cpukit/score/include/rtems/score/cpusetimpl.h
@@ -123,18 +123,6 @@ static inline void _CPU_set_Set(
}
#endif
-/**
- * @brief Initialize the CPU Set Handler
- *
- * This routine validates a cpuset sets at least one valid cpu and that
- * it does not set any invalid cpus.
- */
-#if __RTEMS_HAVE_SYS_CPUSET_H__ && defined( RTEMS_SMP )
-void _CPU_set_Handler_initialization(void);
-#else
-#define _CPU_set_Handler_initialization() do { } while ( 0 )
-#endif
-
/**@}*/
#ifdef __cplusplus
diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h
index 855198d..f870613 100644
--- a/cpukit/score/include/rtems/sysinit.h
+++ b/cpukit/score/include/rtems/sysinit.h
@@ -29,6 +29,7 @@ extern "C" {
#define RTEMS_SYSINIT_BSP_WORK_AREAS 000100
#define RTEMS_SYSINIT_BSP_START 000200
#define RTEMS_SYSINIT_DATA_STRUCTURES 000300
+#define RTEMS_SYSINIT_CPU_SET 00030c
#define RTEMS_SYSINIT_BSP_LIBC 000400
#define RTEMS_SYSINIT_BEFORE_DRIVERS 000500
#define RTEMS_SYSINIT_BSP_PRE_DRIVERS 000600
diff --git a/cpukit/score/src/cpuset.c b/cpukit/score/src/cpuset.c
index ca355c9..deb9e43 100644
--- a/cpukit/score/src/cpuset.c
+++ b/cpukit/score/src/cpuset.c
@@ -21,6 +21,7 @@
#ifdef __RTEMS_HAVE_SYS_CPUSET_H__
#include <sys/cpuset.h>
+#include <rtems/sysinit.h>
#include <rtems/score/cpusetimpl.h>
#include <rtems/score/assert.h>
#include <rtems/score/percpu.h>
@@ -30,7 +31,7 @@ static CPU_set_Control cpuset_default;
/*
* _CPU_set_Handler_initialization
*/
-void _CPU_set_Handler_initialization()
+static void _CPU_set_Handler_initialization()
{
uint32_t cpu_count;
uint32_t cpu_index;
@@ -50,6 +51,12 @@ void _CPU_set_Handler_initialization()
CPU_SET_S( (int) cpu_index, cpuset_default.setsize, cpuset_default.set );
}
+RTEMS_SYSINIT_ITEM(
+ _CPU_set_Handler_initialization,
+ RTEMS_SYSINIT_CPU_SET,
+ RTEMS_SYSINIT_ORDER_MIDDLE
+);
+
/**
* _CPU_set_Is_valid
*
diff --git a/doc/user/init.t b/doc/user/init.t
index c5ebc0d..fdd37e4 100644
--- a/doc/user/init.t
+++ b/doc/user/init.t
@@ -164,6 +164,10 @@ upon the information in the Configuration Table, User Initialization Tasks
Table, Device Driver Table, User Extension Table, Multiprocessor Configuration
Table, and the Multiprocessor Communications Interface (MPCI) Table.
+ at item RTEMS_SYSINIT_CPU_SET
+Initializes the global CPU set on SMP configurations in case the application
+uses this information.
+
@item RTEMS_SYSINIT_BSP_LIBC
Depending on the application configuration the IO library and root filesystem
is initialized. This step is mandatory.
--
1.8.4.5
More information about the devel
mailing list