Changeset 5eb434e in rtems


Ignore:
Timestamp:
Apr 11, 2012, 1:04:22 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
45494d9c, ced0816
Parents:
8eb559d3
git-author:
Sebastian Huber <sebastian.huber@…> (04/11/12 13:04:22)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/11/12 13:24:39)
Message:

score: New macros and functions

New macros

o _Objects_Maximum_per_allocation(),
o rtems_resource_is_unlimited(), and
o rtems_resource_maximum_per_allocation().

New function

o _Objects_Is_unlimited().

Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/confdefs.h

    r8eb559d3 r5eb434e  
    955955 */
    956956#define _Configure_Max_Objects(_max) \
    957   ((_max) & ~RTEMS_UNLIMITED_OBJECTS)
     957  rtems_resource_maximum_per_allocation(_max)
    958958
    959959/**
  • cpukit/sapi/include/rtems/config.h

    r8eb559d3 r5eb434e  
    3737#define rtems_resource_unlimited(resource) \
    3838  ( resource | RTEMS_UNLIMITED_OBJECTS )
     39
     40#define rtems_resource_is_unlimited(resource) \
     41  _Objects_Is_unlimited(resource)
     42
     43#define rtems_resource_maximum_per_allocation(resource) \
     44  _Objects_Maximum_per_allocation(resource)
    3945
    4046/*
  • cpukit/score/inline/rtems/score/object.inl

    r8eb559d3 r5eb434e  
    353353}
    354354
     355/**
     356 *  Returns if the object maximum specifies unlimited objects.
     357 *
     358 *  @param[in] maximum The object maximum specification.
     359 *
     360 *  @retval true Unlimited objects are available.
     361 *  @retval false The object count is fixed.
     362 */
     363RTEMS_INLINE_ROUTINE bool _Objects_Is_unlimited( uint32_t maximum )
     364{
     365  return (maximum & OBJECTS_UNLIMITED_OBJECTS) != 0;
     366}
     367
     368/*
     369 * We cannot use an inline function for this since it may be evaluated at
     370 * compile time.
     371 */
     372#define _Objects_Maximum_per_allocation( maximum ) \
     373  ((Objects_Maximum) ((maximum) & ~OBJECTS_UNLIMITED_OBJECTS))
     374
    355375#endif
    356376/* end of include file */
  • cpukit/score/src/objectinitializeinformation.c

    r8eb559d3 r5eb434e  
    6363  static Objects_Control *null_local_table = NULL;
    6464  uint32_t                minimum_index;
    65   uint32_t                maximum_per_allocation;
     65  Objects_Maximum         maximum_per_allocation;
    6666  #if defined(RTEMS_MULTIPROCESSING)
    6767    uint32_t              index;
     
    9393   *  Are we operating in limited or unlimited (e.g. auto-extend) mode.
    9494   */
    95   information->auto_extend =
    96         (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false;
    97   maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS;
     95  information->auto_extend = _Objects_Is_unlimited( maximum );
     96  maximum_per_allocation = _Objects_Maximum_per_allocation( maximum );
    9897
    9998  /*
Note: See TracChangeset for help on using the changeset viewer.