]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC408X/TOOLCHAIN_ARM_STD/sys.cpp
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_NXP / TARGET_LPC408X / TOOLCHAIN_ARM_STD / sys.cpp
1 /* mbed Microcontroller Library - stackheap
2 * Copyright (C) 2009-2011 ARM Limited. All rights reserved.
3 *
4 * Setup a fixed single stack/heap memory model,
5 * between the top of the RW/ZI region and the stackpointer
6 */
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 #include <rt_misc.h>
13 #include <stdint.h>
14 #include "sys_helper.h"
15
16 extern char Image$$RW_IRAM1$$ZI$$Limit[];
17
18 extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
19 uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
20 uint32_t sp_limit = __current_sp();
21
22 zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
23
24 struct __initial_stackheap r;
25 r.heap_base = zi_limit;
26 r.heap_limit = sp_limit - __reserved_stack_size();
27 return r;
28 }
29
30 #ifdef __cplusplus
31 }
32 #endif
Imprint / Impressum