MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / list_irq

Function list_irq

components/drivers/pic/pic.c:1168–1308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166
1167#if defined(RT_USING_CONSOLE) && defined(RT_USING_MSH)
1168static int list_irq(int argc, char**argv)
1169{
1170 rt_size_t irq_nr = 0;
1171 rt_bool_t dump_all = RT_FALSE;
1172 const char *const irq_modes[] =
1173 {
1174 [RT_IRQ_MODE_NONE] = "None",
1175 [RT_IRQ_MODE_EDGE_RISING] = "Edge-Rising",
1176 [RT_IRQ_MODE_EDGE_FALLING] = "Edge-Falling",
1177 [RT_IRQ_MODE_EDGE_BOTH] = "Edge-Both",
1178 [RT_IRQ_MODE_LEVEL_HIGH] = "Level-High",
1179 [RT_IRQ_MODE_LEVEL_LOW] = "Level-Low",
1180 };
1181 static char info[RT_CONSOLEBUF_SIZE];
1182#ifdef RT_USING_SMP
1183 static char cpumask[RT_CPUS_NR + 1] = { [RT_CPUS_NR] = '\0' };
1184#endif
1185
1186 if (argc > 1)
1187 {
1188 if (!rt_strcmp(argv[1], "all"))
1189 {
1190 dump_all = RT_TRUE;
1191 }
1192 }
1193
1194 rt_kprintf("%-*.s %-*.s %s %-*.s %-*.s %-*.s %-*.sUsers%-*.s",
1195 6, "IRQ",
1196 6, "HW-IRQ",
1197 "MSI",
1198 _pic_name_max, "PIC",
1199 12, "Mode",
1200 #ifdef RT_USING_SMP
1201 RT_CPUS_NR, "CPUs",
1202 #else
1203 0, 0,
1204 #endif
1205 #ifdef RT_USING_INTERRUPT_INFO
1206 11, "Count",
1207 5, ""
1208 #else
1209 0, 0,
1210 10, "-Number"
1211 #endif
1212 );
1213
1214#if defined(RT_USING_SMP) && defined(RT_USING_INTERRUPT_INFO)
1215 for (int i = 0; i < RT_CPUS_NR; i++)
1216 {
1217 rt_kprintf(" cpu%2d ", i);
1218 }
1219#endif
1220
1221#ifdef RT_USING_PIC_STATISTICS
1222 rt_kprintf(" max/ns avg/ns min/ns");
1223#endif
1224
1225 rt_kputs("\n");

Callers

nothing calls this directly

Calls 6

rt_strcmpFunction · 0.85
rt_kprintfFunction · 0.85
rt_kputsFunction · 0.85
rt_snprintfFunction · 0.85
rt_list_isemptyFunction · 0.85
rt_list_lenFunction · 0.85

Tested by

no test coverage detected