Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/fdc/fdc.c
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
#include <sys/kthread.h> | #include <sys/kthread.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/priv.h> | #include <sys/priv.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <sys/sbuf.h> | |||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <geom/geom.h> | #include <geom/geom.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <machine/clock.h> | #include <machine/clock.h> | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
▲ Show 20 Lines • Show All 1,071 Lines • ▼ Show 20 Lines | fdc_thread(void *arg) | ||||
mtx_lock(&fdc->fdc_mtx); | mtx_lock(&fdc->fdc_mtx); | ||||
fdc->flags |= FDC_KTHREAD_ALIVE; | fdc->flags |= FDC_KTHREAD_ALIVE; | ||||
while ((fdc->flags & FDC_KTHREAD_EXIT) == 0) { | while ((fdc->flags & FDC_KTHREAD_EXIT) == 0) { | ||||
mtx_unlock(&fdc->fdc_mtx); | mtx_unlock(&fdc->fdc_mtx); | ||||
i = fdc_worker(fdc); | i = fdc_worker(fdc); | ||||
if (i && debugflags & 0x20) { | if (i && debugflags & 0x20) { | ||||
if (fdc->bp != NULL) { | if (fdc->bp != NULL) { | ||||
g_print_bio(fdc->bp); | struct sbuf *sb; | ||||
printf("\n"); | |||||
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); | |||||
sbuf_set_drain(sb, sbuf_printf_drain, NULL); | |||||
g_format_bio(sb, fdc->bp); | |||||
sbuf_nl_terminate(sb); | |||||
sbuf_finish(sb); | |||||
sbuf_delete(sb); | |||||
} | } | ||||
printf("Retry line %d\n", retry_line); | printf("Retry line %d\n", retry_line); | ||||
} | } | ||||
fdc->retry += i; | fdc->retry += i; | ||||
mtx_lock(&fdc->fdc_mtx); | mtx_lock(&fdc->fdc_mtx); | ||||
} | } | ||||
fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE); | fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE); | ||||
mtx_unlock(&fdc->fdc_mtx); | mtx_unlock(&fdc->fdc_mtx); | ||||
▲ Show 20 Lines • Show All 933 Lines • Show Last 20 Lines |