Changeset 5169 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Oct 5, 2007 3:12:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r5138 r5169 57 57 # endif 58 58 #endif 59 #ifndef HAVE_UNLOCKED_IOCTL /* linux/fs.h defines this */ 60 # include <linux/smp_lock.h> 61 #endif 59 62 60 63 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) … … 294 297 static int VBoxDrvLinuxCreate(struct inode *pInode, struct file *pFilp); 295 298 static int VBoxDrvLinuxClose(struct inode *pInode, struct file *pFilp); 299 #ifdef HAVE_UNLOCKED_IOCTL 300 static long VBoxDrvLinuxIOCtl(struct file *pFilp, unsigned int uCmd, unsigned long ulArg); 301 #else 296 302 static int VBoxDrvLinuxIOCtl(struct inode *pInode, struct file *pFilp, unsigned int uCmd, unsigned long ulArg); 297 static int VBoxDrvLinuxIOCtlSlow(struct inode *pInode, struct file *pFilp, unsigned int uCmd, unsigned long ulArg); 303 #endif 304 static int VBoxDrvLinuxIOCtlSlow(struct file *pFilp, unsigned int uCmd, unsigned long ulArg); 298 305 static int VBoxDrvLinuxInitGip(PSUPDRVDEVEXT pDevExt); 299 306 static int VBoxDrvLinuxTermGip(PSUPDRVDEVEXT pDevExt); … … 312 319 open: VBoxDrvLinuxCreate, 313 320 release: VBoxDrvLinuxClose, 321 #ifdef HAVE_UNLOCKED_IOCTL 322 unlocked_ioctl: VBoxDrvLinuxIOCtl, 323 #else 314 324 ioctl: VBoxDrvLinuxIOCtl, 325 #endif 315 326 }; 316 327 … … 747 758 * Device I/O Control entry point. 748 759 * 749 * @param pInode Pointer to inode info structure.750 760 * @param pFilp Associated file pointer. 751 761 * @param uCmd The function specified to ioctl(). 752 762 * @param ulArg The argument specified to ioctl(). 753 763 */ 764 #ifdef HAVE_UNLOCKED_IOCTL 765 static long VBoxDrvLinuxIOCtl(struct file *pFilp, unsigned int uCmd, unsigned long ulArg) 766 #else 754 767 static int VBoxDrvLinuxIOCtl(struct inode *pInode, struct file *pFilp, unsigned int uCmd, unsigned long ulArg) 768 #endif 755 769 { 756 770 /* … … 758 772 * the session and iCmd, and only returns a VBox status code. 759 773 */ 774 #ifdef HAVE_UNLOCKED_IOCTL 760 775 if (RT_LIKELY( uCmd == SUP_IOCTL_FAST_DO_RAW_RUN 761 776 || uCmd == SUP_IOCTL_FAST_DO_HWACC_RUN 762 777 || uCmd == SUP_IOCTL_FAST_DO_NOP)) 763 778 return supdrvIOCtlFast(uCmd, &g_DevExt, (PSUPDRVSESSION)pFilp->private_data); 764 return VBoxDrvLinuxIOCtlSlow(pInode, pFilp, uCmd, ulArg); 779 return VBoxDrvLinuxIOCtlSlow(pFilp, uCmd, ulArg); 780 781 #else /* !HAVE_UNLOCKED_IOCTL */ 782 783 int rc; 784 unlock_kernel(); 785 if (RT_LIKELY( uCmd == SUP_IOCTL_FAST_DO_RAW_RUN 786 || uCmd == SUP_IOCTL_FAST_DO_HWACC_RUN 787 || uCmd == SUP_IOCTL_FAST_DO_NOP)) 788 rc = supdrvIOCtlFast(uCmd, &g_DevExt, (PSUPDRVSESSION)pFilp->private_data); 789 else 790 rc = VBoxDrvLinuxIOCtlSlow(pFilp, uCmd, ulArg); 791 lock_kernel(); 792 return rc; 793 #endif /* !HAVE_UNLOCKED_IOCTL */ 765 794 } 766 795 … … 769 798 * Device I/O Control entry point. 770 799 * 771 * @param pInode Pointer to inode info structure.772 800 * @param pFilp Associated file pointer. 773 801 * @param uCmd The function specified to ioctl(). 774 802 * @param ulArg The argument specified to ioctl(). 775 803 */ 776 static int VBoxDrvLinuxIOCtlSlow(struct inode *pInode, structfile *pFilp, unsigned int uCmd, unsigned long ulArg)804 static int VBoxDrvLinuxIOCtlSlow(struct file *pFilp, unsigned int uCmd, unsigned long ulArg) 777 805 { 778 806 int rc;
Note:
See TracChangeset
for help on using the changeset viewer.