]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC176X/TOOLCHAIN_GCC_CS/sys.cpp
9 unsigned long* InitRam
;
10 unsigned long* StartRam
;
11 unsigned long InitSizeRam
;
12 unsigned long ZeroSizeRam
;
15 extern unsigned long __cs3_regions
;
16 extern unsigned long __cs3_heap_start
;
19 void __libc_init_array(void);
20 void exit(int ErrorCode
);
22 static void *heap_pointer
= NULL
;
24 void __cs3_start_c(void) {
25 static SCS3Regions
* pCS3Regions
= (SCS3Regions
*)&__cs3_regions
;
26 unsigned long* pulDest
;
27 unsigned long* pulSrc
;
28 unsigned long ByteCount
;
31 pulSrc
= pCS3Regions
->InitRam
;
32 pulDest
= pCS3Regions
->StartRam
;
33 ByteCount
= pCS3Regions
->InitSizeRam
;
34 if (pulSrc
!= pulDest
) {
35 for(i
= 0 ; i
< ByteCount
; i
+= sizeof(unsigned long)) {
36 *(pulDest
++) = *(pulSrc
++);
39 pulDest
= (unsigned long*)(void*)((char*)pulDest
+ ByteCount
);
42 ByteCount
= pCS3Regions
->ZeroSizeRam
;
43 for(i
= 0 ; i
< ByteCount
; i
+= sizeof(unsigned long)) {
47 heap_pointer
= &__cs3_heap_start
;
53 int _kill(int pid
, int sig
) {
58 void _exit(int status
) {
66 void *_sbrk(unsigned int incr
) {
69 unsigned int next
= ((((unsigned int)heap_pointer
+ incr
) + 7) & ~7);
70 if (next
> __get_MSP()) {
73 mem
= (void *)heap_pointer
;
75 heap_pointer
= (void *)next
;