Changeset 9602 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jun 11, 2008 12:09:31 PM (17 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r9526 r9602 658 658 if (RT_SUCCESS(rc)) 659 659 { 660 rc = RTR0MpNotificationInit(NULL); 660 #ifdef RT_ARCH_AMD64 661 rc = RTR0MemExecDonate(&g_abExecMemory[0], sizeof(g_abExecMemory)); 662 #endif 663 /* 664 * Initialize the device extension. 665 */ 661 666 if (RT_SUCCESS(rc)) 667 rc = supdrvInitDevExt(&g_DevExt); 668 if (!rc) 662 669 { 663 #ifdef RT_ARCH_AMD64 664 rc = RTR0MemExecDonate(&g_abExecMemory[0], sizeof(g_abExecMemory)); 665 #endif 670 #ifndef USE_NEW_OS_INTERFACE_FOR_GIP 666 671 /* 667 * Initialize the device extension.672 * Create the GIP page. 668 673 */ 669 if (RT_SUCCESS(rc)) 670 rc = supdrvInitDevExt(&g_DevExt); 674 rc = VBoxDrvLinuxInitGip(&g_DevExt); 671 675 if (!rc) 676 #endif /* !USE_NEW_OS_INTERFACE_FOR_GIP */ 672 677 { 673 #ifndef USE_NEW_OS_INTERFACE_FOR_GIP 674 /* 675 * Create the GIP page. 676 */ 677 rc = VBoxDrvLinuxInitGip(&g_DevExt); 678 if (!rc) 679 #endif /* !USE_NEW_OS_INTERFACE_FOR_GIP */ 680 { 681 printk(KERN_INFO DEVICE_NAME ": TSC mode is %s, kernel timer mode is " 678 printk(KERN_INFO DEVICE_NAME ": TSC mode is %s, kernel timer mode is " 682 679 #ifdef VBOX_HRTIMER 683 "'high-res'" 684 #else 685 "'normal'" 686 #endif 687 ".\n", 688 g_DevExt.pGip->u32Mode == SUPGIPMODE_SYNC_TSC ? "'synchronous'" : "'asynchronous'"); 689 LogFlow(("VBoxDrv::ModuleInit returning %#x\n", rc)); 690 printk(KERN_DEBUG DEVICE_NAME ": Successfully loaded version " 691 VBOX_VERSION_STRING " (interface " xstr(SUPDRVIOC_VERSION) ").\n"); 692 return rc; 693 } 694 695 supdrvDeleteDevExt(&g_DevExt); 680 "'high-res'" 681 #else 682 "'normal'" 683 #endif 684 ".\n", 685 g_DevExt.pGip->u32Mode == SUPGIPMODE_SYNC_TSC ? "'synchronous'" : "'asynchronous'"); 686 LogFlow(("VBoxDrv::ModuleInit returning %#x\n", rc)); 687 printk(KERN_DEBUG DEVICE_NAME ": Successfully loaded version " 688 VBOX_VERSION_STRING " (interface " xstr(SUPDRVIOC_VERSION) ").\n"); 689 return rc; 696 690 } 697 else 698 rc = -EINVAL; 699 RTR0MpNotificationTerm(NULL); 691 692 supdrvDeleteDevExt(&g_DevExt); 700 693 } 694 else 695 rc = -EINVAL; 701 696 RTR0Term(); 702 697 } … … 758 753 #endif /* !USE_NEW_OS_INTERFACE_FOR_GIP */ 759 754 supdrvDeleteDevExt(&g_DevExt); 760 RTR0MpNotificationTerm(NULL);761 755 RTR0Term(); 762 756 } -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r9558 r9602 263 263 if (RT_SUCCESS(rc)) 264 264 { 265 rc = RTR0MpNotificationInit(NULL); 266 if (RT_SUCCESS(rc)) 265 /* 266 * Initialize the device extension 267 */ 268 rc = supdrvInitDevExt(&g_DevExt); 269 if (RT_SUCCESS(rc)) 267 270 { 268 271 /* 269 * Initialize the device extension272 * Initialize the session hash table. 270 273 */ 271 rc = supdrvInitDevExt(&g_DevExt); 274 memset(g_apSessionHashTab, 0, sizeof(g_apSessionHashTab)); 275 rc = RTSpinlockCreate(&g_Spinlock); 272 276 if (RT_SUCCESS(rc)) 273 277 { 274 278 /* 275 * Initialize the session hash table.279 * Register ourselves as a character device, pseudo-driver 276 280 */ 277 memset(g_apSessionHashTab, 0, sizeof(g_apSessionHashTab)); 278 rc = RTSpinlockCreate(&g_Spinlock); 279 if (RT_SUCCESS(rc)) 281 if (ddi_create_minor_node(pDip, DEVICE_NAME, S_IFCHR, instance, DDI_PSEUDO, 0) == DDI_SUCCESS) 280 282 { 281 /*282 * Register ourselves as a character device, pseudo-driver283 */284 if (ddi_create_minor_node(pDip, DEVICE_NAME, S_IFCHR, instance, DDI_PSEUDO, 0) == DDI_SUCCESS)285 {286 283 #ifdef USE_SESSION_HASH 287 pState->pDip = pDip; 288 #endif 289 ddi_report_dev(pDip); 290 return DDI_SUCCESS; 291 } 292 293 /* Is this really necessary? */ 294 ddi_remove_minor_node(pDip, NULL); 295 cmn_err(CE_NOTE,"VBoxDrvSolarisAttach: ddi_create_minor_node failed."); 296 297 RTSpinlockDestroy(g_Spinlock); 298 g_Spinlock = NIL_RTSPINLOCK; 284 pState->pDip = pDip; 285 #endif 286 ddi_report_dev(pDip); 287 return DDI_SUCCESS; 299 288 } 300 else 301 cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: RTSpinlockCreate failed"); 302 supdrvDeleteDevExt(&g_DevExt); 289 290 /* Is this really necessary? */ 291 ddi_remove_minor_node(pDip, NULL); 292 cmn_err(CE_NOTE,"VBoxDrvSolarisAttach: ddi_create_minor_node failed."); 293 294 RTSpinlockDestroy(g_Spinlock); 295 g_Spinlock = NIL_RTSPINLOCK; 303 296 } 304 297 else 305 cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: supdrvInitDevExtfailed");306 RTR0MpNotificationTerm(NULL);298 cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: RTSpinlockCreate failed"); 299 supdrvDeleteDevExt(&g_DevExt); 307 300 } 308 else 309 cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: RTR0MpNotifcationInit failed");301 else 302 cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: supdrvInitDevExt failed"); 310 303 RTR0Term(); 311 304 } … … 367 360 g_Spinlock = NIL_RTSPINLOCK; 368 361 369 RTR0MpNotificationTerm(NULL);370 362 RTR0Term(); 371 363
Note:
See TracChangeset
for help on using the changeset viewer.