FreeBSD/sys/x86/x86/mca.c
/*
 * Scan the machine check banks on all CPUs by binding to each CPU in
 * turn.  If any of the CPUs contained new machine check records, log
 * them to the console.
 */
Scan the machine check banks on all CPUs by binding to each CPU in
turn.  If any of the CPUs contained new machine check records, log
them to the console.
Scan the machine check banks on all CPUs by binding to each CPU in turn . If any of the CPUs contained new machine check records log them to the console .
static void
mca_scan_cpus(void *context, int pending)
{
	struct mca_internal *mca;
	struct thread *td;
	int count, cpu;
	mca_fill_freelist();
	td = curthread;
	count = 0;
	thread_lock(td);
	CPU_FOREACH(cpu) {
		sched_bind(td, cpu);
		thread_unlock(td);
		count += mca_scan(POLLED);
		thread_lock(td);
		sched_unbind(td);
	}
	thread_unlock(td);
	if (count != 0) {
		mtx_lock_spin(&mca_lock);
		STAILQ_FOREACH(mca, &mca_records, link) {
			if (!mca->logged) {
				mca->logged = 1;
				mca_log(&mca->rec);
			}
		}
		mtx_unlock_spin(&mca_lock);
	}
}
static void mca_scan_cpus ( void * context , int pending ) { struct mca_internal * mca ; struct thread * td ; int count , cpu ; mca_fill_freelist ( ) ; td = curthread ; count = 0 ; thread_lock ( td ) ; CPU_FOREACH ( cpu ) { sched_bind ( td , cpu ) ; thread_unlock ( td ) ; count += mca_scan ( POLLED ) ; thread_lock ( td ) ; sched_unbind ( td ) ; } thread_unlock ( td ) ; if ( count != 0 ) { mtx_lock_spin ( & mca_lock ) ; STAILQ_FOREACH ( mca , & mca_records , link ) { if ( ! mca -> logged ) { mca -> logged = 1 ; mca_log ( & mca -> rec ) ; } } mtx_unlock_spin ( & mca_lock ) ; } }
Scan the machine check banks on all CPUs by binding to each CPU in
 turn.
Scan the machine check banks on all CPUs by binding to each CPU in turn .