CMSIS-RTOS2: Memory Functions

| CMSIS-RTOS2 Version 2.1.1 Real-Time Operating System: API and RTX Reference Implementation

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Memory Functions
Event functions

Events generated memory functions. More...

## Functions
void | EvrRtxMemoryInit (void *mem, uint32_t size, uint32_t result)
| Event on memory initialization (Op) More...
void | EvrRtxMemoryAlloc (void *mem, uint32_t size, uint32_t type, void *block)
| Event on memory allocate (Op) More...
void | EvrRtxMemoryFree (void *mem, void *block, uint32_t result)
| Event on memory free (Op) More...
void | EvrRtxMemoryBlockInit (osRtxMpInfo_t *mp_info, uint32_t block_count, uint32_t block_size, void *block_mem)
| Event on memory block initialization (Op) More...
void | EvrRtxMemoryBlockAlloc (osRtxMpInfo_t *mp_info, void *block)
| Event on memory block alloc (Op) More...
void | EvrRtxMemoryBlockFree (osRtxMpInfo_t *mp_info, void *block, int32_t status)
| Event on memory block free (Op) More...

## Description

## Function Documentation

void EvrRtxMemoryInit | ( | void * | mem,
|  | uint32_t | size,
|  | uint32_t | result
| ) |  |

Parameters

  [in] | mem | pointer to memory pool.
  [in] | size | size of a memory pool in bytes.
  [in] | result | execution status: 1 - success, 0 - failure.

The event MemoryInit is generated when initialization of a variable size memory block completes.

Value in the Event Recorder shows:

- mem : memory address of memory pool.
- size : size of a memory pool in bytes.
- result : execution status: 1 - success, 0 - failure.

void EvrRtxMemoryAlloc | ( | void * | mem,
|  | uint32_t | size,
|  | uint32_t | type,
|  | void * | block
| ) |  |

Parameters

  [in] | mem | pointer to memory pool.
  [in] | size | size of a memory block in bytes.
  [in] | type | memory block type: 0 - generic, 1 - control block
  [in] | block | pointer to allocated memory block or NULL in case of no memory is available.

The event MemoryAlloc is generated when allocation of a variable size memory block completes.

Value in the Event Recorder shows:

- mem : memory address of memory pool.
- size : size of a memory block in bytes.
- type : memory block type: 0 - generic, 1 - control block
- block : memory address of allocated memory block or 0 in case of no memory is available.

void EvrRtxMemoryFree | ( | void * | mem,
|  | void * | block,
|  | uint32_t | result
| ) |  |

Parameters

  [in] | mem | pointer to memory pool.
  [in] | block | memory block to be returned to the memory pool.
  [in] | result | execution status: 1 - success, 0 - failure.

The event MemoryFree is generated when deallocation of a variable size memory block completes.

Value in the Event Recorder shows:

- mem : memory address of memory pool.
- block : memory address of block to be returned to the memory pool.
- result : execution status: 1 - success, 0 - failure.

void EvrRtxMemoryBlockInit | ( | osRtxMpInfo_t * | mp_info,
|  | uint32_t | block_count,
|  | uint32_t | block_size,
|  | void * | block_mem
| ) |  |

Parameters

  [in] | mp_info | memory pool info.
  [in] | block_count | maximum number of memory blocks in memory pool.
  [in] | block_size | size of a memory block in bytes.
  [in] | block_mem | pointer to memory for block storage.

The event MemoryBlockInit is generated when initialization of a fixed size memory block completes.

Value in the Event Recorder shows:

- mp_info : memory address of memory pool info.
- block_count : maximum number of memory blocks in memory pool.
- block_size : size of a memory block in bytes.
- block_mem : memory address of memory for block storage.

void EvrRtxMemoryBlockAlloc | ( | osRtxMpInfo_t * | mp_info,
|  | void * | block
| ) |  |

Parameters

  [in] | mp_info | memory pool info.
  [in] | block | address of the allocated memory block or NULL in case of no memory is available.

The event MemoryBlockAlloc is generated when allocation of a fixed size memory block completes.

Value in the Event Recorder shows:

- mp_info : memory address of memory pool info.
- block : memory address of the allocated memory block or 0 in case of no memory is available.

void EvrRtxMemoryBlockFree | ( | osRtxMpInfo_t * | mp_info,
|  | void * | block,
|  | int32_t | status
| ) |  |

Parameters

  [in] | mp_info | memory pool info.
  [in] | block | address of the allocated memory block to be returned to the memory pool.
  [in] | status | extended execution status.

The event MemoryBlockFree is generated when deallocation of a fixed size memory block completes.

Value in the Event Recorder shows:

- mp_info : memory address of memory pool info.
- block : memory address of the allocated memory block to be returned to the memory pool.
- status : execution status osStatus_t