Update some doxygen comments

This commit is contained in:
Dirk Ziegelmeier 2016-07-16 17:56:29 +02:00
parent 421dab87e8
commit 4ea1d62d45
2 changed files with 32 additions and 8 deletions

View File

@ -198,7 +198,12 @@ memp_overflow_init(const struct memp_desc *desc)
} }
#endif /* MEMP_OVERFLOW_CHECK */ #endif /* MEMP_OVERFLOW_CHECK */
/**
* Initialize custom memory pool.
* Related functions: memp_malloc_pool, memp_free_pool
*
* @param desc pool to initialize
*/
void void
memp_init_pool(const struct memp_desc *desc) memp_init_pool(const struct memp_desc *desc)
{ {
@ -233,7 +238,8 @@ memp_init_pool(const struct memp_desc *desc)
} }
/** /**
* Initialize this module. * Initializes lwIP built-in pools.
* Related functions: memp_malloc, memp_free
* *
* Carves out memp_memory into linked lists for each pool-type. * Carves out memp_memory into linked lists for each pool-type.
*/ */
@ -257,6 +263,18 @@ memp_init(void)
#endif /* MEMP_OVERFLOW_CHECK */ #endif /* MEMP_OVERFLOW_CHECK */
} }
/**
* Get an element from a custom pool.
*
* @param desc the pool to get an element from
*
* the debug version has two more parameters:
* @param file file name calling this function
* @param line number of line where this function is called
*
* @return a pointer to the allocated memory or a NULL pointer on error
*/
void * void *
#if !MEMP_OVERFLOW_CHECK #if !MEMP_OVERFLOW_CHECK
memp_malloc_pool(const struct memp_desc *desc) memp_malloc_pool(const struct memp_desc *desc)
@ -391,6 +409,12 @@ do_memp_free_pool(const struct memp_desc* desc, void *mem)
SYS_ARCH_UNPROTECT(old_level); SYS_ARCH_UNPROTECT(old_level);
} }
/**
* Put a custom pool element back into its pool.
*
* @param desc the pool where to put mem
* @param mem the memp element to free
*/
void void
memp_free_pool(const struct memp_desc* desc, void *mem) memp_free_pool(const struct memp_desc* desc, void *mem)
{ {

View File

@ -48,10 +48,10 @@
#include "arch/cc.h" #include "arch/cc.h"
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide /** Define this to 1 in arch/cc.h of your port if your compiler does not provide
* the stdint.h header. This cannot be #defined in lwipopts.h since * the stdint.h header. This cannot be \#defined in lwipopts.h since
* this is not an option of lwIP itself, but an option of the lwIP port * this is not an option of lwIP itself, but an option of the lwIP port
* to your system. * to your system.
* Additionally, this header is meant to be #included in lwipopts.h * Additionally, this header is meant to be \#included in lwipopts.h
* (you may need to declare function prototypes in there). * (you may need to declare function prototypes in there).
*/ */
#ifndef LWIP_NO_STDINT_H #ifndef LWIP_NO_STDINT_H
@ -71,10 +71,10 @@ typedef uintptr_t mem_ptr_t;
#endif #endif
/** Define this to 1 in arch/cc.h of your port if your compiler does not provide /** Define this to 1 in arch/cc.h of your port if your compiler does not provide
* the inttypes.h header. This cannot be #defined in lwipopts.h since * the inttypes.h header. This cannot be \#defined in lwipopts.h since
* this is not an option of lwIP itself, but an option of the lwIP port * this is not an option of lwIP itself, but an option of the lwIP port
* to your system. * to your system.
* Additionally, this header is meant to be #included in lwipopts.h * Additionally, this header is meant to be \#included in lwipopts.h
* (you may need to declare function prototypes in there). * (you may need to declare function prototypes in there).
*/ */
#ifndef LWIP_NO_INTTYPES_H #ifndef LWIP_NO_INTTYPES_H
@ -116,9 +116,9 @@ typedef uintptr_t mem_ptr_t;
* trailing padding bytes (see LWIP_MEM_ALIGN_BUFFER) or your own section placement * trailing padding bytes (see LWIP_MEM_ALIGN_BUFFER) or your own section placement
* requirements. * requirements.
* e.g. if you use gcc and need 32 bit alignment: * e.g. if you use gcc and need 32 bit alignment:
* #define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[size] __attribute__((aligned(4))) * \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[size] __attribute__((aligned(4)))
* or more portable: * or more portable:
* #define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)] * \#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u32_t variable_name[(size + sizeof(u32_t) - 1) / sizeof(u32_t)]
*/ */
#ifndef LWIP_DECLARE_MEMORY_ALIGNED #ifndef LWIP_DECLARE_MEMORY_ALIGNED
#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)] #define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)]