Changeset e91ab8c in rtems


Ignore:
Timestamp:
05/19/14 20:25:15 (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
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)
Message:

cpusetimpl.h: Add _CPU_set_Set() and improve Doxygen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/include/rtems/score/cpusetimpl.h

    r8e7db68c re91ab8c  
    11/**
    2  *  @file  rtems/score/cpusetimpl.h
     2 *  @file
    33 *
    4  *  @brief Implementation Prototypes for CPU Set
     4 *  @brief Implementation Helper for CPU Set
    55 *
    6  *  This file contains the implementation prototypes for
     6 *  This file contains the implementation helpers inlines and prototypes for
    77 *  CPU set methods.
    88 */
     
    3232
    3333/**
    34  * _CPU_set_Is_valid
     34 * @brief Determine If the CPU Set if Valid
    3535 *
    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
    3944 */
    4045bool _CPU_set_Is_valid( const cpu_set_t *cpuset, size_t setsize );
    4146
    4247/**
    43  * _CPU_set_Show
     48 * @brief Print the CPU Set
    4449 *
    4550 * 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
    4655 */
    47 void _CPU_set_Show( const char *description, const cpu_set_t   *cpuset);
     56void _CPU_set_Show( const char *description, const cpu_set_t  *cpuset);
    4857
    4958/**
    50  * _CPU_set_Show_default
     59 * @brief Print the Default CPU Set
    5160 *
    5261 * This routine will print the value of the default cpuset.
     62 *
     63 * @param[in] description is a string to print before the value.
    5364 */
    5465void _CPU_set_Show_default( const char *description );
    5566
    5667/**
    57  * _CPU_set_Default
     68 * @brief Obtain the Default CPU Set
    5869 *
    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.
    6173 */
    6274const CPU_set_Control *_CPU_set_Default(void);
    6375
    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 */
     84RTEMS_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 */
     99RTEMS_INLINE_ROUTINE bool _CPU_set_Is_large_enough(
     100  size_t setsize
    66101)
    67102{
    68   return cpusetsize * CHAR_BIT;
     103  return _CPU_set_Maximum_CPU_count( setsize ) >= _SMP_Get_processor_count();
    69104}
    70105
    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 */
     115static inline void _CPU_set_Set(
     116  size_t           setsize,
     117  cpu_set_t       *cpuset,
     118  CPU_set_Control *set
    73119)
    74120{
    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 );
    77124}
    78 
    79125#endif
    80126
    81127/**
    82  * _CPU_set_Handler_initialization
     128 * @brief Initialize the CPU Set Handler
    83129 *
    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.
    87132 */
    88 
    89133#if __RTEMS_HAVE_SYS_CPUSET_H__ && defined( RTEMS_SMP )
    90134void _CPU_set_Handler_initialization(void);
Note: See TracChangeset for help on using the changeset viewer.