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

Function mca_check_status

freebsd/x86/x86/mca.c:523–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523static int
524mca_check_status(int bank, struct mca_record *rec)
525{
526 uint64_t status;
527 u_int p[4];
528
529 status = rdmsr(mca_msr_ops.status(bank));
530 if (!(status & MC_STATUS_VAL))
531 return (0);
532
533 /* Save exception information. */
534 rec->mr_status = status;
535 rec->mr_bank = bank;
536 rec->mr_addr = 0;
537 if (status & MC_STATUS_ADDRV)
538 rec->mr_addr = rdmsr(mca_msr_ops.addr(bank));
539 rec->mr_misc = 0;
540 if (status & MC_STATUS_MISCV)
541 rec->mr_misc = rdmsr(mca_msr_ops.misc(bank));
542 rec->mr_tsc = rdtsc();
543 rec->mr_apic_id = PCPU_GET(apic_id);
544 rec->mr_mcg_cap = rdmsr(MSR_MCG_CAP);
545 rec->mr_mcg_status = rdmsr(MSR_MCG_STATUS);
546 rec->mr_cpu_id = cpu_id;
547 rec->mr_cpu_vendor_id = cpu_vendor_id;
548 rec->mr_cpu = PCPU_GET(cpuid);
549
550 /*
551 * Clear machine check. Don't do this for uncorrectable
552 * errors so that the BIOS can see them.
553 */
554 if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) {
555 wrmsr(mca_msr_ops.status(bank), 0);
556 do_cpuid(0, p);
557 }
558 return (1);
559}
560
561static void
562mca_resize_freelist(void)

Callers 1

mca_scanFunction · 0.85

Calls 4

rdmsrFunction · 0.50
rdtscFunction · 0.50
wrmsrFunction · 0.50
do_cpuidFunction · 0.50

Tested by

no test coverage detected