Skip to content

Commit d5b83ae

Browse files
Andrew Boienashif
authored andcommitted
arc: use different load instruction
If the offset within the thread struct to the ARC arch-specific 'relinquish_cause' member is too large, ld_s instructions referencing it will not compile. This happens easily if CONFIG_THREAD_NAME reserves a name buffer within the thread struct, since all the arch-specific members come last. Use the regular 'ld' instruction instead. Signed-off-by: Andrew Boie <[email protected]>
1 parent c9f0148 commit d5b83ae

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

arch/arc/core/fast_irq.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ _firq_reschedule:
267267
pop_s r2
268268
#endif
269269

270-
ld_s r3, [r2, _thread_offset_to_relinquish_cause]
270+
ld r3, [r2, _thread_offset_to_relinquish_cause]
271271

272272
breq r3, _CAUSE_RIRQ, _firq_return_from_rirq
273273
nop
@@ -279,7 +279,7 @@ _firq_reschedule:
279279
.balign 4
280280
_firq_return_from_coop:
281281

282-
ld_s r3, [r2, _thread_offset_to_intlock_key]
282+
ld r3, [r2, _thread_offset_to_intlock_key]
283283
st 0, [r2, _thread_offset_to_intlock_key]
284284

285285
/* pc into ilink */
@@ -298,7 +298,7 @@ _firq_return_from_coop:
298298
or.nz r0, r0, _ARC_V2_STATUS32_IE
299299
sr r0, [_ARC_V2_STATUS32_P0]
300300

301-
ld_s r0, [r2, _thread_offset_to_return_value]
301+
ld r0, [r2, _thread_offset_to_return_value]
302302
rtie
303303

304304
.balign 4

arch/arc/core/regular_irq.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ _rirq_common_interrupt_swap:
181181
pop_s r2
182182
#endif
183183

184-
ld_s r3, [r2, _thread_offset_to_relinquish_cause]
184+
ld r3, [r2, _thread_offset_to_relinquish_cause]
185185

186186
breq r3, _CAUSE_RIRQ, _rirq_return_from_rirq
187187
nop
@@ -201,7 +201,7 @@ _rirq_return_from_coop:
201201

202202
/* update status32.ie (explanation in firq_exit:_firq_return_from_coop) */
203203

204-
ld_s r3, [r2, _thread_offset_to_intlock_key]
204+
ld r3, [r2, _thread_offset_to_intlock_key]
205205
st 0, [r2, _thread_offset_to_intlock_key]
206206
cmp r3, 0
207207
or.ne r0, r0, _ARC_V2_STATUS32_IE
@@ -212,7 +212,7 @@ _rirq_return_from_coop:
212212
sub sp, sp, ___isf_t_pc_OFFSET
213213

214214
/* update return value on stack */
215-
ld_s r0, [r2, _thread_offset_to_return_value]
215+
ld r0, [r2, _thread_offset_to_return_value]
216216
st_s r0, [sp, ___isf_t_r0_OFFSET]
217217

218218
/* reset zero-overhead loops */

arch/arc/core/swap.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ SECTION_FUNC(TEXT, __swap)
8282
ld_s r2, [r1, _kernel_offset_to_current]
8383

8484
/* save intlock key */
85-
st_s r0, [r2, _thread_offset_to_intlock_key]
85+
st r0, [r2, _thread_offset_to_intlock_key]
8686
st _CAUSE_COOP, [r2, _thread_offset_to_relinquish_cause]
8787

8888
/*
@@ -92,7 +92,7 @@ SECTION_FUNC(TEXT, __swap)
9292
* z_set_thread_return_value().
9393
*/
9494
ld r3, [_k_neg_eagain]
95-
st_s r3, [r2, _thread_offset_to_return_value]
95+
st r3, [r2, _thread_offset_to_return_value]
9696

9797
/*
9898
* Save status32 and blink on the stack before the callee-saved registers.
@@ -142,7 +142,7 @@ SECTION_FUNC(TEXT, __swap)
142142
pop_s r2
143143
#endif
144144

145-
ld_s r3, [r2, _thread_offset_to_relinquish_cause]
145+
ld r3, [r2, _thread_offset_to_relinquish_cause]
146146

147147
breq r3, _CAUSE_RIRQ, _swap_return_from_rirq
148148
nop
@@ -154,9 +154,9 @@ SECTION_FUNC(TEXT, __swap)
154154
.balign 4
155155
_swap_return_from_coop:
156156

157-
ld_s r1, [r2, _thread_offset_to_intlock_key]
157+
ld r1, [r2, _thread_offset_to_intlock_key]
158158
st 0, [r2, _thread_offset_to_intlock_key]
159-
ld_s r0, [r2, _thread_offset_to_return_value]
159+
ld r0, [r2, _thread_offset_to_return_value]
160160

161161
lr ilink, [_ARC_V2_STATUS32]
162162
bbit1 ilink, _ARC_V2_STATUS32_AE_BIT, _return_from_exc

0 commit comments

Comments
 (0)