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