Changeset e91ab8c in rtems
- Timestamp:
- 05/19/14 20:25:15 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 6ddc4da
- Parents:
- 8e7db68c
- git-author:
- Joel Sherrill <joel.sherrill@…> (05/19/14 20:25:15)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (05/30/14 20:07:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/score/include/rtems/score/cpusetimpl.h
r8e7db68c re91ab8c 1 1 /** 2 * @file rtems/score/cpusetimpl.h2 * @file 3 3 * 4 * @brief Implementation Prototypesfor CPU Set4 * @brief Implementation Helper for CPU Set 5 5 * 6 * This file contains the implementation prototypes for6 * This file contains the implementation helpers inlines and prototypes for 7 7 * CPU set methods. 8 8 */ … … 32 32 33 33 /** 34 * _CPU_set_Is_valid34 * @brief Determine If the CPU Set if Valid 35 35 * 36 * This routine validates a cpuset size corresponds to 37 * the system correct size, that at least one 38 * valid cpu is set and that no invalid cpus are set. 36 * This routine validates a cpuset size corresponds to the system 37 * correct size, that at least one valid cpu is set and that no invalid 38 * cpus are set. 39 * 40 * @param[in] cpuset is the cpuset to validate 41 * @param[in] setsize is the number of CPUs in the cpuset 42 * 43 * @return true if the set is valid 39 44 */ 40 45 bool _CPU_set_Is_valid( const cpu_set_t *cpuset, size_t setsize ); 41 46 42 47 /** 43 * _CPU_set_Show48 * @brief Print the CPU Set 44 49 * 45 50 * This routine will print the value of the given cpuset. 51 * 52 * @param[in] description is a string to print before the value. 53 * @param[in] cpuset is the cpuset to validate 54 * @param[in] setsize is the number of CPUs in the cpuset 46 55 */ 47 void _CPU_set_Show( const char *description, const cpu_set_t 56 void _CPU_set_Show( const char *description, const cpu_set_t *cpuset); 48 57 49 58 /** 50 * _CPU_set_Show_default59 * @brief Print the Default CPU Set 51 60 * 52 61 * This routine will print the value of the default cpuset. 62 * 63 * @param[in] description is a string to print before the value. 53 64 */ 54 65 void _CPU_set_Show_default( const char *description ); 55 66 56 67 /** 57 * _CPU_set_Default68 * @brief Obtain the Default CPU Set 58 69 * 59 * This routine returns the default cpuset for 60 * this system. 70 * This routine returns the default cpuset for this system. 71 * 72 * @return a pointer to the default cpuset. 61 73 */ 62 74 const CPU_set_Control *_CPU_set_Default(void); 63 75 64 RTEMS_INLINE_ROUTINE size_t _CPU_set_Maximum_CPU_count( 65 size_t cpusetsize 76 /** 77 * @brief Obtain the Maximum Number of CPUs Representable in CPU Set 78 * 79 * This routine returns maximum number of CPUs that can be represented 80 * in the @a setsize specified. 81 * 82 * @return the number of representable cores in the cpuset 83 */ 84 RTEMS_INLINE_ROUTINE size_t _CPU_set_Maximum_CPU_count( size_t setsize ) 85 { 86 return setsize * CHAR_BIT; 87 } 88 89 /** 90 * @brief Is this CPU Set Large Enough? 91 * 92 * This method can be used to determine if a particular cpuset is 93 * large enough for the number of CPUs in the system. 94 * 95 * @param[in] setsize is the number of CPUs in the cpuset 96 * 97 * @return true if the @a setsize is sufficient 98 */ 99 RTEMS_INLINE_ROUTINE bool _CPU_set_Is_large_enough( 100 size_t setsize 66 101 ) 67 102 { 68 return cpusetsize * CHAR_BIT;103 return _CPU_set_Maximum_CPU_count( setsize ) >= _SMP_Get_processor_count(); 69 104 } 70 105 71 RTEMS_INLINE_ROUTINE bool _CPU_set_Is_large_enough( 72 size_t cpusetsize 106 /** 107 * @brief Fill in CPU_set_Control 108 * 109 * This method fills in a CPU_set_Control based upon a cpu_set_t and 110 * size information. 111 * 112 * @param[in] cpuset is the cpuset to validate 113 * @param[in] setsize is the number of CPUs in the cpuset 114 */ 115 static inline void _CPU_set_Set( 116 size_t setsize, 117 cpu_set_t *cpuset, 118 CPU_set_Control *set 73 119 ) 74 120 { 75 return _CPU_set_Maximum_CPU_count( cpusetsize ) 76 >= _SMP_Get_processor_count(); 121 set->set = &set->preallocated; 122 set->setsize = setsize; 123 CPU_COPY( set->set, cpuset ); 77 124 } 78 79 125 #endif 80 126 81 127 /** 82 * _CPU_set_Handler_initialization128 * @brief Initialize the CPU Set Handler 83 129 * 84 * This routine validates a cpuset sets at least one 85 * valid cpu and that it does not set any invalid 86 * cpus. 130 * This routine validates a cpuset sets at least one valid cpu and that 131 * it does not set any invalid cpus. 87 132 */ 88 89 133 #if __RTEMS_HAVE_SYS_CPUSET_H__ && defined( RTEMS_SMP ) 90 134 void _CPU_set_Handler_initialization(void);
Note: See TracChangeset
for help on using the changeset viewer.