/* * Copyright 2011 Institute of Communication and Computer Systems (ICCS) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /** * \file linked_lists.h * \author Ioannis Koutras (joko@microlab.ntua.gr) * \date September, 2011 * * \brief Linked list node header structure and functions. */ #ifndef LINKED_LISTS_H #define LINKED_LISTS_H #include "dmm_config.h" #ifndef LEON3 #include #else #include #endif /* LEON3 */ #include "dmmlib/freelist/block_header.h" #include "dmmlib/freelist/freelist_rb.h" #ifdef BLOCKS_IN_DLL /** * Set the previous memory block of a block in a linked list. * * \param block The pointer to the data part of the current memory * block. * \param previous_block The pointer to the data part of the previous memory * block. */ void set_previous(void *previous, void *previous_block); /** * Get the previous memory block in a linked list. * * \param ptr The pointer to the data part of the current memory block. * * \return The pointer of the data part of the previous (in list) memory block. * \retval NULL There is no previous memory block in the list. */ void * get_previous(void *ptr); #endif /* BLOCKS_IN_DLL */ /** * Removes a memory block from a linked list of memory blocks. * * \param block A pointer to the block to be removed. * \param raw_block A pointer to the raw block. */ void remove_block(block_header_t *block, freelist_rb_t *raw_block); #endif /* LINKED_LISTS_H */