/* $NetBSD: md_component.c,v 1.2 2016/01/26 23:12:15 pooka Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __KERNEL_RCSID(0, "$NetBSD: md_component.c,v 1.2 2016/01/26 23:12:15 pooka Exp $"); #include #include #include #include #include #include "ioconf.c" #include #include #include extern void mdattach(int); /* XXX */ RUMP_COMPONENT(RUMP_COMPONENT_DEV) { extern const struct bdevsw md_bdevsw; extern const struct cdevsw md_cdevsw; devmajor_t bmaj, cmaj; int error; config_init_component(cfdriver_ioconf_md, cfattach_ioconf_md, cfdata_ioconf_md); bmaj = cmaj = NODEVMAJOR; if ((error = devsw_attach("md", &md_bdevsw, &bmaj, &md_cdevsw, &cmaj)) != 0) panic("md devsw attach failed: %d", error); if ((error = rump_vfs_makedevnodes(S_IFBLK, "/dev/md0", 'a', bmaj, 0, 7)) != 0) panic("cannot create cooked md dev nodes: %d", error); if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/rmd0", 'a', cmaj, 0, 7)) != 0) panic("cannot create raw md dev nodes: %d", error); rump_pdev_add(mdattach, 0); } /commit/sys/dev/clockctl.c?h=lockdoc-9.3-0.2&id=1a480a4c6b1caa62b9ce6ed95f5fc09813f8f470'>Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as brieflypgoyette 2019-01-27Merge the [pgoyette-compat] branchpgoyette 2016-11-21- Return ENOTTY rather than EINVAL for invalid ioctl, suggested byrin 2016-01-06Simplify and fix the unload to destroy the mutex. To reproduce, configurechristos 2015-12-07Modularize the clockctl pseudo-device and link to the build.pgoyette 2014-07-25Add d_discard to all struct cdevsw instances I could find.dholland 2014-03-16Change (mostly mechanically) every cdevsw/bdevsw I can find to usedholland 2012-10-27split device_t/softc for all remaining drivers.chs 2012-01-04When processing ioctl CLOCKCTL_NTP_ADJTIME, set the return value fromapb 2009-10-03Move clockctl policy exception back to the subsystem.elad 2009-02-22- fix copyout size in CLOCKCTL_O?ADJTIME.nakayama 2009-02-18simply the previous as suggested by enami:mrg 2009-02-18clock_settime1() expects the struct timespec * to be in kernel space.mrg 2009-01-11merge christos-time_tchristos 2007-11-25Refactor time modification checks and place them in the secmodel code.elad 2007-05-12Change interface to settimeofday1() so that it can also be used fromdsl 2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos 2006-11-16__unused removal on arguments; approved by core.christos 2006-10-12- sprinkle __unused on function decls.christos 2006-08-29fix incomplete initializerchristos 2006-06-07merge FreeBSD timecounters from branch simonb-timecounterskardel 2006-03-09Do not use SCARG() in userland. Eliminates need for <sys/systm.h>.christos 2005-12-11merge ktrace-lwp.christos 2005-12-05- make settime take timespec.christos 2005-02-27nuke trailing whitespaceperry 2003-06-29Back out the lwp/ktrace changes. They contained a lot of colateral damage,fvdl 2003-06-28Pass lwp pointers throughtout the kernel, as required, so that the lwpid candarrenr 2003-02-10Fix clockctlattach to take an (ignored) int as its parameter, which isperry 2002-10-23merge kqueue branch into -currentjdolecek 2002-09-23Remove breaks after returns, unreachable returns and returns aftersimonb 2002-09-06Merge the gehenna-devsw branch into the trunk.gehenna 2002-03-01Two more trivial bug fixes:manu 2002-02-25Fixes a bug in argument passing to ntp_adjtime1. patch submitted bymanu 2001-12-09Changed clocktl interface to use syscallargs structuresmanu 2001-11-15don't need <sys/types.h> when including <sys/param.h>lukem 2001-11-13add RCSIDslukem 2001-09-16This is the clockctl pseudodevice. It gives non root users access to root-onlymanu