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