mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/TOOLCHAIN_ARM_MICRO/sys.cpp@384:ef87175507f1, 2014-11-04 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Nov 04 09:30:07 2014 +0000
- Revision:
- 384:ef87175507f1
- Parent:
- targets/cmsis/TARGET_STM/TARGET_STM32F407VG/TOOLCHAIN_ARM_MICRO/sys.cpp@351:1b8acea4af63
Synchronized with git revision 8f7778d898867246da01cfccb39396c2e419c1f6
Full URL: https://github.com/mbedmicro/mbed/commit/8f7778d898867246da01cfccb39396c2e419c1f6/
Targets: Nucleo F4xx - Reorder f4xx structure
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 351:1b8acea4af63 | 1 | /* mbed Microcontroller Library - stackheap |
mbed_official | 351:1b8acea4af63 | 2 | * Copyright (C) 2009-2011 ARM Limited. All rights reserved. |
mbed_official | 351:1b8acea4af63 | 3 | * |
mbed_official | 351:1b8acea4af63 | 4 | * Setup a fixed single stack/heap memory model, |
mbed_official | 351:1b8acea4af63 | 5 | * between the top of the RW/ZI region and the stackpointer |
mbed_official | 351:1b8acea4af63 | 6 | */ |
mbed_official | 351:1b8acea4af63 | 7 | |
mbed_official | 351:1b8acea4af63 | 8 | #ifdef __cplusplus |
mbed_official | 351:1b8acea4af63 | 9 | extern "C" { |
mbed_official | 351:1b8acea4af63 | 10 | #endif |
mbed_official | 351:1b8acea4af63 | 11 | |
mbed_official | 351:1b8acea4af63 | 12 | #include <rt_misc.h> |
mbed_official | 351:1b8acea4af63 | 13 | #include <stdint.h> |
mbed_official | 351:1b8acea4af63 | 14 | |
mbed_official | 351:1b8acea4af63 | 15 | extern char Image$$RW_IRAM1$$ZI$$Limit[]; |
mbed_official | 351:1b8acea4af63 | 16 | |
mbed_official | 351:1b8acea4af63 | 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 | 351:1b8acea4af63 | 18 | uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit; |
mbed_official | 351:1b8acea4af63 | 19 | uint32_t sp_limit = __current_sp(); |
mbed_official | 351:1b8acea4af63 | 20 | |
mbed_official | 351:1b8acea4af63 | 21 | zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned |
mbed_official | 351:1b8acea4af63 | 22 | |
mbed_official | 351:1b8acea4af63 | 23 | struct __initial_stackheap r; |
mbed_official | 351:1b8acea4af63 | 24 | r.heap_base = zi_limit; |
mbed_official | 351:1b8acea4af63 | 25 | r.heap_limit = sp_limit; |
mbed_official | 351:1b8acea4af63 | 26 | return r; |
mbed_official | 351:1b8acea4af63 | 27 | } |
mbed_official | 351:1b8acea4af63 | 28 | |
mbed_official | 351:1b8acea4af63 | 29 | #ifdef __cplusplus |
mbed_official | 351:1b8acea4af63 | 30 | } |
mbed_official | 351:1b8acea4af63 | 31 | #endif |