@@ -79,7 +79,9 @@ _start:
79
79
* It is also the return address, where zero indicates
80
80
* that the frame used by _start is the bottommost frame.
81
81
*/
82
- #if !XCHAL_HAVE_HALT || !XCHAL_HAVE_BOOTLOADER /* not needed for Xtensa TX */
82
+
83
+ /* not needed for Xtensa TX */
84
+ #if !XCHAL_HAVE_HALT || !XCHAL_HAVE_BOOTLOADER
83
85
movi a0 , 0 /* keep this register zero. */
84
86
#endif
85
87
@@ -91,22 +93,25 @@ _start:
91
93
* Initialize the stack pointer.
92
94
* See the "ABI and Software Conventions" chapter in the
93
95
* Xtensa ISA Reference manual for details.
94
-
96
+ *
95
97
* NOTE: Because the _start routine does not use any memory in its
96
98
* stack frame, and because all of its CALL instructions use a
97
99
* window size of 4 (or zero), the stack frame for _start can be empty.
98
100
*/
99
101
movi sp , __stack
100
102
101
103
/*
102
- * Now that sp (a1) is set, we can set PS as per the application
103
- * (user vector mode, enable interrupts, enable window exceptions if applicable).
104
+ * Now that sp (a1) is set, we can set PS as per the application (user
105
+ * vector mode, enable interrupts, enable window exceptions if
106
+ * applicable).
104
107
*/
105
108
#if XCHAL_HAVE_EXCEPTIONS
106
109
# ifdef __XTENSA_CALL0_ABI__
107
- movi a3 , PS_UM /* PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
110
+ /* PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
111
+ movi a3 , PS_UM
108
112
# else
109
- movi a3 , PS_UM|PS_WOE /* PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
113
+ /* PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
114
+ movi a3 , PS_UM|PS_WOE
110
115
# endif
111
116
wsr a3 , PS
112
117
rsync
@@ -168,13 +173,13 @@ _start:
168
173
addi a6 , a6 , 8 /* next entry */
169
174
sub a10, a9, a8 /* a10 = length, assumed a multiple of 4 */
170
175
bbci.l a10, 2 , .L1zte
171
- s32i a0 , a8, 0 /* clear 4 bytes to make length multiple of 8 */
176
+ s32i a0 , a8, 0 /* clear 4 bytes to make len multiple of 8 */
172
177
addi a8, a8, 4
173
178
.L1zte: bbci.l a10, 3 , .L2zte
174
- s32i a0 , a8, 0 /* clear 8 bytes to make length multiple of 16 */
179
+ s32i a0 , a8, 0 /* clear 8 bytes to make len multiple of 16 */
175
180
s32i a0 , a8, 4
176
181
addi a8, a8, 8
177
- .L2zte: srli a10, a10, 4 /* length is now multiple of 16, divide by 16 */
182
+ .L2zte: srli a10, a10, 4 /* len is now multiple of 16, divide by 16 */
178
183
floopnez a10, clearzte
179
184
s32i a0 , a8, 0 /* clear 16 bytes at a time... */
180
185
s32i a0 , a8, 4
@@ -189,18 +194,19 @@ _start:
189
194
190
195
191
196
/*
192
- * We can now call C code, the C calling environment has been initialized.
197
+ * We can now call C code, the C calling environment has been
198
+ * initialized.
193
199
*
194
- * From this point on, we use ABI-specific macros to refer to registers a0 .. a15
195
- * (ARG#).
200
+ * From this point on, we use ABI-specific macros to refer to
201
+ * registers a0 .. a15 (ARG#).
196
202
*/
197
203
198
204
#if XCHAL_HAVE_HALT
199
205
200
206
/*
201
207
* Assume minimalist environment for memory-constrained TX cores.
202
- * No C library or board initialization, no parameters passed to main
203
- * (assume declared as "void main(void)") and no call to exit().
208
+ * No C library or board initialization, no parameters passed to main
209
+ * (assume declared as "void main(void)") and no call to exit().
204
210
*/
205
211
CALL main
206
212
halt
@@ -220,10 +226,8 @@ _start:
220
226
*
221
227
* void __clibrary_init(int argc, char ** argv, char ** environ,
222
228
* void(*init_func)(void), void(*fini_func)(void));
229
+ * Pass an empty argv array, with an empty string as the program name
223
230
*/
224
-
225
- * Pass an empty argv array, with an empty string as the program name. */
226
-
227
231
movi ARG1, _start_argc /* argc address */
228
232
movi ARG2, _start_argv /* argv = ["", 0] */
229
233
movi ARG3, _start_envp /* envp = [0] */
@@ -238,7 +242,9 @@ _start:
238
242
movi ARG3, _start_envp /* envp = [0] */
239
243
l32i ARG1, ARG1, 0 /* argc = 1 */
240
244
CALL main
241
- /* The return value is the same register as the first outgoing argument. */
245
+ /* The return value is the same register as the first
246
+ * outgoing argument.
247
+ */
242
248
CALL exit /* exit with main's return value */
243
249
/* Does not return here. */
244
250
@@ -253,7 +259,8 @@ _start_argv:
253
259
.word _start_null /* empty program name */
254
260
_start_null:
255
261
_start_envp:
256
- .word 0 /* end of argv array, empty string, empty environ */
262
+ /* end of argv array, empty string, empty environ */
263
+ .word 0
257
264
_start_argc:
258
265
.word 1 /* one argument (program name) */
259
266
.text
0 commit comments