Skip to content

Commit a890e62

Browse files
GuEe-GUIRbb666
authored andcommitted
[DM/PIC] Fixup SMP CPU mask list when CPU < 4
Signed-off-by: GuEe-GUI <2991707448@qq.com>
1 parent 2995112 commit a890e62

File tree

1 file changed

+5
-1
lines changed
  • components/drivers/pic

1 file changed

+5
-1
lines changed

components/drivers/pic/pic.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ static int list_irq(int argc, char**argv)
11981198
_pic_name_max, "PIC",
11991199
12, "Mode",
12001200
#ifdef RT_USING_SMP
1201-
RT_CPUS_NR, "CPUs",
1201+
rt_max(RT_CPUS_NR, 4), "CPUs",
12021202
#else
12031203
0, 0,
12041204
#endif
@@ -1254,6 +1254,10 @@ static int list_irq(int argc, char**argv)
12541254

12551255
rt_kputs(info);
12561256
#ifdef RT_USING_SMP
1257+
if (RT_CPUS_NR < 4)
1258+
{
1259+
rt_memset(&cpumask[RT_CPUS_NR], ' ', 4 - RT_CPUS_NR);
1260+
}
12571261
rt_kputs(cpumask);
12581262
#endif
12591263

0 commit comments

Comments
 (0)