diff options
author | phk <phk@FreeBSD.org> | 2004-11-08 18:53:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-08 18:53:52 +0000 |
commit | ee05a9050f6eff3c93261a8afe582096c13fa106 (patch) | |
tree | 03642e45f4f80e202237110e6c002561b3ce4ad9 /sys/dev/fdc | |
parent | 30108058ef925b4c34031dec54099496ef4e20d0 (diff) | |
download | FreeBSD-src-ee05a9050f6eff3c93261a8afe582096c13fa106.zip FreeBSD-src-ee05a9050f6eff3c93261a8afe582096c13fa106.tar.gz |
Add the last missing bits to make this unloadable: Two wakeups and
calling of the GEOM modevent from the drivers modevent so we know the
order things happen.
Diffstat (limited to 'sys/dev/fdc')
-rw-r--r-- | sys/dev/fdc/fdc.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 62ed45c..a2193f0 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -1157,6 +1157,7 @@ fdc_thread(void *arg) mtx_lock(&fdc->fdc_mtx); } fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE); + wakeup(&fdc->fdc_thread); mtx_unlock(&fdc->fdc_mtx); kthread_exit(0); @@ -1329,8 +1330,6 @@ struct g_class g_fd_class = { .ioctl = fd_ioctl, }; -DECLARE_GEOM_CLASS(g_fd_class, g_fd); - static int fd_access(struct g_provider *pp, int r, int w, int e) { @@ -1660,6 +1659,7 @@ fdc_detach(device_t dev) /* kill worker thread */ fdc->flags |= FDC_KTHREAD_EXIT; mtx_lock(&fdc->fdc_mtx); + wakeup(&fdc->head); while ((fdc->flags & FDC_KTHREAD_ALIVE) != 0) msleep(&fdc->fdc_thread, &fdc->fdc_mtx, PRIBIO, "fdcdet", 0); mtx_unlock(&fdc->fdc_mtx); @@ -1979,4 +1979,12 @@ static driver_t fd_driver = { sizeof(struct fd_data) }; -DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, 0, 0); +static int +fdc_modevent(module_t mod, int type, void *data) +{ + + g_modevent(NULL, type, &g_fd_class); + return (0); +} + +DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fdc_modevent, 0); |