mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-20 01:58:32 -04:00
Add FreeRTOS-Plus directory.
This commit is contained in:
parent
7bd5f21ad5
commit
f508a5f653
6798 changed files with 134949 additions and 19 deletions
43
FreeRTOS/Demo/uIP_Demo_Rowley_ARM7/uip/memb.h
Normal file
43
FreeRTOS/Demo/uIP_Demo_Rowley_ARM7/uip/memb.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* \addtogroup exampleapps
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Memory block allocation routines.
|
||||
* \author Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MEMB_H__
|
||||
#define __MEMB_H__
|
||||
|
||||
/**
|
||||
* Declare a memory block.
|
||||
*
|
||||
* \param name The name of the memory block (later used with
|
||||
* memb_init(), memb_alloc() and memb_free()).
|
||||
*
|
||||
* \param size The size of each memory chunk, in bytes.
|
||||
*
|
||||
* \param num The total number of memory chunks in the block.
|
||||
*
|
||||
*/
|
||||
#define MEMB(name, size, num) \
|
||||
static char memb_mem[(size + 1) * num]; \
|
||||
static struct memb_blocks name = {size, num, memb_mem}
|
||||
|
||||
struct memb_blocks {
|
||||
unsigned short size;
|
||||
unsigned short num;
|
||||
char *mem;
|
||||
};
|
||||
|
||||
void memb_init(struct memb_blocks *m);
|
||||
char *memb_alloc(struct memb_blocks *m);
|
||||
char memb_ref(struct memb_blocks *m, char *ptr);
|
||||
char memb_free(struct memb_blocks *m, char *ptr);
|
||||
|
||||
|
||||
#endif /* __MEMB_H__ */
|
Loading…
Add table
Add a link
Reference in a new issue