Files | |
file | malloc.c |
Dynamic memory allocation services. | |
file | rtai_nam2num.h |
Conversion between characters strings and unsigned long identifiers. | |
file | rtai_scb.h |
SCB stand for Shared (memory) Circular Buffer. | |
file | rtai_shm.h |
Interface of the RTAI SHM module. | |
file | shm.c |
Implementation of the RTAI SHM module. | |
Defines | |
#define | rtai_kmalloc(name, size) rt_shm_alloc(name, size, USE_VMALLOC) |
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes. | |
#define | rtai_kfree(name) rt_shm_free(name) |
Free a chunk of shared memory being shared inter-intra kernel modules and Linux processes. | |
#define | rtai_malloc(name, size) _rt_shm_alloc(0, name, size, USE_VMALLOC, 0) |
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes. | |
#define | rt_shm_alloc_adr(start_address, name, size, suprt) _rt_shm_alloc(start_address, name, size, suprt, 0) |
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes. | |
#define | rtai_malloc_adr(start_address, name, size) _rt_shm_alloc(start_address, name, size, USE_VMALLOC, 0) |
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes. | |
#define | rtai_free(name, adr) rt_shm_free(name) |
Free a chunk of shared memory being shared inter-intra kernel modules and Linux processes. | |
#define | rt_heap_close(name, adr) rt_shm_free(name) |
Close a real time group heap being shared inter-intra kernel modules and Linux processes. | |
#define | rt_global_heap_open() rt_heap_open(GLOBAL_HEAP_ID, 0, 0) |
Open the global real time heap to be shared inter-intra kernel modules and Linux processes. | |
#define | rt_global_heap_close() rt_heap_close(GLOBAL_HEAP_ID, 0) |
Close the global real time heap being shared inter-intra kernel modules and Linux processes. | |
Functions | |
int | rt_shm_free (unsigned long name) |
Free a chunk of shared memory being shared inter-intra kernel modules and Linux processes. | |
void * | rt_halloc (int size) |
Allocate a chunk of a group real time heap in kernel/user space. | |
void | rt_hfree (void *addr) |
Free a chunk of a group real time heap. | |
void * | rt_named_halloc (unsigned long name, int size) |
Allocate a chunk of a group real time heap in kernel/user space. | |
void | rt_named_hfree (void *addr) |
Free a chunk of a group real time heap. | |
void * | rt_named_malloc (unsigned long name, int size) |
Allocate a chunk of the global real time heap in kernel/user space. | |
void | rt_named_free (void *addr) |
Free a named chunk of the global real time heap. | |
void * | rt_shm_alloc (unsigned long name, int size, int suprt) |
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes. | |
void * | rt_heap_open (unsigned long name, int size, int suprt) |
Open/create a named group real time heap to be shared inter-intra kernel modules and Linux processes. | |
int | rtheap_init (rtheap_t *heap, void *heapaddr, u_long heapsize, u_long pagesize) |
Initialize a memory heap. | |
void | rtheap_destroy (rtheap_t *heap) |
Destroys a memory heap. | |
void * | rtheap_alloc (rtheap_t *heap, u_long size, int mode) |
Allocate a memory block from a memory heap. | |
int | rtheap_free (rtheap_t *heap, void *block) |
Release a memory block to a memory heap. |
|
Close the global real time heap being shared inter-intra kernel modules and Linux processes.
For internal use only. rt_global_heap_close is used to close the global real time heap. Closing a global heap in user space has just the effect of deregistering its use and unmapping the related memory from a process address space. In kernel tasks just the deregistration is performed. The global real time heap is destroyed just a the rmmoding of the shared memory module. |
|
Open the global real time heap to be shared inter-intra kernel modules and Linux processes.
For internal use only. rt_global_heap_open is used to open the global real time heap. The global heap is created by the shared memory module and its opening is needed in user space to map it to the process address space. In kernel space opening the global heap in a task is not required but should be done anyhow, both for symmetry and to register its usage. |
|
Close a real time group heap being shared inter-intra kernel modules and Linux processes.
For internal use only. rt_heap_close is used to close a previously opened real time group heap.
|
|
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes. rt_shm_alloc_adr is used to allocate in user space.
name can be a clumsy identifier, services are provided to convert 6 characters identifiers to unsigned long, and vice versa.It must be remarked that only the very first call does a real allocation, any subsequent call to allocate with the same name from anywhere will just increase the usage count and map the area to user space, or return the related pointer to the already allocated space in kernel space. The function returns a pointer to the allocated memory, appropriately mapped to the memory space in use. So if one is really sure that the named shared memory has been allocated already parameters size and suprt are not used and can be assigned any value.
|
|
Free a chunk of shared memory being shared inter-intra kernel modules and Linux processes. rtai_free is used to free a shared memory chunk from user space.
|
|
Free a chunk of shared memory being shared inter-intra kernel modules and Linux processes. rtai_kfree is used to free a shared memory chunk from kernel space.
|
|
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes.
For internal use only. rtai_kalloc is used to allocate shared memory from kernel space.
|
|
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes.
For internal use only. rtai_malloc is used to allocate shared memory from user space.
|
|
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes.
For internal use only. rtai_malloc_adr is used to allocate shared memory from user space.
|
|
Allocate a chunk of a group real time heap in kernel/user space. Since it is not named there is no chance to retrieve and share it elsewhere. For internal use only. rt_halloc is used to allocate a non sharable piece of a group real time heap.
|
|
Open/create a named group real time heap to be shared inter-intra kernel modules and Linux processes.
For internal use only. rt_heap_open is used to allocate open/create a shared real time heap.
It must be remarked that only the very first open does a real allocation, any subsequent one with the same name from anywhere will just map the area to the user space, or return the related pointer to the already allocated memory in kernel space. In any case the functions return a pointer to the allocated memory, appropriately mapped to the memory space in use. Be careful and avoid opening more than one group heap per process/task, if more than one is opened then just the last will used.
|
|
Free a chunk of a group real time heap.
For internal use only. rt_hfree is used to free a previously allocated chunck of a group real time heap.
|
|
Free a named chunk of the global real time heap.
For internal use only. rt_named_free is used to free a previously allocated chunk of the global real time heap.
|
|
Allocate a chunk of a group real time heap in kernel/user space. Since it is named it can be retrieved and shared everywhere among the group peers, i.e all processes/tasks that have opened the same group heap. For internal use only. rt_named_halloc is used to allocate a sharable piece of a group real time heap.
A process/task must have opened the real time group heap to use and can use just one real time group heap. Be careful and avoid opening more than one group real time heap per process/task. If more than one is opened then just the last will used. It must be remarked that only the very first call does a real allocation, any subsequent call with the same name will just increase the usage count and receive the appropriate pointer to the already allocated memory having the same name.
|
|
Free a chunk of a group real time heap.
For internal use only. rt_named_hfree is used to free a previously allocated chunk of the global real time heap.
|
|
Allocate a chunk of the global real time heap in kernel/user space. Since it is named it can be retrieved and shared everywhere. For internal use only. rt_named_malloc is used to allocate a sharable piece of the global real time heap.
It must be remarked that only the very first call does a real allocation, any subsequent call to allocate with the same name will just increase the usage count and return the appropriate pointer to the already allocated memory having the same name. So if one is really sure that the named chunk has been allocated already the size parameter is not used and can be assigned any value.
|
|
Allocate a chunk of memory to be shared inter-intra kernel modules and Linux processes.
For internal use only. rt_shm_alloc is used to allocate shared memory.
It must be remarked that only the very first call does a real allocation, any following call to allocate with the same name from anywhere will just increase the usage count and maps the area to the user space, or return the related pointer to the already allocated space in kernel space. In any case the functions return a pointer to the allocated memory, appropriately mapped to the memory space in use. So if one is really sure that the named shared memory has been allocated already parameters size and suprt are not used and can be assigned any value.
|
|
Free a chunk of shared memory being shared inter-intra kernel modules and Linux processes.
For internal use only. rt_shm_free is used to free a previously allocated shared memory.
|
|
Allocate a memory block from a memory heap. Allocates a contiguous region of memory from an active memory heap. Such allocation is guaranteed to be time-bounded if the heap is non-extendable (see rtheap_init()). Otherwise, it might trigger a dynamic extension of the storage area through an internal request to the Linux allocation service (kmalloc/vmalloc).
Context: This routine can always be called on behalf of a thread context. It can also be called on behalf of an IST context if the heap storage area has been statically-defined at initialization time (see rtheap_init()). |
|
Destroys a memory heap. Destroys a memory heap. Dynamically allocated extents are returned to Linux.
Context: This routine must be called on behalf of a thread context. |
|
Release a memory block to a memory heap. Releases a memory region to the memory heap it was previously allocated from.
Context: This routine can be called on behalf of a thread or IST context |
|
Initialize a memory heap. Initializes a memory heap suitable for dynamic memory allocation requests. The heap manager can operate in two modes, whether time-bounded if the heap storage area and size are statically defined at initialization time, or dynamically extendable at the expense of a less deterministic behaviour.
Context: This routine must be called on behalf of a thread context. |