4 #define XGLUE(a,b) a##b
5 #define GLUE(a,b) XGLUE(a,b)
7 #ifdef __USER_LABEL_PREFIX__
8 #define SYM_NAME( name ) GLUE (__USER_LABEL_PREFIX__, name)
10 #error __USER_LABEL_PREFIX is not defined
14 /* Setup the assembly entry point. */
16 .globl SYM_NAME(start)
17 .globl SYM_NAME(_start)
20 mov fp, #0 /* Null frame pointer. */
21 mov r7, #0 /* Null frame pointer for Thumb. */
23 /* Enable interrupts for gdb debugging. */
28 mov a2, #0 /* Second arg: fill value. */
29 ldr a1, .LC1 /* First arg: start of memory block. */
31 sub a3, a3, a1 /* Third arg: length of block. */
34 /* Zero out the bss without using memset.
35 Using memset is bad because it may be instrumented for
36 profiling, but at this point, the profiling data structures
38 FIXME: This loop could be a lot more efficient. */
46 /* Nothing to left to clear. */
49 #ifdef __thumb__ /* Enter Thumb mode. */
50 add a4, pc, #1 /* Get the address of the Thumb block. */
51 bx a4 /* Go there and start Thumb decoding. */
62 bl SYM_NAME(__get_memtop)
66 #ifdef __USES_INITFINI__
67 /* Some arm/elf targets use the .init and .fini sections
68 to create constructors and destructors, and for these
69 targets we need to call the _init function and arrange
70 for _fini to be called at program exit. */
89 #ifdef __USES_INITFINI__
97 .global SYM_NAME(__syscall)