RTEMS CPU Kit with SuperCore  4.11.2
cpusetimpl.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 2014.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_SCORE_CPUSETIMPL_H
20 #define _RTEMS_SCORE_CPUSETIMPL_H
21 
22 #include <rtems/score/cpuset.h>
23 #include <rtems/score/smp.h>
24 
25 #include <limits.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #ifdef __RTEMS_HAVE_SYS_CPUSET_H__
32 
45 bool _CPU_set_Is_valid( const cpu_set_t *cpuset, size_t setsize );
46 
55 void _CPU_set_Show( const char *description, const cpu_set_t *cpuset);
56 
64 void _CPU_set_Show_default( const char *description );
65 
73 const CPU_set_Control *_CPU_set_Default(void);
74 
83 RTEMS_INLINE_ROUTINE size_t _CPU_set_Maximum_CPU_count( size_t setsize )
84 {
85  return setsize * CHAR_BIT;
86 }
87 
98 RTEMS_INLINE_ROUTINE bool _CPU_set_Is_large_enough(
99  size_t setsize
100 )
101 {
102  return _CPU_set_Maximum_CPU_count( setsize ) >= _SMP_Get_processor_count();
103 }
104 
114 static inline void _CPU_set_Set(
115  size_t setsize,
116  cpu_set_t *cpuset,
117  CPU_set_Control *set
118 )
119 {
120  set->set = &set->preallocated;
121  set->setsize = setsize;
122  CPU_COPY( set->set, cpuset );
123 }
124 #endif
125 
132 #if __RTEMS_HAVE_SYS_CPUSET_H__ && defined( RTEMS_SMP )
134 #else
135 #define _CPU_set_Handler_initialization() do { } while ( 0 )
136 #endif
137 
140 #ifdef __cplusplus
141 }
142 #endif
143 #endif
144 /* end of include file */
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
Information About the CPU Set.
SuperCore SMP Support API.
#define _CPU_set_Handler_initialization()
Initialize the CPU Set Handler.
Definition: cpusetimpl.h:135