![]() |
![]() |
Implementation of a doubly linked list. More...
#include <stdint.h>
#include <stdlib.h>
#include <cppi_osal.h>
#include <ti/drv/cppi/include/cppi_listlib.h>
Functions | |
void | cppi_list_add (Cppi_ListNode **ptr_list, Cppi_ListNode *ptr_node) |
void | cppi_list_cat (Cppi_ListNode **ptr_dst, Cppi_ListNode **ptr_src) |
Cppi_ListNode * | cppi_list_remove (Cppi_ListNode **ptr_list) |
int | cppi_list_remove_node (Cppi_ListNode **ptr_list, Cppi_ListNode *ptr_remove) |
Cppi_ListNode * | cppi_list_get_head (Cppi_ListNode **ptr_list) |
Cppi_ListNode * | cppi_list_get_next (Cppi_ListNode *ptr_list) |
void | cppi_list_cache_invalidate (Cppi_ListNode *ptr_list) |
Implementation of a doubly linked list.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void cppi_list_add | ( | Cppi_ListNode ** | ptr_list, |
Cppi_ListNode * | ptr_node | ||
) |
Description
The function is called to add a node to the list.
Cache assumptions: caller has invalidated *ptr_list, ptr_node, ptr_list Callee will write back any modified links.
[in] | ptr_list | This is the list to which the node is to be added. |
[in] | ptr_node | This is the node which is to be added. |
Not | Applicable |
void cppi_list_cache_invalidate | ( | Cppi_ListNode * | ptr_list | ) |
Description
Calls Cppi_osalBeginMemAccess () for each element in a list. This must be called before anything in the same heap as the list is dirtied, otherwise the dirty data (from items outside this list) will be discarded.
[in] | ptr_list | This is the pointer to the head node in the list. |
nothing |
void cppi_list_cat | ( | Cppi_ListNode ** | ptr_dst, |
Cppi_ListNode ** | ptr_src | ||
) |
Description
The function is called to concatenate the src list to the end of the destination list.
Cache assumptions: caller has invalidated *ptr_dst, *ptr_src, ptr_dst, ptr_src, as well as all applicable links in the list. Callee will write back any modified links.
[in] | ptr_dst | This is the head of the destination list. |
[in] | ptr_src | This is the head of the source list. |
Not | Applicable |
Cppi_ListNode* cppi_list_get_head | ( | Cppi_ListNode ** | ptr_list | ) |
Description
The function is used to get the head of the specific list
[in] | ptr_list | This is the pointer to the list. |
Head | of the list (could be NULL if the list is empty) |
Cppi_ListNode* cppi_list_get_next | ( | Cppi_ListNode * | ptr_list | ) |
Description
The function is used to get the next element in the list.
[in] | ptr_list | This is the pointer to the node in the list. |
Next | element in the list. (could be NULL if this is the last element) |
Cppi_ListNode* cppi_list_remove | ( | Cppi_ListNode ** | ptr_list | ) |
Description
The function is called to remove the head node from the list.
Cache assumptions: caller has invalidated **ptr_list, ptr_list, Callee will write back any modified links.
[in] | ptr_list | This is the pointer to the list from where nodes will be removed. |
Pointer | to the head of the list. |
int cppi_list_remove_node | ( | Cppi_ListNode ** | ptr_list, |
Cppi_ListNode * | ptr_remove | ||
) |
Description
The function is called to remove the specified node from the list.
Cache assumptions: caller has invalidated **ptr_list, ptr_remove, as well as previous and next nodes (or whole list) Callee will write back any modified links.
[in] | ptr_list | This is the pointer to the list from where node will be removed. |
[in] | ptr_remove | This is the node which is to be removed. |
Success | - 0 |
Error | - -1 |