xref: /onnv-gate/usr/src/uts/i86pc/i86hvm/io/pv_rtls.c (revision 7656:2621e50fdf4a)
16451Sedp /*
26451Sedp  * CDDL HEADER START
36451Sedp  *
46451Sedp  * The contents of this file are subject to the terms of the
56451Sedp  * Common Development and Distribution License (the "License").
66451Sedp  * You may not use this file except in compliance with the License.
76451Sedp  *
86451Sedp  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96451Sedp  * or http://www.opensolaris.org/os/licensing.
106451Sedp  * See the License for the specific language governing permissions
116451Sedp  * and limitations under the License.
126451Sedp  *
136451Sedp  * When distributing Covered Code, include this CDDL HEADER in each
146451Sedp  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156451Sedp  * If applicable, add the following below this CDDL HEADER, with the
166451Sedp  * fields enclosed by brackets "[]" replaced with your own identifying
176451Sedp  * information: Portions Copyright [yyyy] [name of copyright owner]
186451Sedp  *
196451Sedp  * CDDL HEADER END
206451Sedp  */
216451Sedp /*
226451Sedp  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
236451Sedp  * Use is subject to license terms.
246451Sedp  */
256451Sedp 
266451Sedp /*
276451Sedp  * Fake rtls module. Prevents the real rtls driver from loading in
286451Sedp  * a xen HVM domain so that xnf may operate instead.
296451Sedp  */
306451Sedp 
316451Sedp #include <sys/sunddi.h>
326451Sedp #include <sys/errno.h>
336451Sedp #include <sys/modctl.h>
346451Sedp 
356451Sedp struct dev_ops pv_rtls_ops = {
366451Sedp 	DEVO_REV,
376451Sedp 	0,
386451Sedp 	NULL,
396451Sedp 	nulldev,
406451Sedp 	nulldev,
416451Sedp 	NULL,
426451Sedp 	NULL,
436451Sedp 	nodev,
446451Sedp 	NULL,
45*7656SSherry.Moore@Sun.COM 	NULL,
46*7656SSherry.Moore@Sun.COM 	NULL,
47*7656SSherry.Moore@Sun.COM 	ddi_quiesce_not_needed,		/* quiesce */
486451Sedp };
496451Sedp 
506451Sedp /*
516451Sedp  * Module linkage information for the kernel.
526451Sedp  */
536451Sedp static struct modldrv modldrv = {
546451Sedp 	&mod_driverops,
557542SRichard.Bean@Sun.COM 	"xVM rtls stub",
566451Sedp 	&pv_rtls_ops
576451Sedp };
586451Sedp 
596451Sedp static struct modlinkage modlinkage = {
606451Sedp 	MODREV_1, (void *)&modldrv, NULL
616451Sedp };
626451Sedp 
636451Sedp int
_init(void)646451Sedp _init(void)
656451Sedp {
666451Sedp 	return (mod_install(&modlinkage));
676451Sedp }
686451Sedp 
696451Sedp int
_info(struct modinfo * modinfop)706451Sedp _info(struct modinfo *modinfop)
716451Sedp {
726451Sedp 	return (mod_info(&modlinkage, modinfop));
736451Sedp }
746451Sedp 
756451Sedp int
_fini(void)766451Sedp _fini(void)
776451Sedp {
786451Sedp 	return (EBUSY);
796451Sedp }
80