Skip to content

Commit 42562b9

Browse files
author
Andrew Boie
committed
xtensa: fix numerous checkpatch issues
Change-Id: I903f5f0692849fb9e7bf5d978b63b12bf1bd6e33 Signed-off-by: Andrew Boie <[email protected]>
1 parent 1e4e68b commit 42562b9

21 files changed

+1742
-1679
lines changed

arch/xtensa/core/atomic.S

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ atomic_get:
9292
* @brief Atomically increment a memory location
9393
*
9494
* This routine atomically increments the value in <target>. The operation is
95-
* done using unsigned integer arithmetic. Various CPU architectures may impose
96-
* restrictions with regards to the alignment and cache attributes of the
97-
* atomic_t type.
95+
* done using unsigned integer arithmetic. Various CPU architectures may
96+
* impose restrictions with regards to the alignment and cache attributes of
97+
* the atomic_t type.
9898
*
9999
* This routine can be used from both task and interrupt level.
100100
*
@@ -126,9 +126,9 @@ atomic_inc:
126126
* @brief Atomically add a value to a memory location
127127
*
128128
* This routine atomically adds the contents of <target> and <value>, placing
129-
* the result in <target>. The operation is done using signed integer arithmetic.
130-
* Various CPU architectures may impose restrictions with regards to the
131-
* alignment and cache attributes of the atomic_t type.
129+
* the result in <target>. The operation is done using signed integer
130+
* arithmetic. Various CPU architectures may impose restrictions with regards
131+
* to the alignment and cache attributes of the atomic_t type.
132132
*
133133
* This routine can be used from both task and interrupt level.
134134
*
@@ -369,10 +369,10 @@ atomic_xor:
369369
*
370370
* @brief Atomically compare-and-swap the contents of a memory location
371371
*
372-
* This routine performs an atomic compare-and-swap. testing that the contents of
373-
* <target> contains <oldValue>, and if it does, setting the value of <target>
374-
* to <newValue>. Various CPU architectures may impose restrictions with regards
375-
* to the alignment and cache attributes of the atomic_t type.
372+
* This routine performs an atomic compare-and-swap. testing that the contents
373+
* of <target> contains <oldValue>, and if it does, setting the value of
374+
* <target> to <newValue>. Various CPU architectures may impose restrictions
375+
* with regards to the alignment and cache attributes of the atomic_t type.
376376
*
377377
* This routine can be used from both task and interrupt level.
378378
*

arch/xtensa/core/crt1-boards.S

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ _start:
7979
* It is also the return address, where zero indicates
8080
* that the frame used by _start is the bottommost frame.
8181
*/
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
8385
movi a0, 0 /* keep this register zero. */
8486
#endif
8587

@@ -91,22 +93,25 @@ _start:
9193
* Initialize the stack pointer.
9294
* See the "ABI and Software Conventions" chapter in the
9395
* Xtensa ISA Reference manual for details.
94-
96+
*
9597
* NOTE: Because the _start routine does not use any memory in its
9698
* stack frame, and because all of its CALL instructions use a
9799
* window size of 4 (or zero), the stack frame for _start can be empty.
98100
*/
99101
movi sp, __stack
100102

101103
/*
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).
104107
*/
105108
#if XCHAL_HAVE_EXCEPTIONS
106109
# 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
108112
# 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
110115
# endif
111116
wsr a3, PS
112117
rsync
@@ -168,13 +173,13 @@ _start:
168173
addi a6, a6, 8 /* next entry */
169174
sub a10, a9, a8 /* a10 = length, assumed a multiple of 4 */
170175
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 */
172177
addi a8, a8, 4
173178
.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 */
175180
s32i a0, a8, 4
176181
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 */
178183
floopnez a10, clearzte
179184
s32i a0, a8, 0 /* clear 16 bytes at a time... */
180185
s32i a0, a8, 4
@@ -189,18 +194,19 @@ _start:
189194

190195

191196
/*
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.
193199
*
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#).
196202
*/
197203

198204
#if XCHAL_HAVE_HALT
199205

200206
/*
201207
* 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().
204210
*/
205211
CALL main
206212
halt
@@ -220,10 +226,8 @@ _start:
220226
*
221227
* void __clibrary_init(int argc, char ** argv, char ** environ,
222228
* void(*init_func)(void), void(*fini_func)(void));
229+
* Pass an empty argv array, with an empty string as the program name
223230
*/
224-
225-
* Pass an empty argv array, with an empty string as the program name. */
226-
227231
movi ARG1, _start_argc /* argc address */
228232
movi ARG2, _start_argv /* argv = ["", 0] */
229233
movi ARG3, _start_envp /* envp = [0] */
@@ -238,7 +242,9 @@ _start:
238242
movi ARG3, _start_envp /* envp = [0] */
239243
l32i ARG1, ARG1, 0 /* argc = 1 */
240244
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+
*/
242248
CALL exit /* exit with main's return value */
243249
/* Does not return here. */
244250

@@ -253,7 +259,8 @@ _start_argv:
253259
.word _start_null /* empty program name */
254260
_start_null:
255261
_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
257264
_start_argc:
258265
.word 1 /* one argument (program name) */
259266
.text

