File tree Expand file tree Collapse file tree 2 files changed +12
-36
lines changed
Expand file tree Collapse file tree 2 files changed +12
-36
lines changed Original file line number Diff line number Diff line change 3333 *---------------------------------------------------------------------------*/
3434
3535#if defined (__CC_ARM )
36+ #include <rt_misc.h>
3637#pragma O3
3738#define __USED __attribute__((used))
3839#elif defined (__GNUC__ )
@@ -442,25 +443,12 @@ void pre_main()
442443void * armcc_heap_base ;
443444void * armcc_heap_top ;
444445
445- __asm void pre_main (void )
446- {
447- IMPORT __rt_lib_init
448- IMPORT main
449- IMPORT armcc_heap_base
450- IMPORT armcc_heap_top
446+ int main (void );
451447
452- LDR R0 ,= armcc_heap_base
453- LDR R1 ,= armcc_heap_top
454- LDR R0 , [R0 ]
455- LDR R1 , [R1 ]
456- /* Save link register (keep 8 byte alignment with dummy R4) */
457- PUSH {R4 , LR }
458- BL __rt_lib_init
459- BL main
460- /* Return to the thread destroy function.
461- */
462- POP {R4 , PC }
463- ALIGN
448+ void pre_main (void )
449+ {
450+ __rt_lib_init ((unsigned )armcc_heap_base , (unsigned )armcc_heap_top );
451+ main ();
464452}
465453
466454__asm void __rt_entry (void ) {
Original file line number Diff line number Diff line change 3434#include "mbed_error.h"
3535
3636#if defined (__CC_ARM )
37+ #include <rt_misc.h>
3738#pragma O3
3839#define __USED __attribute__((used))
3940#elif defined (__GNUC__ )
@@ -593,25 +594,12 @@ void pre_main()
593594void * armcc_heap_base ;
594595void * armcc_heap_top ;
595596
596- __asm void pre_main (void )
597- {
598- IMPORT __rt_lib_init
599- IMPORT main
600- IMPORT armcc_heap_base
601- IMPORT armcc_heap_top
597+ int main (void );
602598
603- LDR R0 ,= armcc_heap_base
604- LDR R1 ,= armcc_heap_top
605- LDR R0 , [R0 ]
606- LDR R1 , [R1 ]
607- /* Save link register (keep 8 byte alignment with dummy R4) */
608- PUSH {R4 , LR }
609- BL __rt_lib_init
610- BL main
611- /* Return to the thread destroy function.
612- */
613- POP {R4 , PC }
614- ALIGN
599+ void pre_main (void )
600+ {
601+ __rt_lib_init ((unsigned )armcc_heap_base , (unsigned )armcc_heap_top );
602+ main ();
615603}
616604
617605/* The single memory model is checking for stack collision at run time, verifing
You can’t perform that action at this time.
0 commit comments