1 | /* mbed Microcontroller Library
|
---|
2 | * Copyright (c) 2016 ARM Limited
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 | #ifndef MBED_MBED_RTX_H
|
---|
17 | #define MBED_MBED_RTX_H
|
---|
18 |
|
---|
19 | #include <stdint.h>
|
---|
20 |
|
---|
21 | #if defined(TARGET_RZ_A1H) || defined(TARGET_VK_RZ_A1H) || defined(TARGET_GR_LYCHEE)
|
---|
22 |
|
---|
23 | #if defined(__CC_ARM)
|
---|
24 | extern char Image$$ARM_LIB_STACK$$Base[];
|
---|
25 | extern char Image$$ARM_LIB_STACK$$ZI$$Limit[];
|
---|
26 | extern char Image$$ARM_LIB_HEAP$$Base[];
|
---|
27 | #define ISR_STACK_START ((unsigned char*)Image$$ARM_LIB_STACK$$Base)
|
---|
28 | #define ISR_STACK_SIZE ((uint32_t)((uint32_t)Image$$ARM_LIB_STACK$$ZI$$Limit - (uint32_t)Image$$ARM_LIB_STACK$$Base))
|
---|
29 | #define INITIAL_SP (Image$$ARM_LIB_STACK$$ZI$$Limit)
|
---|
30 | #define HEAP_START ((unsigned char*)Image$$ARM_LIB_HEAP$$Base)
|
---|
31 | #define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
|
---|
32 | #elif defined(__GNUC__)
|
---|
33 | extern uint32_t __StackTop;
|
---|
34 | extern uint32_t __StackLimit;
|
---|
35 | extern uint32_t __end__;
|
---|
36 | #define ISR_STACK_START ((unsigned char*)&__StackLimit)
|
---|
37 | #define ISR_STACK_SIZE ((uint32_t)((uint32_t)&__StackTop - (uint32_t)&__StackLimit))
|
---|
38 | #define INITIAL_SP (&__StackTop)
|
---|
39 | #define HEAP_START ((unsigned char*)&__end__)
|
---|
40 | #define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
|
---|
41 | #elif defined(__ICCARM__)
|
---|
42 | /* No region declarations needed */
|
---|
43 | #else
|
---|
44 | #error "no toolchain defined"
|
---|
45 | #endif
|
---|
46 | #endif
|
---|
47 |
|
---|
48 | #endif // MBED_MBED_RTX_H
|
---|