Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
targets/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/device/TOOLCHAIN_ARM_MICRO/sys.cpp@153:da99e106a1c2, 2016-12-21 (annotated)
- Committer:
- fwndz
- Date:
- Wed Dec 21 13:29:33 2016 +0000
- Revision:
- 153:da99e106a1c2
- Parent:
- 149:156823d33999
init
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 |