Explorar el Código

[DM/PIC] Fixup SMP CPU mask list when CPU < 4

Signed-off-by: GuEe-GUI <2991707448@qq.com>
GuEe-GUI hace 1 mes
padre
commit
a890e62e64
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      components/drivers/pic/pic.c

+ 5 - 1
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