From c79b00e323efc84c2df057a963d7165a6050b8fb Mon Sep 17 00:00:00 2001 From: GuEe-GUI <2991707448@qq.com> Date: Mon, 1 Dec 2025 17:11:57 +0800 Subject: [PATCH] [DM/PIC] Fixup SMP CPU mask list when CPU < 4 Signed-off-by: GuEe-GUI <2991707448@qq.com> --- components/drivers/pic/pic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/drivers/pic/pic.c b/components/drivers/pic/pic.c index 66834944287..4194692fd1d 100644 --- a/components/drivers/pic/pic.c +++ b/components/drivers/pic/pic.c @@ -1198,7 +1198,7 @@ static int list_irq(int argc, char**argv) _pic_name_max, "PIC", 12, "Mode", #ifdef RT_USING_SMP - RT_CPUS_NR, "CPUs", + rt_max(RT_CPUS_NR, 4), "CPUs", #else 0, 0, #endif @@ -1254,6 +1254,10 @@ static int list_irq(int argc, char**argv) rt_kputs(info); #ifdef RT_USING_SMP + if (RT_CPUS_NR < 4) + { + rt_memset(&cpumask[RT_CPUS_NR], ' ', 4 - RT_CPUS_NR); + } rt_kputs(cpumask); #endif