Skip to content

Commit 4b5e5b2

Browse files
Pull up following revision(s) (requested by rin in ticket #1156):
sys/arch/arm/cortex/gicv3.c: revision 1.55 sys/arch/arm/cortex/gicv3.c: revision 1.56 gicv3: Appease KUBSAN, otherwise NFC gicv3: Some more left-shift v.s. int fixes Suggested by msaitoh@, thanks!
1 parent a088689 commit 4b5e5b2

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

sys/arch/arm/cortex/gicv3.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: gicv3.c,v 1.54 2022/06/26 11:14:36 jmcneill Exp $ */
1+
/* $NetBSD: gicv3.c,v 1.54.4.1 2025/09/05 09:23:01 martin Exp $ */
22

33
/*-
44
* Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca>
@@ -31,7 +31,7 @@
3131
#define _INTR_PRIVATE
3232

3333
#include <sys/cdefs.h>
34-
__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.54 2022/06/26 11:14:36 jmcneill Exp $");
34+
__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.54.4.1 2025/09/05 09:23:01 martin Exp $");
3535

3636
#include <sys/param.h>
3737
#include <sys/kernel.h>
@@ -57,8 +57,8 @@ __KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.54 2022/06/26 11:14:36 jmcneill Exp $");
5757
#define LPITOSOFTC(lpi) \
5858
container_of(lpi, struct gicv3_softc, sc_lpi)
5959

60-
#define IPL_TO_PRIORITY(sc, ipl) (((0xff - (ipl)) << (sc)->sc_priority_shift) & 0xff)
61-
#define IPL_TO_PMR(sc, ipl) (((0xff - (ipl)) << (sc)->sc_pmr_shift) & 0xff)
60+
#define IPL_TO_PRIORITY(sc, ipl) (((0xffU - (ipl)) << (sc)->sc_priority_shift) & 0xffU)
61+
#define IPL_TO_PMR(sc, ipl) (((0xffU - (ipl)) << (sc)->sc_pmr_shift) & 0xffU)
6262
#define IPL_TO_HWPL(ipl) ((ipl) >= IPL_VM ? (ipl) : IPL_NONE)
6363

6464
#define GIC_SUPPORTS_1OFN(sc) (((sc)->sc_gicd_typer & GICD_TYPER_No1N) == 0)
@@ -189,9 +189,9 @@ gicv3_establish_irq(struct pic_softc *pic, struct intrsource *is)
189189
for (n = 0; n < sc->sc_bsh_r_count; n++) {
190190
icfg = gicr_read_4(sc, n, GICR_ICFGRn(is->is_irq / 16));
191191
if (is->is_type == IST_LEVEL)
192-
icfg &= ~(0x2 << icfg_shift);
192+
icfg &= ~(0x2U << icfg_shift);
193193
if (is->is_type == IST_EDGE)
194-
icfg |= (0x2 << icfg_shift);
194+
icfg |= (0x2U << icfg_shift);
195195
gicr_write_4(sc, n, GICR_ICFGRn(is->is_irq / 16), icfg);
196196

197197
ipriority = gicr_read_4(sc, n, GICR_IPRIORITYRn(is->is_irq / 4));
@@ -214,9 +214,9 @@ gicv3_establish_irq(struct pic_softc *pic, struct intrsource *is)
214214
/* Update interrupt configuration */
215215
icfg = gicd_read_4(sc, GICD_ICFGRn(is->is_irq / 16));
216216
if (is->is_type == IST_LEVEL)
217-
icfg &= ~(0x2 << icfg_shift);
217+
icfg &= ~(0x2U << icfg_shift);
218218
if (is->is_type == IST_EDGE)
219-
icfg |= (0x2 << icfg_shift);
219+
icfg |= (0x2U << icfg_shift);
220220
gicd_write_4(sc, GICD_ICFGRn(is->is_irq / 16), icfg);
221221

222222
/* Update interrupt priority */
@@ -323,7 +323,7 @@ gicv3_redist_enable(struct gicv3_softc *sc, struct cpu_info *ci)
323323
for (n = 0, icfg = 0; n < 16; n++) {
324324
struct intrsource * const is = sc->sc_pic.pic_sources[16 + n];
325325
if (is != NULL && is->is_type == IST_EDGE)
326-
icfg |= (0x2 << (n * 2));
326+
icfg |= (0x2U << (n * 2));
327327
}
328328
gicr_write_4(sc, ci->ci_gic_redist, GICR_ICFGRn(1), icfg);
329329

0 commit comments

Comments
 (0)