/** * I/O control request. * * @returns depends... * @param pDev The device. * @param ulCmd The command. * @param pvData Pointer to the data. * @param fFile The file descriptor flags. * @param pTd The calling thread. */ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) { PSUPDRVSESSION pSession; devfs_get_cdevpriv((void **)&pSession); /* * Deal with the fast ioctl path first. */ if ( ( ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN || ulCmd == SUP_IOCTL_FAST_DO_HM_RUN || ulCmd == SUP_IOCTL_FAST_DO_NOP) && pSession->fUnrestricted == true) return supdrvIOCtlFast(ulCmd, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession); return VBoxDrvFreeBSDIOCtlSlow(pSession, ulCmd, pvData, pTd); }
/** * I/O control request. * * @returns depends... * @param pDev The device. * @param ulCmd The command. * @param pvData Pointer to the data. * @param fFile The file descriptor flags. * @param pTd The calling thread. */ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd) { /* * Validate the input. */ PSUPDRVSESSION pSession = (PSUPDRVSESSION)pDev->si_drv1; if (RT_UNLIKELY(!VALID_PTR(pSession))) return EINVAL; /* * Deal with the fast ioctl path first. */ if ( ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN || ulCmd == SUP_IOCTL_FAST_DO_HWACC_RUN || ulCmd == SUP_IOCTL_FAST_DO_NOP) return supdrvIOCtlFast(ulCmd, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession); return VBoxDrvFreeBSDIOCtlSlow(pSession, ulCmd, pvData, pTd); }