Changed my mind, modified types.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10742 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2017-10-01 19:23:02 +00:00
parent cc61794d1a
commit 23c7476ac4
8 changed files with 1451 additions and 1450 deletions

View File

@ -95,7 +95,7 @@ union heap_header {
* @brief Structure describing a memory heap. * @brief Structure describing a memory heap.
*/ */
struct memory_heap { struct memory_heap {
memgetfunc_t provider; /**< @brief Memory blocks provider for memgetfunc2_t provider; /**< @brief Memory blocks provider for
this heap. */ this heap. */
heap_header_t header; /**< @brief Free blocks list header. */ heap_header_t header; /**< @brief Free blocks list header. */
#if CH_CFG_USE_MUTEXES == TRUE #if CH_CFG_USE_MUTEXES == TRUE

View File

@ -68,7 +68,12 @@
/** /**
* @brief Memory get function. * @brief Memory get function.
*/ */
typedef void *(*memgetfunc_t)(size_t size, unsigned align, size_t offset); typedef void *(*memgetfunc_t)(size_t size, unsigned align);
/**
* @brief Enhanced memory get function.
*/
typedef void *(*memgetfunc2_t)(size_t size, unsigned align, size_t offset);
/** /**
* @brief Type of memory core object. * @brief Type of memory core object.

View File

@ -235,7 +235,7 @@ void _factory_init(void) {
dyn_list_init(&ch_factory.obj_list); dyn_list_init(&ch_factory.obj_list);
chPoolObjectInit(&ch_factory.obj_pool, chPoolObjectInit(&ch_factory.obj_pool,
sizeof (registered_object_t), sizeof (registered_object_t),
chCoreAllocAlignedWithOffsetI); chCoreAllocAlignedI);
#endif #endif
#if CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE #if CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE
dyn_list_init(&ch_factory.buf_list); dyn_list_init(&ch_factory.buf_list);
@ -244,7 +244,7 @@ void _factory_init(void) {
dyn_list_init(&ch_factory.sem_list); dyn_list_init(&ch_factory.sem_list);
chPoolObjectInit(&ch_factory.sem_pool, chPoolObjectInit(&ch_factory.sem_pool,
sizeof (dyn_semaphore_t), sizeof (dyn_semaphore_t),
chCoreAllocAlignedWithOffsetI); chCoreAllocAlignedI);
#endif #endif
} }

View File

@ -130,7 +130,7 @@ void *chPoolAllocI(memory_pool_t *mp) {
mp->next = mp->next->next; mp->next = mp->next->next;
} }
else if (mp->provider != NULL) { else if (mp->provider != NULL) {
objp = mp->provider(mp->object_size, PORT_NATURAL_ALIGN, 0U); /* TODO: Alignment is not properly handled */ objp = mp->provider(mp->object_size, PORT_NATURAL_ALIGN); /* TODO: Alignment is not properly handled */
} }
/*lint -restore*/ /*lint -restore*/

View File

@ -1158,11 +1158,10 @@ static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t)); static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t));
#endif #endif
static void *null_provider(size_t size, unsigned align, size_t offset) { static void *null_provider(size_t size, unsigned align) {
(void)size; (void)size;
(void)align; (void)align;
(void)offset;
return NULL; return NULL;
}]]></value> }]]></value>

View File

@ -58,11 +58,10 @@ static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t)); static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t));
#endif #endif
static void *null_provider(size_t size, unsigned align, size_t offset) { static void *null_provider(size_t size, unsigned align) {
(void)size; (void)size;
(void)align; (void)align;
(void)offset;
return NULL; return NULL;
} }

View File

@ -3547,11 +3547,10 @@ static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t)); static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t));
#endif #endif
static void *null_provider(size_t size, unsigned align, size_t offset) { static void *null_provider(size_t size, unsigned align) {
(void)size; (void)size;
(void)align; (void)align;
(void)offset;
return NULL; return NULL;
}]]></value> }]]></value>

View File

@ -58,11 +58,10 @@ static MEMORYPOOL_DECL(mp1, sizeof (uint32_t), NULL);
static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t)); static GUARDEDMEMORYPOOL_DECL(gmp1, sizeof (uint32_t));
#endif #endif
static void *null_provider(size_t size, unsigned align, size_t offset) { static void *null_provider(size_t size, unsigned align) {
(void)size; (void)size;
(void)align; (void)align;
(void)offset;
return NULL; return NULL;
} }