arch/xtensa/core/crt1-sim.S

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ __start:
111111
simcall /* returns size of argv[] + its strings in a2 */
112112
#if XCHAL_HAVE_PIF
113113
/*
114-
* The stack only needs 16-byte alignment.
115-
* However, here we round up the argv size further to 128 byte multiples
116-
* so that in most cases, variations in argv[0]'s path do not result in
117-
* different stack allocation. Otherwise, such variations can impact
118-
* execution timing (eg. due to cache effects etc) for the same code and data.
119-
* If we have a PIF, it's more likely the extra required space is okay.
114+
* The stack only needs 16-byte alignment. However, here we round up
115+
* the argv size further to 128 byte multiples so that in most cases,
116+
* variations in argv[0]'s path do not result in different stack
117+
* allocation. Otherwise, such variations can impact execution timing
118+
* (eg. due to cache effects etc) for the same code and data. If we
119+
* have a PIF, it's more likely the extra required space is okay.
120120
*/
121121
addi a2, a2, 127
122122
srli a2, a2, 7
@@ -139,14 +139,17 @@ __start:
139139

140140

141141
/*
142-
* Now that sp (a1) is set, we can set PS as per the application
143-
* (user vector mode, enable interrupts, enable window exceptions if applicable).
142+
* Now that sp (a1) is set, we can set PS as per the application (user
143+
* vector mode, enable interrupts, enable window exceptions if
144+
* applicable).
144145
*/
145146
#if XCHAL_HAVE_EXCEPTIONS
146147
# ifdef __XTENSA_CALL0_ABI__
147-
movi a3, PS_UM /* PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
148+
/* PS.WOE = 0, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
149+
movi a3, PS_UM
148150
# else
149-
movi a3, PS_UM|PS_WOE /* PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
151+
/* PS.WOE = 1, PS.UM = 1, PS.EXCM = 0, PS.INTLEVEL = 0 */
152+
movi a3, PS_UM|PS_WOE
150153
# endif
151154
wsr a3, PS
152155
rsync
@@ -180,9 +183,11 @@ __start:
180183
CALLX a4
181184
1:
182185

183-
184186
/* The new ISS simcall only appeared after RB-2007.2: */
185-
#if !XCHAL_HAVE_BOOTLOADER && (XCHAL_HW_MAX_VERSION > XTENSA_HWVERSION_RB_2007_2) /* pre-LX2 cores only */
187+
188+
#if !XCHAL_HAVE_BOOTLOADER && \
189+
(XCHAL_HW_MAX_VERSION > XTENSA_HWVERSION_RB_2007_2)
190+
/* pre-LX2 cores only */
186191
/*
187192
* Clear the BSS (uninitialized data) segments.
188193
* This code supports multiple zeroed sections (*.bss).
@@ -223,7 +228,9 @@ __start:
223228

224229
/* Call: int _Cstart(); */
225230
CALL _Cstart
226-
/* The return value is the same register as the first outgoing argument. */
231+
/* The return value is the same register as the first outgoing
232+
* argument.
233+
*/
227234
CALL exit
228235
/* Does not return here. */
229236

arch/xtensa/core/irq_manage.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*
1616
* The priority is verified if ASSERT_ON is enabled.
1717
*
18-
* The priority is verified if ASSERT_ON is enabled. The maximum number
19-
* of priority levels is a little complex, as there are some hardware
20-
* priority levels which are reserved: three for various types of exceptions,
21-
* and possibly one additional to support zero latency interrupts.
18+
* The priority is verified if ASSERT_ON is enabled. The maximum number of
19+
* priority levels is a little complex, as there are some hardware priority
20+
* levels which are reserved: three for various types of exceptions, and
21+
* possibly one additional to support zero latency interrupts.
2222
*
2323
* Valid values are from 1 to 6. Interrupts of priority 1 are not masked when
24-
* interrupts are locked system-wide, so care must be taken when using them. ISR
25-
* installed with priority 0 interrupts cannot make kernel calls.
24+
* interrupts are locked system-wide, so care must be taken when using them.
25+
* ISR installed with priority 0 interrupts cannot make kernel calls.
2626
*
2727
* @return N/A
2828
*/
@@ -32,5 +32,7 @@ void _irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
3232
__ASSERT(prio < XCHAL_EXCM_LEVEL + 1,
3333
"invalid priority %d! values must be less than %d\n",
3434
prio, XCHAL_EXCM_LEVEL + 1);
35-
/* TODO: Write code to set priority if this is ever possible on Xtensa */
35+
/* TODO: Write code to set priority if this is ever possible on
36+
* Xtensa
37+
*/
3638
}

arch/xtensa/core/irq_offload.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
* Xtensa core should support software interrupt in order to allow using
1313
* irq_offload feature
1414
*/
15-
#ifndef CONFIG_IRQ_OFFLOAD_INTNUM
16-
#error "Please add entry for IRQ_OFFLOAD_INTNUM option to your arch/xtensa/soc/${XTENSA_CORE}/Kconfig file in order to use IRQ offload on this core."
17-
#endif
1815

1916
static irq_offload_routine_t offload_routine;
2017
static void *offload_param;

0 commit comments

Comments
 (0)