FreeBSD/sys/x86/x86/local_apic.c
/*
 * Dump contents of local APIC registers
 */
Dump contents of local APIC registers
Dump contents of local APIC registers
static void
native_lapic_dump(const char* str)
{
	uint32_t maxlvt;
	maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT;
	printf("cpu%d %s:\n", PCPU_GET(cpuid), str);
	printf("     ID: 0x%08x   VER: 0x%08x LDR: 0x%08x DFR: 0x%08x",
	    lapic_read32(LAPIC_ID), lapic_read32(LAPIC_VERSION),
	    lapic_read32(LAPIC_LDR), x2apic_mode ? 0 : lapic_read32(LAPIC_DFR));
	if ((cpu_feature2 & CPUID2_X2APIC) != 0)
		printf(" x2APIC: %d", x2apic_mode);
	printf("\n  lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n",
	    lapic_read32(LAPIC_LVT_LINT0), lapic_read32(LAPIC_LVT_LINT1),
	    lapic_read32(LAPIC_TPR), lapic_read32(LAPIC_SVR));
	printf("  timer: 0x%08x therm: 0x%08x err: 0x%08x",
	    lapic_read32(LAPIC_LVT_TIMER), lapic_read32(LAPIC_LVT_THERMAL),
	    lapic_read32(LAPIC_LVT_ERROR));
	if (maxlvt >= APIC_LVT_PMC)
		printf(" pmc: 0x%08x", lapic_read32(LAPIC_LVT_PCINT));
	printf("\n");
	if (maxlvt >= APIC_LVT_CMCI)
		printf("   cmci: 0x%08x\n", lapic_read32(LAPIC_LVT_CMCI));
}
static void native_lapic_dump ( const char * str ) { uint32_t maxlvt ; maxlvt = ( lapic_read32 ( LAPIC_VERSION ) & APIC_VER_MAXLVT ) >> MAXLVTSHIFT ; printf ( " \n " , PCPU_GET ( cpuid ) , str ) ; printf ( " " , lapic_read32 ( LAPIC_ID ) , lapic_read32 ( LAPIC_VERSION ) , lapic_read32 ( LAPIC_LDR ) , x2apic_mode ? 0 : lapic_read32 ( LAPIC_DFR ) ) ; if ( ( cpu_feature2 & CPUID2_X2APIC ) != 0 ) printf ( " " , x2apic_mode ) ; printf ( " \n \n " , lapic_read32 ( LAPIC_LVT_LINT0 ) , lapic_read32 ( LAPIC_LVT_LINT1 ) , lapic_read32 ( LAPIC_TPR ) , lapic_read32 ( LAPIC_SVR ) ) ; printf ( " " , lapic_read32 ( LAPIC_LVT_TIMER ) , lapic_read32 ( LAPIC_LVT_THERMAL ) , lapic_read32 ( LAPIC_LVT_ERROR ) ) ; if ( maxlvt >= APIC_LVT_PMC ) printf ( " " , lapic_read32 ( LAPIC_LVT_PCINT ) ) ; printf ( " \n " ) ; if ( maxlvt >= APIC_LVT_CMCI ) printf ( " \n " , lapic_read32 ( LAPIC_LVT_CMCI ) ) ; }
Dump contents of local APIC registers
Dump contents of local APIC registers