MCPcopy Create free account
hub / github.com/F-Stack/f-stack / native_lapic_dump

Function native_lapic_dump

freebsd/x86/x86/local_apic.c:714–750  ·  view source on GitHub ↗

* Dump contents of local APIC registers */

Source from the content-addressed store, hash-verified

712 * Dump contents of local APIC registers
713 */
714static void
715native_lapic_dump(const char* str)
716{
717 uint32_t version;
718 uint32_t maxlvt;
719 uint32_t extf;
720 int elvt_count;
721 int i;
722
723 version = lapic_read32(LAPIC_VERSION);
724 maxlvt = (version & APIC_VER_MAXLVT) >> MAXLVTSHIFT;
725 printf("cpu%d %s:\n", PCPU_GET(cpuid), str);
726 printf(" ID: 0x%08x VER: 0x%08x LDR: 0x%08x DFR: 0x%08x",
727 lapic_read32(LAPIC_ID), version,
728 lapic_read32(LAPIC_LDR), x2apic_mode ? 0 : lapic_read32(LAPIC_DFR));
729 if ((cpu_feature2 & CPUID2_X2APIC) != 0)
730 printf(" x2APIC: %d", x2apic_mode);
731 printf("\n lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n",
732 lapic_read32(LAPIC_LVT_LINT0), lapic_read32(LAPIC_LVT_LINT1),
733 lapic_read32(LAPIC_TPR), lapic_read32(LAPIC_SVR));
734 printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x",
735 lapic_read32(LAPIC_LVT_TIMER), lapic_read32(LAPIC_LVT_THERMAL),
736 lapic_read32(LAPIC_LVT_ERROR));
737 if (maxlvt >= APIC_LVT_PMC)
738 printf(" pmc: 0x%08x", lapic_read32(LAPIC_LVT_PCINT));
739 printf("\n");
740 if (maxlvt >= APIC_LVT_CMCI)
741 printf(" cmci: 0x%08x\n", lapic_read32(LAPIC_LVT_CMCI));
742 extf = amd_read_ext_features();
743 if (extf != 0) {
744 printf(" AMD ext features: 0x%08x\n", extf);
745 elvt_count = amd_read_elvt_count();
746 for (i = 0; i < elvt_count; i++)
747 printf(" AMD elvt%d: 0x%08x\n", i,
748 lapic_read32(LAPIC_EXT_LVT0 + i));
749 }
750}
751
752static void
753native_lapic_xapic_mode(void)

Callers

nothing calls this directly

Calls 4

lapic_read32Function · 0.85
amd_read_ext_featuresFunction · 0.85
amd_read_elvt_countFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected