From 23c7476ac4f0ebfc7b09d9858149d9bf79f1122e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 1 Oct 2017 19:23:02 +0000 Subject: Changed my mind, modified types. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10742 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/common/oslib/include/chheap.h | 2 +- os/common/oslib/include/chmemcore.h | 7 ++++++- os/common/oslib/src/chfactory.c | 4 ++-- os/common/oslib/src/chmempools.c | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'os/common') diff --git a/os/common/oslib/include/chheap.h b/os/common/oslib/include/chheap.h index 0447d546d..0b259a329 100644 --- a/os/common/oslib/include/chheap.h +++ b/os/common/oslib/include/chheap.h @@ -95,7 +95,7 @@ union heap_header { * @brief Structure describing a memory heap. */ struct memory_heap { - memgetfunc_t provider; /**< @brief Memory blocks provider for + memgetfunc2_t provider; /**< @brief Memory blocks provider for this heap. */ heap_header_t header; /**< @brief Free blocks list header. */ #if CH_CFG_USE_MUTEXES == TRUE diff --git a/os/common/oslib/include/chmemcore.h b/os/common/oslib/include/chmemcore.h index 401e9b1a9..759cee78d 100644 --- a/os/common/oslib/include/chmemcore.h +++ b/os/common/oslib/include/chmemcore.h @@ -68,7 +68,12 @@ /** * @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. diff --git a/os/common/oslib/src/chfactory.c b/os/common/oslib/src/chfactory.c index 2d208d0c4..501f7e59d 100644 --- a/os/common/oslib/src/chfactory.c +++ b/os/common/oslib/src/chfactory.c @@ -235,7 +235,7 @@ void _factory_init(void) { dyn_list_init(&ch_factory.obj_list); chPoolObjectInit(&ch_factory.obj_pool, sizeof (registered_object_t), - chCoreAllocAlignedWithOffsetI); + chCoreAllocAlignedI); #endif #if CH_CFG_FACTORY_GENERIC_BUFFERS == TRUE dyn_list_init(&ch_factory.buf_list); @@ -244,7 +244,7 @@ void _factory_init(void) { dyn_list_init(&ch_factory.sem_list); chPoolObjectInit(&ch_factory.sem_pool, sizeof (dyn_semaphore_t), - chCoreAllocAlignedWithOffsetI); + chCoreAllocAlignedI); #endif } diff --git a/os/common/oslib/src/chmempools.c b/os/common/oslib/src/chmempools.c index fe08c45cf..384e2f7ee 100644 --- a/os/common/oslib/src/chmempools.c +++ b/os/common/oslib/src/chmempools.c @@ -130,7 +130,7 @@ void *chPoolAllocI(memory_pool_t *mp) { mp->next = mp->next->next; } 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*/ -- cgit v1.2.3