diff options
Diffstat (limited to 'os/kernel/src/chmemcore.c')
-rw-r--r-- | os/kernel/src/chmemcore.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/os/kernel/src/chmemcore.c b/os/kernel/src/chmemcore.c index 0ff26bc76..76f415743 100644 --- a/os/kernel/src/chmemcore.c +++ b/os/kernel/src/chmemcore.c @@ -48,9 +48,29 @@ #if CH_USE_MEMCORE || defined(__DOXYGEN__)
+/*===========================================================================*/
+/* Module exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module local types. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module local variables. */
+/*===========================================================================*/
+
static uint8_t *nextmem;
static uint8_t *endmem;
+/*===========================================================================*/
+/* Module local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module exported functions. */
+/*===========================================================================*/
+
/**
* @brief Low level memory manager initialization.
*
@@ -60,10 +80,12 @@ void _core_init(void) { #if CH_MEMCORE_SIZE == 0
extern uint8_t __heap_base__[];
extern uint8_t __heap_end__[];
+
nextmem = (uint8_t *)MEM_ALIGN_NEXT(__heap_base__);
endmem = (uint8_t *)MEM_ALIGN_PREV(__heap_end__);
#else
static stkalign_t buffer[MEM_ALIGN_NEXT(CH_MEMCORE_SIZE)/MEM_ALIGN_SIZE];
+
nextmem = (uint8_t *)&buffer[0];
endmem = (uint8_t *)&buffer[MEM_ALIGN_NEXT(CH_MEMCORE_SIZE)/MEM_ALIGN_SIZE];
#endif
|