lib: utils/irqchip: Check before initializing imsic
authorCheng Yang <yangcheng.work@foxmail.com>
Wed, 15 May 2024 06:15:14 +0000 (14:15 +0800)
committerAnup Patel <anup@brainfault.org>
Thu, 16 May 2024 04:51:16 +0000 (10:21 +0530)
commite3a30a2c918aae79d4cc403d474c3d2872a9063c
tree172a226587819b5285eb8163bd159327de038d5a
parent2bed4c1c57a7775bcef534934cab5c83b45b954f
lib: utils/irqchip: Check before initializing imsic

The current mlevel imsic check is only for the platform, which
may cause hart without imsic in the platform to trigger an
illegal instruction exception when initializing imsic. For
example, the platform contains a management hart that only
supports wired interrupts.

This patch will check if each hart supports Smaia extension
before doing imsic initialization to avoid triggering illegal
instruction exceptions.

Signed-off-by: Cheng Yang <yangcheng.work@foxmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/utils/irqchip/imsic.c