|
1 | 1 | /******************************************************************************* |
2 | 2 | @file startup.h |
3 | 3 | @author Rajmund Szymanski |
4 | | -@date 11.12.2019 |
| 4 | +@date 03.01.2020 |
5 | 5 | @brief Startup file header for armclang compiler. |
6 | 6 | *******************************************************************************/ |
7 | 7 |
|
8 | 8 | #pragma once |
9 | 9 |
|
10 | | -#define NUM(n) #n"\n" |
11 | | -#define STR(n) NUM(n) |
12 | | - |
13 | | -/******************************************************************************* |
14 | | - Configuration of stacks and heap |
15 | | -*******************************************************************************/ |
16 | | - |
17 | | -#define __main_stack_size (((main_stack_size)+7)&(~7)) |
18 | | -#define __proc_stack_size (((proc_stack_size)+7)&(~7)) |
19 | | - |
20 | | -__attribute__ ((naked)) |
21 | | -void __user_stacks_and_heap_config( void ) |
22 | | -{ |
23 | | - __asm volatile |
24 | | - ( |
25 | | -" .pushsection .heap, \"w\",\"nobits\"\n" |
26 | | -"__heap_base = . \n" |
27 | | -"__heap_limit = "STR(RAM_end - __proc_stack_size) |
28 | | -" .popsection \n" |
29 | | - #if __main_stack_size > 0 |
30 | | -" .pushsection .stack,\"w\",\"nobits\"\n" |
31 | | -" .align 3 \n" |
32 | | -" .space "STR(__main_stack_size) |
33 | | -"__initial_msp = . \n" |
34 | | -" .popsection \n" |
35 | | - #else |
36 | | -"__initial_msp = __heap_limit \n" |
37 | | - #endif |
38 | | - #if __proc_stack_size > 0 |
39 | | -" .pushsection .heap, \"w\",\"nobits\"\n" |
40 | | -" .align 3 \n" |
41 | | -" .space "STR(__proc_stack_size) |
42 | | -" .popsection \n" |
43 | | -"__initial_sp = "STR(RAM_end) |
44 | | - #else |
45 | | -"__initial_sp = __initial_msp \n" |
46 | | - #endif |
47 | | - |
48 | | - #if __proc_stack_size > 0 |
49 | | - #ifndef __MICROLIB |
50 | | -" .global __use_two_region_memory\n" |
51 | | - #endif |
52 | | - #endif |
53 | | - |
54 | | -" .global __heap_base \n" |
55 | | -" .global __heap_limit \n" |
56 | | -" .global __initial_msp \n" |
57 | | -" .global __initial_sp \n" |
58 | | - ); |
59 | | -} |
60 | | - |
61 | 10 | /******************************************************************************* |
62 | 11 | Additional definitions |
63 | 12 | *******************************************************************************/ |
|
0 commit comments