Changeset 9602 in vbox for trunk/src/VBox
- Timestamp:
- Jun 11, 2008 12:09:31 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 11 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 -
trunk/src/VBox/Runtime/Makefile.kmk
r9588 r9602 979 979 r0drv/nt/time-r0drv-nt.cpp \ 980 980 r0drv/nt/timer-r0drv-nt.cpp 981 ## @todo timer-r0drv-nt.cppand assert-r0drv-nt.cpp981 ## @todo and assert-r0drv-nt.cpp 982 982 983 983 RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES) -
trunk/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp
r9311 r9602 52 52 53 53 54 RTR0DECL(int) RTR0MpNotificationInit(void *pvOS)54 int rtR0MpNotificationInit(void) 55 55 { 56 56 NOREF(pvOS); … … 59 59 60 60 61 RTR0DECL(void) RTR0MpNotificationTerm(void *pvOS)61 void rtR0MpNotificationTerm(void) 62 62 { 63 63 NOREF(pvOS); -
trunk/src/VBox/Runtime/r0drv/initterm-r0drv.cpp
r9588 r9602 36 36 #include <iprt/assert.h> 37 37 #include <iprt/err.h> 38 #include <iprt/mp.h> 38 #ifndef IN_GUEST /* play safe for now */ 39 # include "r0drv/mp-r0drv.h" 40 #endif 39 41 40 42 #include "internal/initterm.h" … … 61 63 { 62 64 #ifndef IN_GUEST /* play safe for now */ 63 rc = RTR0MpNotificationInit(NULL); /** @todo drop the arg and rename to rtR0* */65 rc = rtR0MpNotificationInit(); 64 66 #endif 65 67 if (RT_SUCCESS(rc)) … … 82 84 #endif 83 85 #ifndef IN_GUEST /* play safe for now */ 84 RTR0MpNotificationTerm(NULL); /** @todo drop the arg and rename to rtR0* */86 rtR0MpNotificationTerm(); 85 87 #endif 86 88 rtR0TermNative(); -
trunk/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
r9313 r9602 123 123 124 124 125 int rtR0MpNotificationNativeInit(void *pvOS)125 int rtR0MpNotificationNativeInit(void) 126 126 { 127 127 int rc; 128 NOREF(pvOS);129 128 130 129 #ifdef CPU_DOWN_FAILED … … 138 137 139 138 140 void rtR0MpNotificationNativeTerm(void *pvOS)139 void rtR0MpNotificationNativeTerm(void) 141 140 { 142 141 unregister_cpu_notifier(&g_NotifierBlock); … … 145 144 #else /* Not supported / Not needed */ 146 145 147 int rtR0MpNotificationNativeInit(void *pvOS)146 int rtR0MpNotificationNativeInit(void) 148 147 { 149 NOREF(pvOS);150 148 return VINF_SUCCESS; 151 149 } 152 150 153 void rtR0MpNotificationNativeTerm(void *pvOS)151 void rtR0MpNotificationNativeTerm(void) 154 152 { 155 NOREF(pvOS);156 153 } 157 154 -
trunk/src/VBox/Runtime/r0drv/mp-r0drv.h
r9588 r9602 62 62 typedef RTMPARGS *PRTMPARGS; 63 63 64 int rtR0MpNotificationNativeInit(void *pvOS); 65 void rtR0MpNotificationNativeTerm(void *pvOS); 64 /* Called from initterm-r0drv.cpp: */ 65 int rtR0MpNotificationInit(void); 66 void rtR0MpNotificationTerm(void); 67 68 /* The following is only relevant when using mpnotifcation-r0drv.cpp: */ 69 int rtR0MpNotificationNativeInit(void); 70 void rtR0MpNotificationNativeTerm(void); 66 71 void rtMpNotificationDoCallbacks(RTMPEVENT enmEvent, RTCPUID idCpu); 67 72 … … 69 74 70 75 #endif 76 -
trunk/src/VBox/Runtime/r0drv/mpnotification-r0drv.c
r9311 r9602 276 276 277 277 278 RTR0DECL(int) RTR0MpNotificationInit(void *pvOS)278 int rtR0MpNotificationInit(void) 279 279 { 280 280 int rc = VINF_SUCCESS; … … 285 285 if (RT_SUCCESS(rc)) 286 286 { 287 rc = rtR0MpNotificationNativeInit( pvOS);287 rc = rtR0MpNotificationNativeInit(); 288 288 if (RT_SUCCESS(rc)) 289 289 return rc; … … 298 298 299 299 300 RTR0DECL(void) RTR0MpNotificationTerm(void *pvOS)300 void rtR0MpNotificationTerm(void) 301 301 { 302 302 RTSPINLOCK hSpinlock = g_hRTMpNotifySpinLock; … … 310 310 RTSPINLOCKTMP Tmp; 311 311 312 rtR0MpNotificationNativeTerm( pvOS);312 rtR0MpNotificationNativeTerm(); 313 313 314 314 /* pick up the list and the spinlock. */ -
trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
r9582 r9602 46 46 * KeQueryActiveProcssors() cannot be called at all IRQLs and therefore we'll 47 47 * have to cache it. Fortunately, Nt doesn't really support taking CPUs offline 48 * or online. It's first with W2K8 that support for adding / onlining cpus at 49 * runtime is (officially) supported. Once we start caring about this, we'll 50 * simply use the native MP event callback and update this variable as cpus 51 * comes online. 48 * or online. It's first with W2K8 that support for CPU hotplugging was added. 49 * Once we start caring about this, we'll simply let the native MP event callback 50 * and update this variable as CPUs comes online. (The code is done already.) 52 51 */ 53 52 RTCPUSET g_rtMpNtCpuSet; … … 78 77 g_pfnrtNtKeFlushQueuedDpcs = (PFNMYKEFLUSHQUEUEDDPCS)MmGetSystemRoutineAddress(&RoutineName); 79 78 80 81 #if 0 /* W2K8 support */82 return RTR0MpNotificationInit(NULL);83 #else84 79 return VINF_SUCCESS; 85 #endif86 80 } 87 81 … … 89 83 void rtR0TermNative(void) 90 84 { 91 #if 0 /* W2K8 support */92 85 RTR0MpNotificationTerm(NULL); 93 #endif94 86 } 95 87 -
trunk/src/VBox/Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp
r9567 r9602 130 130 131 131 132 int rtR0MpNotificationNativeInit(void *pvOS)132 int rtR0MpNotificationNativeInit(void) 133 133 { 134 134 /* … … 169 169 170 170 171 void rtR0MpNotificationNativeTerm(void *pvOS)171 void rtR0MpNotificationNativeTerm(void) 172 172 { 173 173 if ( g_pfnKeDeregisterProcessorChangeCallback … … 181 181 #else /* Not supported */ 182 182 183 int rtR0MpNotificationNativeInit(void *pvOS)183 int rtR0MpNotificationNativeInit(void) 184 184 { 185 NOREF(pvOS);186 185 return VINF_SUCCESS; 187 186 } 188 187 189 void rtR0MpNotificationNativeTerm(void *pvOS)188 void rtR0MpNotificationNativeTerm(void) 190 189 { 191 NOREF(pvOS);192 190 } 193 191 -
trunk/src/VBox/Runtime/r0drv/solaris/mpnotification-r0drv-solaris.c
r9318 r9602 68 68 69 69 70 int rtR0MpNotificationNativeInit(void *pvOS)70 int rtR0MpNotificationNativeInit(void) 71 71 { 72 NOREF(pvOS);73 72 register_cpu_setup_func(rtMpNotificationSolarisCallback, NULL); 74 73 } 75 74 76 75 77 void rtR0MpNotificationNativeTerm(void *pvOS)76 void rtR0MpNotificationNativeTerm(void) 78 77 { 79 NOREF(pvOS);80 78 unregister_cpu_setup_func(rtMpNotificationSolarisCallback, NULL); 81 79 }
Note:
See TracChangeset
for help on using the changeset viewer.