RTEMS CPU Kit with SuperCore  4.11.3
Files | Functions

Classic API support. More...

Collaboration diagram for Workspace:

Files

file  workspace.c
 RTEMS Workspace Support.
 

Functions

bool rtems_workspace_get_information (Heap_Information_block *the_info)
 Gets Workspace Information. More...
 
bool rtems_workspace_allocate (size_t bytes, void **pointer)
 Allocates Memory from the Workspace. More...
 
bool rtems_workspace_free (void *pointer)
 Frees Memory Allocated from the Workspace. More...
 
void * rtems_workspace_greedy_allocate (const uintptr_t *block_sizes, size_t block_count)
 Greedy allocate that empties the workspace. More...
 
void * rtems_workspace_greedy_allocate_all_except_largest (uintptr_t *allocatable_size)
 Greedy allocate all blocks except the largest free block. More...
 
void rtems_workspace_greedy_free (void *opaque)
 Frees space of a greedy allocation. More...
 

Detailed Description

Classic API support.

Workspace definitions.

Function Documentation

◆ rtems_workspace_allocate()

bool rtems_workspace_allocate ( size_t  bytes,
void **  pointer 
)

Allocates Memory from the Workspace.

A number of bytes bytes will be allocated from the RTEMS Executive Workspace and returned in pointer.

Returns true if successful, and false otherwise.

References _Protected_heap_Allocate(), and _Workspace_Area.

Referenced by rtems_name_to_characters().

◆ rtems_workspace_free()

bool rtems_workspace_free ( void *  pointer)

Frees Memory Allocated from the Workspace.

This frees the memory indicated by pointer that was allocated from the RTEMS Executive Workspace.

Returns true if successful, and false otherwise.

References _Protected_heap_Free(), and _Workspace_Area.

Referenced by rtems_name_to_characters().

◆ rtems_workspace_get_information()

bool rtems_workspace_get_information ( Heap_Information_block the_info)

Gets Workspace Information.

Returns information about the heap that is used as the RTEMS Executive Workspace in the_info.

Returns true if successful, and false otherwise.

References _Protected_heap_Get_information(), and _Workspace_Area.

Referenced by rtems_name_to_characters().

◆ rtems_workspace_greedy_allocate()

void* rtems_workspace_greedy_allocate ( const uintptr_t *  block_sizes,
size_t  block_count 
)

Greedy allocate that empties the workspace.

Afterwards the heap has at most block_count allocatable blocks of sizes specified by block_sizes. The block_sizes must point to an array with block_count members. All other blocks are used.

See also
rtems_workspace_greedy_free().

Referenced by rtems_name_to_characters().

◆ rtems_workspace_greedy_allocate_all_except_largest()

void* rtems_workspace_greedy_allocate_all_except_largest ( uintptr_t *  allocatable_size)

Greedy allocate all blocks except the largest free block.

Afterwards the heap has at most one allocatable block. This block is the largest free block if it exists. The allocatable size of this block is stored in allocatable_size. All other blocks are used.

See also
rtems_workspace_greedy_free().

Referenced by rtems_name_to_characters().

◆ rtems_workspace_greedy_free()

void rtems_workspace_greedy_free ( void *  opaque)

Frees space of a greedy allocation.

The opaque argument must be the return value of rtems_workspace_greedy_allocate() or rtems_workspace_greedy_allocate_all_except_largest().

Referenced by rtems_name_to_characters().