mirror of https://github.com/ARMmbed/mbed-os.git
Update ARMCC pre_main to be in C
Switch pre_main from assembly to C for ARMCC. This function does not need to be in assembly.pull/2158/head
parent
38ae4f9289
commit
d4627176da
|
@ -33,6 +33,7 @@
|
|||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#if defined (__CC_ARM)
|
||||
#include <rt_misc.h>
|
||||
#pragma O3
|
||||
#define __USED __attribute__((used))
|
||||
#elif defined (__GNUC__)
|
||||
|
@ -442,25 +443,12 @@ void pre_main()
|
|||
void * armcc_heap_base;
|
||||
void * armcc_heap_top;
|
||||
|
||||
__asm void pre_main (void)
|
||||
{
|
||||
IMPORT __rt_lib_init
|
||||
IMPORT main
|
||||
IMPORT armcc_heap_base
|
||||
IMPORT armcc_heap_top
|
||||
int main(void);
|
||||
|
||||
LDR R0,=armcc_heap_base
|
||||
LDR R1,=armcc_heap_top
|
||||
LDR R0,[R0]
|
||||
LDR R1,[R1]
|
||||
/* Save link register (keep 8 byte alignment with dummy R4) */
|
||||
PUSH {R4, LR}
|
||||
BL __rt_lib_init
|
||||
BL main
|
||||
/* Return to the thread destroy function.
|
||||
*/
|
||||
POP {R4, PC}
|
||||
ALIGN
|
||||
void pre_main (void)
|
||||
{
|
||||
__rt_lib_init((unsigned)armcc_heap_base, (unsigned)armcc_heap_top);
|
||||
main();
|
||||
}
|
||||
|
||||
__asm void __rt_entry (void) {
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "mbed_error.h"
|
||||
|
||||
#if defined (__CC_ARM)
|
||||
#include <rt_misc.h>
|
||||
#pragma O3
|
||||
#define __USED __attribute__((used))
|
||||
#elif defined (__GNUC__)
|
||||
|
@ -593,25 +594,12 @@ void pre_main()
|
|||
void * armcc_heap_base;
|
||||
void * armcc_heap_top;
|
||||
|
||||
__asm void pre_main (void)
|
||||
{
|
||||
IMPORT __rt_lib_init
|
||||
IMPORT main
|
||||
IMPORT armcc_heap_base
|
||||
IMPORT armcc_heap_top
|
||||
int main(void);
|
||||
|
||||
LDR R0,=armcc_heap_base
|
||||
LDR R1,=armcc_heap_top
|
||||
LDR R0,[R0]
|
||||
LDR R1,[R1]
|
||||
/* Save link register (keep 8 byte alignment with dummy R4) */
|
||||
PUSH {R4, LR}
|
||||
BL __rt_lib_init
|
||||
BL main
|
||||
/* Return to the thread destroy function.
|
||||
*/
|
||||
POP {R4, PC}
|
||||
ALIGN
|
||||
void pre_main (void)
|
||||
{
|
||||
__rt_lib_init((unsigned)armcc_heap_base, (unsigned)armcc_heap_top);
|
||||
main();
|
||||
}
|
||||
|
||||
/* The single memory model is checking for stack collision at run time, verifing
|
||||
|
|
Loading…
Reference in New Issue