mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F103RB/TOOLCHAIN_ARM_MICRO/sys.cpp@52:a51c77007319, 2013-12-02 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Dec 02 11:30:05 2013 +0000
- Revision:
- 52:a51c77007319
- Child:
- 70:c1fbde68b492
Synchronized with git revision 49df530ae72ce97ccc773d1f2c13b38e868e6abd
Full URL: https://github.com/mbedmicro/mbed/commit/49df530ae72ce97ccc773d1f2c13b38e868e6abd/
Add STMicroelectronics NUCLEO_F103RB target
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 52:a51c77007319 | 1 | /* mbed Microcontroller Library - stackheap |
mbed_official | 52:a51c77007319 | 2 | * Copyright (C) 2009-2011 ARM Limited. All rights reserved. |
mbed_official | 52:a51c77007319 | 3 | * |
mbed_official | 52:a51c77007319 | 4 | * Setup a fixed single stack/heap memory model, |
mbed_official | 52:a51c77007319 | 5 | * between the top of the RW/ZI region and the stackpointer |
mbed_official | 52:a51c77007319 | 6 | */ |
mbed_official | 52:a51c77007319 | 7 | |
mbed_official | 52:a51c77007319 | 8 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 9 | extern "C" { |
mbed_official | 52:a51c77007319 | 10 | #endif |
mbed_official | 52:a51c77007319 | 11 | |
mbed_official | 52:a51c77007319 | 12 | #include <rt_misc.h> |
mbed_official | 52:a51c77007319 | 13 | #include <stdint.h> |
mbed_official | 52:a51c77007319 | 14 | |
mbed_official | 52:a51c77007319 | 15 | extern char Image$$RW_IRAM1$$ZI$$Limit[]; |
mbed_official | 52:a51c77007319 | 16 | |
mbed_official | 52:a51c77007319 | 17 | extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) { |
mbed_official | 52:a51c77007319 | 18 | uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit; |
mbed_official | 52:a51c77007319 | 19 | uint32_t sp_limit = __current_sp(); |
mbed_official | 52:a51c77007319 | 20 | |
mbed_official | 52:a51c77007319 | 21 | zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned |
mbed_official | 52:a51c77007319 | 22 | |
mbed_official | 52:a51c77007319 | 23 | struct __initial_stackheap r; |
mbed_official | 52:a51c77007319 | 24 | r.heap_base = zi_limit; |
mbed_official | 52:a51c77007319 | 25 | r.heap_limit = sp_limit; |
mbed_official | 52:a51c77007319 | 26 | return r; |
mbed_official | 52:a51c77007319 | 27 | } |
mbed_official | 52:a51c77007319 | 28 | |
mbed_official | 52:a51c77007319 | 29 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 30 | } |
mbed_official | 52:a51c77007319 | 31 | #endif |