RTEMS  5.0.0
Macros
Configuration Helpers

Macros

#define _Configure_Zero_or_One(_number)   ((_number) != 0 ? 1 : 0)
 
#define _Configure_Align_up(_val, _align)   (((_val) + (_align) - 1) - ((_val) + (_align) - 1) % (_align))
 
#define _CONFIGURE_HEAP_MIN_BLOCK_SIZE   _Configure_Align_up(sizeof(Heap_Block), CPU_HEAP_ALIGNMENT)
 
#define _Configure_From_workspace(_size)
 
#define _Configure_From_stackspace(_stack_size)   _Configure_From_workspace(_stack_size)
 
#define _Configure_Max_Objects(_max)   (_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max))
 

Detailed Description

This module contains items which are used internally to ease the configuration calculations.

Macro Definition Documentation

◆ _Configure_Align_up

#define _Configure_Align_up (   _val,
  _align 
)    (((_val) + (_align) - 1) - ((_val) + (_align) - 1) % (_align))

General helper to align up a value.

◆ _Configure_From_stackspace

#define _Configure_From_stackspace (   _stack_size)    _Configure_From_workspace(_stack_size)

This is a helper macro used in stack space calculations in this file. It may be provided by the application in case a special task stack allocator is used. The default is allocation from the RTEMS Workspace.

◆ _Configure_From_workspace

#define _Configure_From_workspace (   _size)
Value:
(ssize_t) (_Configure_Zero_or_One(_size) * \
_Configure_Align_up(_size + HEAP_BLOCK_HEADER_SIZE, \
_CONFIGURE_HEAP_MIN_BLOCK_SIZE))
#define _Configure_Zero_or_One(_number)
Definition: confdefs.h:1318
#define HEAP_BLOCK_HEADER_SIZE
The block header consists of the two size fields (Heap_Block::prev_size and Heap_Block::size_and_flag...
Definition: heap.h:187

This is a helper macro used in calculations in this file. It is used to noted when an element is allocated from the RTEMS Workspace and adds a factor to account for heap overhead plus an alignment factor that may be applied.

◆ _Configure_Max_Objects

#define _Configure_Max_Objects (   _max)    (_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max))

Do not use the unlimited bit as part of the multiplication for memory usage.

◆ _Configure_Zero_or_One

#define _Configure_Zero_or_One (   _number)    ((_number) != 0 ? 1 : 0)

Zero of one returns 0 if the parameter is 0 else 1 is returned.