RTEMS  5.0.0
Macros | Functions
Flexible Per-CPU Data

Macros

#define PER_CPU_DATA_ITEM_DECLARE(type, item)
 Declares a per-CPU item of the specified type. More...
 
#define PER_CPU_DATA_ITEM(type, item)   RTEMS_LINKER_RWSET_ITEM( _Per_CPU_Data, type, item )
 Defines a per-CPU item of the specified type. More...
 
#define PER_CPU_DATA_OFFSET(item)
 Returns the offset of the per-CPU item to the begin of the per-CPU data area. More...
 
#define PER_CPU_DATA_GET_BY_OFFSET(cpu, type, offset)
 Returns a pointer of the specified type to the per-CPU item at the specified offset for the specified processor. More...
 
#define PER_CPU_DATA_GET(cpu, type, item)   &_Linker_set__Per_CPU_Data_##item, (void) cpu
 Returns a pointer of the specified type to the specified per-CPU item for the specified processor. More...
 

Functions

 RTEMS_LINKER_RWSET_DECLARE (_Per_CPU_Data, char)
 

Detailed Description

Provides the definition of custom per-CPU items. The items are collected in a special linker set. During system initialization the content of the linker set is duplicated for all secondary processors using memory allocated from the workspace. The begin and end of the per-CPU data area is cache line aligned (CPU_CACHE_LINE_BYTES).

Macro Definition Documentation

◆ PER_CPU_DATA_GET

#define PER_CPU_DATA_GET (   cpu,
  type,
  item 
)    &_Linker_set__Per_CPU_Data_##item, (void) cpu

Returns a pointer of the specified type to the specified per-CPU item for the specified processor.

Parameters
cpuThe processor of the item.
typeThe type of the item.
itemThe designator of the item.

◆ PER_CPU_DATA_GET_BY_OFFSET

#define PER_CPU_DATA_GET_BY_OFFSET (   cpu,
  type,
  offset 
)
Value:
(type *) ( (uintptr_t) RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ) + offset ), \
(void) cpu

Returns a pointer of the specified type to the per-CPU item at the specified offset for the specified processor.

Parameters
cpuThe processor of the item.
typeThe type of the item.
offsetThe offset of the item.

◆ PER_CPU_DATA_ITEM

#define PER_CPU_DATA_ITEM (   type,
  item 
)    RTEMS_LINKER_RWSET_ITEM( _Per_CPU_Data, type, item )

Defines a per-CPU item of the specified type.

Parameters
typeThe type of the item.
itemThe designator of the item.

◆ PER_CPU_DATA_ITEM_DECLARE

#define PER_CPU_DATA_ITEM_DECLARE (   type,
  item 
)
Value:
RTEMS_LINKER_RWSET_ITEM_DECLARE( _Per_CPU_Data, type, item ) \
RTEMS_SECTION( ".rtemsrwset._Per_CPU_Data.content.1" )

Declares a per-CPU item of the specified type.

Items declared with this macro have external linkage.

Parameters
typeThe type of the item.
itemThe designator of the item.

◆ PER_CPU_DATA_OFFSET

#define PER_CPU_DATA_OFFSET (   item)
Value:
( (uintptr_t) &_Linker_set__Per_CPU_Data_##item \
- (uintptr_t) RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ) )

Returns the offset of the per-CPU item to the begin of the per-CPU data area.

Parameters
itemThe designator of the item.