|
Information about already allocated buffer-space is stored in the status-array.
But this information has no order which forces us everytime we want to allocate buffer-space to create an ordered list of already allocated buffer-space. To avoid this we have additionally an ordered linked-list. This list orders the indexes (== message-IDs) of the status-array-entries in ascending order of the memory-addresses. This enables fast searching for free buffer-space.
Allocated buffer-space is cleared by the receiving process by setting the appropriate flag in the status-array-entry. This is done by a DMA-Transfer and so no collaboration of the sending-process is needed. During the next allocation of buffer-space nodes with disabled buffer-flags are freed.
Data Structures | |
| struct | moc_internal_buffer_node_struct |
| Node of linked list holding information about allocated buffer-space. More... | |
Typedefs | |
| typedef struct moc_internal_buffer_node_struct | moc_internal_buffer_node_t |
| Node of linked list holding information about allocated buffer-space. | |
Functions | |
| uint64_t | IMOC_bmalloc (uint32_t size, uint8_t mid) |
| Allocate buffer-space. | |
| moc_internal_buffer_node_t * | __attribute__ ((always_inline)) |
| void bmalloc_print_nodes() { if (!bmalloc_first_node) printf("No nodes in list\n"); else { int z = 0; moc_internal_buffer_node_t* t; for (t = bmalloc_first_node; t != 0; t = t->next_node) { printf( "Node %i: offset %u - size %u - valid %i - mid %u\n", z, node_handle.status_array_base[ t->mid ].buffer_offset, node_handle.status_array_base[ t->mid ].message_size, node_handle.status_array_base[ t->mid ].flags.bits.buffer_used, t->mid ); z++; } } } | |
Variables | |
| moc_internal_buffer_node_t * | bmalloc_first_node = 0 |
| Pointer to first entry of linked-list. | |
| typedef struct moc_internal_buffer_node_struct moc_internal_buffer_node_t |
Node of linked list holding information about allocated buffer-space.
| moc_internal_buffer_node_t* __attribute__ | ( | (always_inline) | ) |
void bmalloc_print_nodes() { if (!bmalloc_first_node) printf("No nodes in list\n"); else { int z = 0; moc_internal_buffer_node_t* t; for (t = bmalloc_first_node; t != 0; t = t->next_node) { printf( "Node %i: offset %u - size %u - valid %i - mid %u\n", z, node_handle.status_array_base[ t->mid ].buffer_offset, node_handle.status_array_base[ t->mid ].message_size, node_handle.status_array_base[ t->mid ].flags.bits.buffer_used, t->mid ); z++; } } }
Returns the next node holding valid buffer-information coming after node start.
During the search all invalid nodes the function stumbles across are freed and the links are corrected.
| start | in start-node of search (NULL means beginning of list) |
Definition at line 56 of file imoc_buffer_malloc.c.
References moc_message_status_struct::bits, moc_message_status_struct::flags, moc_internal_buffer_node_struct::mid, moc_internal_buffer_node_struct::next_node, node_handle, and moc_node_handle_ppu_struct::status_array_base.
Referenced by IMOC_get_data(), MOC_Barrier(), MOC_Bsend(), MOC_ISsend(), MOC_Recv(), and MOC_Ssend().

| uint64_t IMOC_bmalloc | ( | uint32_t | size, | |
| uint8_t | mid | |||
| ) |
Allocate buffer-space.
| size | in size of buffer-space | |
| mid | in corresponding message-ID |
Definition at line 85 of file imoc_buffer_malloc.c.
References moc_message_status_struct::bits, moc_node_handle_ppu_struct::buffer_base, moc_message_status_struct::buffer_offset, moc_node_handle_ppu_struct::buffer_size, moc_message_status_struct::flags, moc_message_status_struct::message_size, moc_internal_buffer_node_struct::mid, moc_internal_buffer_node_struct::next_node, node_handle, and moc_node_handle_ppu_struct::status_array_base.
Referenced by MOC_Bsend().

Pointer to first entry of linked-list.
Definition at line 20 of file imoc_buffer_malloc.c.
Referenced by MOC_Finalize().
1.5.6