forked from wosayttn/lv_port_nuvoton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstandalone.c
62 lines (50 loc) · 1.38 KB
/
standalone.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* standalone.c - minimal bootstrap for C library
* Copyright (C) 2000 ARM Limited.
* All rights reserved.
*/
/*
* RCS $Revision: 1 $
* Checkin $Date: 07/07/05 2:54p $ 0
* Revising $Author: Sjlu0 $
*/
/*
* This code defines a run-time environment for the C library.
* Without this, the C startup code will attempt to use semi-hosting
* calls to get environment information.
*/
extern unsigned int Image$$ZI$$Limit;
void _sys_exit(int return_code)
{
label:
goto label; /* endless loop */
}
void _ttywrch(int ch)
{
char tempch = (char)ch;
(void)tempch;
}
#pragma import(__use_two_region_memory)
__value_in_regs struct R0_R3
{
unsigned heap_base, stack_base, heap_limit, stack_limit;
}
__user_initial_stackheap(unsigned int R0, unsigned int SP, unsigned int R2, unsigned int SL)
{
struct R0_R3 config;
//config.heap_base = 0x00060000;
config.heap_base = (unsigned int)&Image$$ZI$$Limit;
config.stack_base = SP;
config.heap_limit = SP - 0x8000;
/*
To place heap_base directly above the ZI area, use:
extern unsigned int Image$$ZI$$Limit;
config.heap_base = (unsigned int)&Image$$ZI$$Limit;
(or &Image$$region_name$$ZI$$Limit for scatterloaded images)
To specify the limits for the heap & stack, use e.g:
config.heap_limit = SL;
config.stack_limit = SL;
*/
return config;
}
/* end of file standalone.c */