From 411e6a635117a17986c22d98176e80c6921f70a6 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 27 Feb 2010 08:40:21 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1678 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 71 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 os/kernel/include/chmemcore.h (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h new file mode 100644 index 000000000..381339938 --- /dev/null +++ b/os/kernel/include/chmemcore.h @@ -0,0 +1,71 @@ +/* + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS/RT is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +/** + * @file memcore.h + * @brief Core memory manager macros and structures. + * + * @addtogroup memcore + * @{ + */ + +#ifndef _MEMCORE_H_ +#define _MEMCORE_H_ + +/** + * @brief Memory get function. + * @note This type must be assignment compatible with the @p chMemAlloc() + * function. + */ +typedef void *(*memgetfunc_t)(size_t size); + +/** + * @brief Alignment mask constant. + */ +#define MEM_ALIGN_MASK (sizeof(stkalign_t) - 1) + +/** + * @brief Alignment helper macro. + */ +#define MEM_ALIGN_SIZE(p) (((size_t)(p) + MEM_ALIGN_MASK) & ~MEM_ALIGN_MASK) + +/** + * @brief Returns whatever a pointer or memory size is aligned to + * the type @p align_t. + */ +#define MEM_IS_ALIGNED(p) (((size_t)(p) & MEM_ALIGN_MASK) == 0) + +#if CH_USE_MEMCORE + +#ifdef __cplusplus +extern "C" { +#endif + void core_init(void); + void *chCoreAlloc(size_t size); + void *chCoreAllocI(size_t size); + size_t chCoreFree(void); +#ifdef __cplusplus +} +#endif + +#endif /* CH_USE_MEMCORE */ + +#endif /* _MEMCORE_H_ */ + +/** @} */ -- cgit v1.2.3 From 5fb790997fec3b9d965c57e57b4edd156c8b8954 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 27 Feb 2010 08:54:22 +0000 Subject: Renamed the kernel header to match their source files. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1679 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index 381339938..7888222b3 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -18,15 +18,15 @@ */ /** - * @file memcore.h + * @file chmemcore.h * @brief Core memory manager macros and structures. * * @addtogroup memcore * @{ */ -#ifndef _MEMCORE_H_ -#define _MEMCORE_H_ +#ifndef _CHMEMCORE_H_ +#define _CHMEMCORE_H_ /** * @brief Memory get function. @@ -66,6 +66,6 @@ extern "C" { #endif /* CH_USE_MEMCORE */ -#endif /* _MEMCORE_H_ */ +#endif /* _CHMEMCORE_H_ */ /** @} */ -- cgit v1.2.3 From bc9d319ddb279f973404c2b1abf15ec1091bd891 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 4 May 2010 12:31:05 +0000 Subject: Improved code coverage. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1902 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index 7888222b3..4870c79f1 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -59,7 +59,7 @@ extern "C" { void core_init(void); void *chCoreAlloc(size_t size); void *chCoreAllocI(size_t size); - size_t chCoreFree(void); + size_t chCoreStatus(void); #ifdef __cplusplus } #endif -- cgit v1.2.3 From 9ffea7e261ec4016d788abbbf7c4a6d3a78e0a04 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 18 Sep 2010 06:48:56 +0000 Subject: Documentation improvements, renamed some event APIs. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2179 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index 4870c79f1..f42478125 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -51,7 +51,7 @@ typedef void *(*memgetfunc_t)(size_t size); */ #define MEM_IS_ALIGNED(p) (((size_t)(p) & MEM_ALIGN_MASK) == 0) -#if CH_USE_MEMCORE +#if CH_USE_MEMCORE || defined(__DOXYGEN__) #ifdef __cplusplus extern "C" { -- cgit v1.2.3 From 24594525990ee1769ee933261b821211b4c299e8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 24 Feb 2011 14:57:38 +0000 Subject: Fixed bugs 3191107 and 3191112. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2762 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index f42478125..58cb318b2 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -35,15 +35,25 @@ */ typedef void *(*memgetfunc_t)(size_t size); +/** + * @brief Alignment size constant. + */ +#define MEM_ALIGN_SIZE sizeof(stkalign_t) + /** * @brief Alignment mask constant. */ -#define MEM_ALIGN_MASK (sizeof(stkalign_t) - 1) +#define MEM_ALIGN_MASK (MEM_ALIGN_SIZE - 1) + +/** + * @brief Alignment helper macro. + */ +#define MEM_ALIGN_PREV(p) ((size_t)(p) & ~MEM_ALIGN_MASK) /** * @brief Alignment helper macro. */ -#define MEM_ALIGN_SIZE(p) (((size_t)(p) + MEM_ALIGN_MASK) & ~MEM_ALIGN_MASK) +#define MEM_ALIGN_NEXT(p) MEM_ALIGN_PREV((size_t)(p) + MEM_ALIGN_MASK) /** * @brief Returns whatever a pointer or memory size is aligned to -- cgit v1.2.3 From e7e79a6ccb4f3e320b2b8b7bad1b14d65218641d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Mar 2011 18:38:08 +0000 Subject: License updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2827 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index 58cb318b2..bc0654a6d 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From f5ae2552307f20f3fa3d987591fa60576981ce3d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 29 Mar 2011 14:51:08 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2850 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index bc0654a6d..cf608c4e8 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -67,7 +67,7 @@ typedef void *(*memgetfunc_t)(size_t size); #ifdef __cplusplus extern "C" { #endif - void core_init(void); + void _core_init(void); void *chCoreAlloc(size_t size); void *chCoreAllocI(size_t size); size_t chCoreStatus(void); -- cgit v1.2.3 From 2d55ac3059fcca69cc9736db310b4521064c2b23 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 22 Aug 2011 17:18:52 +0000 Subject: Documentation improvements and code comments reformatting. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3248 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index cf608c4e8..5f72a3585 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -36,6 +36,9 @@ */ typedef void *(*memgetfunc_t)(size_t size); +/** + * @name Alignment support macros + */ /** * @brief Alignment size constant. */ @@ -61,6 +64,7 @@ typedef void *(*memgetfunc_t)(size_t size); * the type @p align_t. */ #define MEM_IS_ALIGNED(p) (((size_t)(p) & MEM_ALIGN_MASK) == 0) +/** @} */ #if CH_USE_MEMCORE || defined(__DOXYGEN__) -- cgit v1.2.3 From de5dcbba856524599a8f06d3a9bdbf1b01db44c2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 21 Jan 2012 14:29:42 +0000 Subject: License text updated with new year. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3846 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index 5f72a3585..2cad9e4d5 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011 Giovanni Di Sirio. + 2011,2012 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From 184a71345c6a36a9a8664eda8fbcc3ea728267a8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 2 Feb 2013 10:58:09 +0000 Subject: Updated license years. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5102 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chmemcore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'os/kernel/include/chmemcore.h') diff --git a/os/kernel/include/chmemcore.h b/os/kernel/include/chmemcore.h index 2cad9e4d5..4f75bd043 100644 --- a/os/kernel/include/chmemcore.h +++ b/os/kernel/include/chmemcore.h @@ -1,6 +1,6 @@ /* ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, - 2011,2012 Giovanni Di Sirio. + 2011,2012,2013 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3