Skip to content

Commit 022b0ef

Browse files
committed
xtensa: properly compute irq number
This is a miss from: abeccfe xtensa: support for more than 32 interrupts Signed-off-by: William Tambe <williamt@cadence.com>
1 parent f0cbba0 commit 022b0ef

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

include/zephyr/arch/xtensa/irq.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,19 @@ static ALWAYS_INLINE void xtensa_irq_enable(uint32_t irq)
199199
#if XCHAL_NUM_INTERRUPTS > 32
200200
switch (irq >> 5) {
201201
case 0:
202-
z_xt_ints_on(1 << irq);
202+
z_xt_ints_on(1 << (irq&0x1f));
203203
break;
204204
case 1:
205-
z_xt_ints1_on(1 << irq);
205+
z_xt_ints1_on(1 << (irq&0x1f));
206206
break;
207207
#if XCHAL_NUM_INTERRUPTS > 64
208208
case 2:
209-
z_xt_ints2_on(1 << irq);
209+
z_xt_ints2_on(1 << (irq&0x1f));
210210
break;
211211
#endif
212212
#if XCHAL_NUM_INTERRUPTS > 96
213213
case 3:
214-
z_xt_ints3_on(1 << irq);
214+
z_xt_ints3_on(1 << (irq&0x1f));
215215
break;
216216
#endif
217217
default:
@@ -232,19 +232,19 @@ static ALWAYS_INLINE void xtensa_irq_disable(uint32_t irq)
232232
#if XCHAL_NUM_INTERRUPTS > 32
233233
switch (irq >> 5) {
234234
case 0:
235-
z_xt_ints_off(1 << irq);
235+
z_xt_ints_off(1 << (irq&0x1f));
236236
break;
237237
case 1:
238-
z_xt_ints1_off(1 << irq);
238+
z_xt_ints1_off(1 << (irq&0x1f));
239239
break;
240240
#if XCHAL_NUM_INTERRUPTS > 64
241241
case 2:
242-
z_xt_ints2_off(1 << irq);
242+
z_xt_ints2_off(1 << (irq&0x1f));
243243
break;
244244
#endif
245245
#if XCHAL_NUM_INTERRUPTS > 96
246246
case 3:
247-
z_xt_ints3_off(1 << irq);
247+
z_xt_ints3_off(1 << (irq&0x1f));
248248
break;
249249
#endif
250250
default:

subsys/testsuite/include/zephyr/interrupt_util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,19 @@ static inline void trigger_irq(int irq)
194194
#if XCHAL_NUM_INTERRUPTS > 32
195195
switch (irq >> 5) {
196196
case 0:
197-
z_xt_set_intset(1 << irq);
197+
z_xt_set_intset(1 << (irq&0x1f));
198198
break;
199199
case 1:
200-
z_xt_set_intset1(1 << irq);
200+
z_xt_set_intset1(1 << (irq&0x1f));
201201
break;
202202
#if XCHAL_NUM_INTERRUPTS > 64
203203
case 2:
204-
z_xt_set_intset2(1 << irq);
204+
z_xt_set_intset2(1 << (irq&0x1f));
205205
break;
206206
#endif
207207
#if XCHAL_NUM_INTERRUPTS > 96
208208
case 3:
209-
z_xt_set_intset3(1 << irq);
209+
z_xt_set_intset3(1 << (irq&0x1f));
210210
break;
211211
#endif
212212
default:

0 commit comments

Comments
 (0)