SUPDrv-solaris.c revision 4424773d37044bcf5f6d85c04f6f2832b52c32fb
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * VBox host drivers - Ring-0 support drivers - Solaris host:
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Solaris driver C code
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Copyright (C) 2006-2007 innotek GmbH
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * available from http://www.virtualbox.org. This file is free software;
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * you can redistribute it and/or modify it under the terms of the GNU
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * General Public License as published by the Free Software Foundation,
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/*******************************************************************************
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync* Header Files *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync*******************************************************************************/
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#undef u /* /usr/include/sys/user.h:249:1 is where this is defined to (curproc->p_user). very cool. */
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync/*******************************************************************************
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync* Defined Constants And Macros *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync*******************************************************************************/
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** The module name. */
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync/** The module description as seen in 'modinfo'. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Maximum number of driver instances. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/*******************************************************************************
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync* Internal Functions *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync*******************************************************************************/
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisWrite(dev_t Dev, struct uio *pUio, cred_t *pCred);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisIOCtl (dev_t Dev, int Cmd, intptr_t pArgs, int mode, cred_t *pCred, int *pVal);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t Cmd);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t Cmd);
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsyncstatic int VBoxDrvSolarisIOCtlSlow(PSUPDRVSESSION pSession, int Cmd, int Mode, intptr_t pArgs);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/*******************************************************************************
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync* Global Variables *
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync*******************************************************************************/
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * cb_ops: for drivers that support char/block entry points
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * dev_ops: for driver device operations
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync 0, /* ref count */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync (struct bus_ops *)0,
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * modldrv: export driver specifics to the kernel
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * modlinkage: export install/remove/info to the kernel
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic struct modlinkage g_VBoxDrvSolarisModLinkage =
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * State info for each open file handle.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef struct
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /**< Pointer to the session data. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** State info. for each driver instance. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsynctypedef struct
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync/** Opaque pointer to state */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Device extention & session data association structure */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/* GCC C++ hack. */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Hash table */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** Spinlock protecting g_apSessionHashTab. */
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync/** Calculates bucket index into g_apSessionHashTab.*/
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync#define SESSION_HASH(sfn) ((sfn) % RT_ELEMENTS(g_apSessionHashTab))
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Kernel entry points
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync int rc = ddi_soft_state_init(&g_pVBoxDrvSolarisState, sizeof(vbox_devstate_t), 8);
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync return 0; /* success */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_CONT, "VBoxDrvSolaris _init failed with rc=%d", rc);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync if (e != 0)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync int e = mod_info(&g_VBoxDrvSolarisModLinkage, pModInfo);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_CONT, "VBoxDrvSolaris _info returns %d", e);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Attach entry point, to attach a device to the system or resume it.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param pDip The module structure instance.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param enmCmd Attach type (ddi_attach_cmd_t)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @return corresponding solaris error code.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync if (ddi_soft_state_zalloc(g_pVBoxDrvSolarisState, instance) != DDI_SUCCESS)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: state alloc failed");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync pState = ddi_get_soft_state(g_pVBoxDrvSolarisState, instance);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Initialize IPRT R0 driver, which internally calls OS-specific r0 init.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Initialize the device extension
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Initialize the session hash table.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync memset(g_apSessionHashTab, 0, sizeof(g_apSessionHashTab));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Register ourselves as a character device, pseudo-driver
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync if (ddi_create_minor_node(pDip, "0", S_IFCHR, instance, DDI_PSEUDO, 0) == DDI_SUCCESS)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /* Is this really necessary? */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_NOTE,"VBoxDrvSolarisAttach: ddi_create_minor_node failed.");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: RTSpinlockCreate failed");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: supdrvInitDevExt failed");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: failed to init R0Drv");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Detach entry point, to detach a device to the system or suspend it.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param pDip The module structure instance.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param enmCmd Attach type (ddi_attach_cmd_t)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @return corresponding solaris error code.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync vbox_devstate_t *pState = ddi_get_soft_state(g_pVBoxDrvSolarisState, instance);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync ddi_soft_state_free(g_pVBoxDrvSolarisState, instance);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_CONT, "VBoxDrvSolarisDetach: Clean Up Done.");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * User context entry points
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync dprintf(("VBoxDrvSolarisOpen: pDev=%p:%#x\n", pDev, *pDev));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Locate a new device open instance.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * For each open call we'll allocate an item in the soft state of the device.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * The item index is stored in the dev_t. I hope this is ok...
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync for (iOpenInstance = 0; iOpenInstance < 4096; iOpenInstance++)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync if ( !ddi_get_soft_state(g_pVBoxDrvSolarisState, iOpenInstance) /* faster */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync && ddi_soft_state_zalloc(g_pVBoxDrvSolarisState, iOpenInstance) == DDI_SUCCESS)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync pState = ddi_get_soft_state(g_pVBoxDrvSolarisState, iOpenInstance);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_NOTE,"VBoxDrvSolarisOpen: too many open instances.");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Create a new session.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *pDev = makedevice(getmajor(*pDev), iOpenInstance);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync dprintf(("VBoxDrvSolarisOpen: returns pDev=%#x pSession=%p pState=%p\n", *pDev, pSession, pState));
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync OSDBGPRINT(("VBoxDrvSolarisOpen: Dev=%#x pSession=%p pid=%d r0proc=%p thread=%p\n",
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync *pDev, pSession, RTProcSelf(), RTR0ProcHandleSelf(), RTThreadNativeSelf() ));
ee4d840f54fd2dcea8a73b1b86d5ec0db370b05dvboxsync /* failed - clean up */
a39ea3668b7019c23a68936259545f9b71bce1aavboxsync ddi_soft_state_free(g_pVBoxDrvSolarisState, iOpenInstance);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Create a new session.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Sessions in Solaris driver are mostly useless. It's however needed
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * in VBoxDrvSolarisIOCtlSlow() while calling supdrvIOCtl()
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Insert it into the hash table.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync for (instance = 0; instance < DEVICE_MAXINSTANCES; instance++)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync vbox_devstate_t *pState = ddi_get_soft_state(g_pVBoxDrvSolarisState, instance);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync cmn_err(CE_NOTE, "VBoxDrvSolarisOpen: All instances exhausted\n");
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisClose(dev_t Dev, int flag, int otyp, cred_t *cred)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Get the session and free the soft state item.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync vbox_devstate_t *pState = ddi_get_soft_state(g_pVBoxDrvSolarisState, getminor(Dev));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisClose: no state data for %#x (%d)\n", Dev, getminor(Dev)));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync ddi_soft_state_free(g_pVBoxDrvSolarisState, getminor(Dev));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisClose: no session in state data for %#x (%d)\n", Dev, getminor(Dev)));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisClose: Dev=%#x pSession=%p pid=%d r0proc=%p thread=%p\n", Dev, pSession, RTProcSelf(), RTR0ProcHandleSelf(), RTThreadNativeSelf() ));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Remove from the hash table.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisClose: WHAT?!? pSession == NULL! This must be a mistake... pid=%d (close)\n",
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Close the session.
fd492d285ed33c86dd76bc05d9d4f3e55bc0fb49vboxsyncstatic int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisWrite(dev_t Dev, struct uio *pUio, cred_t *pCred)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Driver ioctl, an alternate entry point for this character driver.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param Dev Device number
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param Cmd Operation identifier
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param pArg Arguments from user to driver
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param Mode Information bitfield (read/write, address space etc.)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param pCred User credentials
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param pVal Return value for calling process.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @return corresponding solaris error code.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisIOCtl(dev_t Dev, int Cmd, intptr_t pArgs, int Mode, cred_t *pCred, int *pVal)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Get the session from the soft state item.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync vbox_devstate_t *pState = ddi_get_soft_state(g_pVBoxDrvSolarisState, getminor(Dev));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtl: no state data for %#x (%d)\n", Dev, getminor(Dev)));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtl: no session in state data for %#x (%d)\n", Dev, getminor(Dev)));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Find the session.
25747178cb66800d8386c20b8ffd87f78f24f4e5vboxsync OSDBGPRINT(("VBoxSupDrvIOCtl: WHAT?!? pSession == NULL! This must be a mistake... pid=%d iCmd=%#x\n",
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Deal with the two high-speed IOCtl that takes it's arguments from
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * the session and iCmd, and only returns a VBox status code.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync return VBoxDrvSolarisIOCtlSlow(pSession, Cmd, Mode, pArgs);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync/** @def IOCPARM_LEN
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Gets the length from the ioctl number.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * This is normally defined by sys/ioccom.h on BSD systems...
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync# define IOCPARM_LEN(x) ( ((x) >> 16) & IOCPARM_MASK )
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Worker for VBoxSupDrvIOCtl that takes the slow IOCtl functions.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @returns Solaris errno.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param pSession The session.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param Cmd The IOCtl command.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param Mode Information bitfield (for specifying ownership of data)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param iArg User space address of the request buffer.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsyncstatic int VBoxDrvSolarisIOCtlSlow(PSUPDRVSESSION pSession, int iCmd, int Mode, intptr_t iArg)
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Read the header.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: iCmd=%#x len %d expected %d\n", iCmd, IOCPARM_LEN(iCmd), sizeof(Hdr)));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync rc = ddi_copyin((void *)iArg, &Hdr, sizeof(Hdr), Mode);
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: ddi_copyin(,%#lx,) failed; iCmd=%#x. rc=%d\n", iArg, iCmd, rc));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: bad header magic %#x; iCmd=%#x\n", Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK, iCmd));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: max(%#x,%#x); iCmd=%#x\n", Hdr.cbIn, Hdr.cbOut, iCmd));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Buffer the request.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: failed to allocate buffer of %d bytes for iCmd=%#x.\n", cbBuf, iCmd));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync dprintf(("VBoxDrvSolarisIOCtlSlow: copy_from_user(,%#lx, %#x) failed; iCmd=%#x. rc=%d\n", iArg, Hdr.cbIn, iCmd, rc));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Process the IOCtl.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Copy ioctl data and output buffer back to user space.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: too much output! %#x > %#x; iCmd=%#x!\n", cbOut, cbBuf, iCmd));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync /* this is really bad */
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: ddi_copyout(,%p,%d) failed. rc=%d\n", (void *)iArg, cbBuf, rc));
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * Converts an supdrv error code to a solaris error code.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @returns corresponding solaris error code.
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync * @param rc supdrv error code (SUPDRV_ERR_* defines).
24ab761b2beb5af0393c6f2585b6351d8b3085f0vboxsync case 0: return 0;
return EPERM;
bool VBOXCALL supdrvOSObjCanAccess(PSUPDRVOBJ pObj, PSUPDRVSESSION pSession, const char *pszObjName, int *prc)