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

Function mca_record_entry

freebsd/x86/x86/mca.c:607–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

605}
606
607static void
608mca_record_entry(enum scan_mode mode, const struct mca_record *record)
609{
610 struct mca_internal *rec;
611
612 if (mode == POLLED) {
613 rec = malloc(sizeof(*rec), M_MCA, M_WAITOK);
614 mtx_lock_spin(&mca_lock);
615 } else {
616 mtx_lock_spin(&mca_lock);
617 rec = STAILQ_FIRST(&mca_freelist);
618 if (rec == NULL) {
619 printf("MCA: Unable to allocate space for an event.\n");
620 mca_log(record);
621 mtx_unlock_spin(&mca_lock);
622 return;
623 }
624 STAILQ_REMOVE_HEAD(&mca_freelist, link);
625 mca_freecount--;
626 }
627
628 rec->rec = *record;
629 STAILQ_INSERT_TAIL(&mca_pending, rec, link);
630 mtx_unlock_spin(&mca_lock);
631}
632
633#ifdef DEV_APIC
634/*

Callers 1

mca_scanFunction · 0.85

Calls 3

mallocFunction · 0.85
mca_logFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected