5 #define XGLUE(a,b) a##b
6 #define GLUE(a,b) XGLUE(a,b)
8 #ifdef __USER_LABEL_PREFIX__
9 #define SYM_NAME( name ) GLUE (__USER_LABEL_PREFIX__, name)
11 #error __USER_LABEL_PREFIX is not defined
16 /* Setup the assembly entry point. */
18 .macro FUNC_START name
25 .macro FUNC_START name
31 FUNC_START SYM_NAME(_start)
32 /* Unnecessary to set fp for v6-m/v7-m, which don't support
34 #if __ARM_ARCH_ISA_ARM
35 mov fp, #0 /* Null frame pointer. */
37 movs r7, #0 /* Null frame pointer for Thumb. */
39 /* Enable interrupts for gdb debugging. */
48 movs a2, #0 /* Second arg: fill value. */
49 ldr a1, .LC1 /* First arg: start of memory block. */
51 subs a3, a3, a1 /* Third arg: length of block. */
54 /* Zero out the bss without using memset.
55 Using memset is bad because it may be instrumented for
56 profiling, but at this point, the profiling data structures
58 FIXME: This loop could be a lot more efficient. */
66 /* Nothing to left to clear. */
69 #if __thumb__ && !defined(PREFER_THUMB)
70 /* Enter Thumb mode. */
71 add a4, pc, #1 /* Get the address of the Thumb block. */
72 bx a4 /* Go there and start Thumb decoding. */
83 bl SYM_NAME(__get_memtop)
87 #ifdef __USES_INITFINI__
88 /* Some arm/elf targets use the .init and .fini sections
89 to create constructors and destructors, and for these
90 targets we need to call the _init function and arrange
91 for _fini to be called at program exit. */
110 #ifdef __USES_INITFINI__
112 .word SYM_NAME(_fini)
118 .global SYM_NAME(__syscall)