mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Thu Sep 11 17:00:08 2014 +0100
Revision:
320:be04b2b1e3f2
Parent:
targets/cmsis/TARGET_Freescale/TARGET_K64F/TOOLCHAIN_ARM_STD/sys.cpp@146:f64d43ff0c18
Synchronized with git revision c372035d60ac16c22e1313348a9e3f47293dc6b8

Full URL: https://github.com/mbedmicro/mbed/commit/c372035d60ac16c22e1313348a9e3f47293dc6b8/

Add derivative support to K64F and updates for MTS_GAMBIT

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 146:f64d43ff0c18 1 /* mbed Microcontroller Library - stackheap
mbed_official 146:f64d43ff0c18 2 * Copyright (C) 2009-2011 ARM Limited. All rights reserved.
mbed_official 146:f64d43ff0c18 3 *
mbed_official 146:f64d43ff0c18 4 * Setup a fixed single stack/heap memory model,
mbed_official 146:f64d43ff0c18 5 * between the top of the RW/ZI region and the stackpointer
mbed_official 146:f64d43ff0c18 6 */
mbed_official 146:f64d43ff0c18 7
mbed_official 146:f64d43ff0c18 8 #ifdef __cplusplus
mbed_official 146:f64d43ff0c18 9 extern "C" {
mbed_official 146:f64d43ff0c18 10 #endif
mbed_official 146:f64d43ff0c18 11
mbed_official 146:f64d43ff0c18 12 #include <rt_misc.h>
mbed_official 146:f64d43ff0c18 13 #include <stdint.h>
mbed_official 146:f64d43ff0c18 14
mbed_official 146:f64d43ff0c18 15 extern char Image$$RW_IRAM1$$ZI$$Limit[];
mbed_official 146:f64d43ff0c18 16
mbed_official 146:f64d43ff0c18 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 146:f64d43ff0c18 18 uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
mbed_official 146:f64d43ff0c18 19 uint32_t sp_limit = __current_sp();
mbed_official 146:f64d43ff0c18 20
mbed_official 146:f64d43ff0c18 21 zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
mbed_official 146:f64d43ff0c18 22
mbed_official 146:f64d43ff0c18 23 struct __initial_stackheap r;
mbed_official 146:f64d43ff0c18 24 r.heap_base = zi_limit;
mbed_official 146:f64d43ff0c18 25 r.heap_limit = sp_limit;
mbed_official 146:f64d43ff0c18 26 return r;
mbed_official 146:f64d43ff0c18 27 }
mbed_official 146:f64d43ff0c18 28
mbed_official 146:f64d43ff0c18 29 #ifdef __cplusplus
mbed_official 146:f64d43ff0c18 30 }
mbed_official 146:f64d43ff0c18 31 #endif