mbed library sources. Supersedes mbed-src.
Fork of mbed by
targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_STD/sys.cpp@144:ef7eb2e8f9f7, 2016-09-02 (annotated)
- Committer:
- <>
- Date:
- Fri Sep 02 15:07:44 2016 +0100
- Revision:
- 144:ef7eb2e8f9f7
- Parent:
- 0:9b334a45a8ff
This updates the lib to the mbed lib v125
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 144:ef7eb2e8f9f7 | 1 | /* mbed Microcontroller Library - stackheap |
<> | 144:ef7eb2e8f9f7 | 2 | * Copyright (C) 2009-2011 ARM Limited. All rights reserved. |
<> | 144:ef7eb2e8f9f7 | 3 | * |
<> | 144:ef7eb2e8f9f7 | 4 | * Setup a fixed single stack/heap memory model, |
<> | 144:ef7eb2e8f9f7 | 5 | * between the top of the RW/ZI region and the stackpointer |
<> | 144:ef7eb2e8f9f7 | 6 | */ |
<> | 144:ef7eb2e8f9f7 | 7 | |
<> | 144:ef7eb2e8f9f7 | 8 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 9 | extern "C" { |
<> | 144:ef7eb2e8f9f7 | 10 | #endif |
<> | 144:ef7eb2e8f9f7 | 11 | |
<> | 144:ef7eb2e8f9f7 | 12 | #include <rt_misc.h> |
<> | 144:ef7eb2e8f9f7 | 13 | #include <stdint.h> |
<> | 144:ef7eb2e8f9f7 | 14 | |
<> | 144:ef7eb2e8f9f7 | 15 | extern char Image$$RW_IRAM1$$ZI$$Limit[]; |
<> | 144:ef7eb2e8f9f7 | 16 | |
<> | 144:ef7eb2e8f9f7 | 17 | extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) { |
<> | 144:ef7eb2e8f9f7 | 18 | uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit; |
<> | 144:ef7eb2e8f9f7 | 19 | uint32_t sp_limit = __current_sp(); |
<> | 144:ef7eb2e8f9f7 | 20 | |
<> | 144:ef7eb2e8f9f7 | 21 | zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned |
<> | 144:ef7eb2e8f9f7 | 22 | |
<> | 144:ef7eb2e8f9f7 | 23 | struct __initial_stackheap r; |
<> | 144:ef7eb2e8f9f7 | 24 | r.heap_base = zi_limit; |
<> | 144:ef7eb2e8f9f7 | 25 | r.heap_limit = sp_limit; |
<> | 144:ef7eb2e8f9f7 | 26 | return r; |
<> | 144:ef7eb2e8f9f7 | 27 | } |
<> | 144:ef7eb2e8f9f7 | 28 | |
<> | 144:ef7eb2e8f9f7 | 29 | #ifdef __cplusplus |
<> | 144:ef7eb2e8f9f7 | 30 | } |
<> | 144:ef7eb2e8f9f7 | 31 | #endif |