domcaps.c revision 613b28719c10e84c1202c1045df44d77767de21d
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER START
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The contents of this file are subject to the terms of the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Common Development and Distribution License (the "License").
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You may not use this file except in compliance with the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * See the License for the specific language governing permissions
843e19887f64dde75055cf8842fc4db2171eff45johnlev * and limitations under the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * When distributing Covered Code, include this CDDL HEADER in each
843e19887f64dde75055cf8842fc4db2171eff45johnlev * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * If applicable, add the following below this CDDL HEADER, with the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * fields enclosed by brackets "[]" replaced with your own identifying
843e19887f64dde75055cf8842fc4db2171eff45johnlev * information: Portions Copyright [yyyy] [name of copyright owner]
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER END
613b28719c10e84c1202c1045df44d77767de21dRichard Bean * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Use is subject to license terms.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * This rather uninspiring device enables userland to discover if
843e19887f64dde75055cf8842fc4db2171eff45johnlev * the current kernel is actually a dom0 or other domain e.g. domU.
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*ARGSUSED*/
843e19887f64dde75055cf8842fc4db2171eff45johnlevdomcaps_getinfo(dev_info_t *devi, ddi_info_cmd_t cmd, void *arg, void **result)
843e19887f64dde75055cf8842fc4db2171eff45johnlevdomcaps_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
843e19887f64dde75055cf8842fc4db2171eff45johnlev if (ddi_create_minor_node(devi, ddi_get_name(devi), S_IFCHR,
843e19887f64dde75055cf8842fc4db2171eff45johnlev ddi_get_instance(devi), DDI_PSEUDO, 0) != DDI_SUCCESS)
843e19887f64dde75055cf8842fc4db2171eff45johnlevdomcaps_detach(dev_info_t *devi, ddi_detach_cmd_t cmd)
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*ARGSUSED1*/
843e19887f64dde75055cf8842fc4db2171eff45johnlevdomcaps_open(dev_t *dev, int flag, int otyp, cred_t *cr)
843e19887f64dde75055cf8842fc4db2171eff45johnlev return (getminor(*dev) == DOMCAPS_MINOR ? 0 : ENXIO);
843e19887f64dde75055cf8842fc4db2171eff45johnlev/*ARGSUSED*/
843e19887f64dde75055cf8842fc4db2171eff45johnlev return (0);
843e19887f64dde75055cf8842fc4db2171eff45johnlev nbytes = MIN(uio->uio_resid, sizeof (data) - uio->uio_loffset);
843e19887f64dde75055cf8842fc4db2171eff45johnlev return (0);
613b28719c10e84c1202c1045df44d77767de21dRichard Bean "hypervisor capabilities driver",