VirtualBox

Changeset 9602 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 11, 2008 12:09:31 PM (17 years ago)
Author:
vboxsync
Message:

Changed RTR0MpNotificationInit/Term to rtR0MpNotificationInit/Term and dropped the unused pvOS argument. They are now IPRT internal and called by RTR0Init/Term.

Location:
trunk/src/VBox
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r9526 r9602  
    658658        if (RT_SUCCESS(rc))
    659659        {
    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             */
    661666            if (RT_SUCCESS(rc))
     667                rc = supdrvInitDevExt(&g_DevExt);
     668            if (!rc)
    662669            {
    663 #ifdef RT_ARCH_AMD64
    664                 rc = RTR0MemExecDonate(&g_abExecMemory[0], sizeof(g_abExecMemory));
    665 #endif
     670#ifndef USE_NEW_OS_INTERFACE_FOR_GIP
    666671                /*
    667                  * Initialize the device extension.
     672                 * Create the GIP page.
    668673                 */
    669                 if (RT_SUCCESS(rc))
    670                     rc = supdrvInitDevExt(&g_DevExt);
     674                rc = VBoxDrvLinuxInitGip(&g_DevExt);
    671675                if (!rc)
     676#endif /* !USE_NEW_OS_INTERFACE_FOR_GIP */
    672677                {
    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 "
    682679#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;
    696690                }
    697                 else
    698                     rc = -EINVAL;
    699                 RTR0MpNotificationTerm(NULL);
     691
     692                supdrvDeleteDevExt(&g_DevExt);
    700693            }
     694            else
     695                rc = -EINVAL;
    701696            RTR0Term();
    702697        }
     
    758753#endif /* !USE_NEW_OS_INTERFACE_FOR_GIP */
    759754    supdrvDeleteDevExt(&g_DevExt);
    760     RTR0MpNotificationTerm(NULL);
    761755    RTR0Term();
    762756}
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c

    r9558 r9602  
    263263            if (RT_SUCCESS(rc))
    264264            {
    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))
    267270                {
    268271                    /*
    269                      * Initialize the device extension
     272                     * Initialize the session hash table.
    270273                     */
    271                     rc = supdrvInitDevExt(&g_DevExt);
     274                    memset(g_apSessionHashTab, 0, sizeof(g_apSessionHashTab));
     275                    rc = RTSpinlockCreate(&g_Spinlock);
    272276                    if (RT_SUCCESS(rc))
    273277                    {
    274278                        /*
    275                          * Initialize the session hash table.
     279                         * Register ourselves as a character device, pseudo-driver
    276280                         */
    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)
    280282                        {
    281                             /*
    282                              * Register ourselves as a character device, pseudo-driver
    283                              */
    284                             if (ddi_create_minor_node(pDip, DEVICE_NAME, S_IFCHR, instance, DDI_PSEUDO, 0) == DDI_SUCCESS)
    285                             {
    286283#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;
    299288                        }
    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;
    303296                    }
    304297                    else
    305                         cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: supdrvInitDevExt failed");
    306                     RTR0MpNotificationTerm(NULL);
     298                        cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: RTSpinlockCreate failed");
     299                    supdrvDeleteDevExt(&g_DevExt);
    307300                }
    308                 else 
    309                     cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: RTR0MpNotifcationInit failed");
     301                else
     302                    cmn_err(CE_NOTE, "VBoxDrvSolarisAttach: supdrvInitDevExt failed");
    310303                RTR0Term();
    311304            }
     
    367360            g_Spinlock = NIL_RTSPINLOCK;
    368361
    369             RTR0MpNotificationTerm(NULL);
    370362            RTR0Term();
    371363
  • trunk/src/VBox/Runtime/Makefile.kmk

    r9588 r9602  
    979979        r0drv/nt/time-r0drv-nt.cpp \
    980980        r0drv/nt/timer-r0drv-nt.cpp
    981 ## @todo timer-r0drv-nt.cpp and assert-r0drv-nt.cpp
     981## @todo and assert-r0drv-nt.cpp
    982982
    983983RuntimeR0Drv_SOURCES.win.amd64 = $(RuntimeWin64ASM_SOURCES)
  • trunk/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp

    r9311 r9602  
    5252
    5353
    54 RTR0DECL(int) RTR0MpNotificationInit(void *pvOS)
     54int rtR0MpNotificationInit(void)
    5555{
    5656    NOREF(pvOS);
     
    5959
    6060
    61 RTR0DECL(void) RTR0MpNotificationTerm(void *pvOS)
     61void rtR0MpNotificationTerm(void)
    6262{
    6363    NOREF(pvOS);
  • trunk/src/VBox/Runtime/r0drv/initterm-r0drv.cpp

    r9588 r9602  
    3636#include <iprt/assert.h>
    3737#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
    3941
    4042#include "internal/initterm.h"
     
    6163        {
    6264#ifndef IN_GUEST /* play safe for now */
    63             rc = RTR0MpNotificationInit(NULL); /** @todo drop the arg and rename to rtR0* */
     65            rc = rtR0MpNotificationInit();
    6466#endif
    6567            if (RT_SUCCESS(rc))
     
    8284#endif
    8385#ifndef IN_GUEST /* play safe for now */
    84     RTR0MpNotificationTerm(NULL); /** @todo drop the arg and rename to rtR0* */
     86    rtR0MpNotificationTerm();
    8587#endif
    8688    rtR0TermNative();
  • trunk/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c

    r9313 r9602  
    123123
    124124
    125 int rtR0MpNotificationNativeInit(void *pvOS)
     125int rtR0MpNotificationNativeInit(void)
    126126{
    127127    int rc;
    128     NOREF(pvOS);
    129128
    130129#ifdef CPU_DOWN_FAILED
     
    138137
    139138
    140 void rtR0MpNotificationNativeTerm(void *pvOS)
     139void rtR0MpNotificationNativeTerm(void)
    141140{
    142141    unregister_cpu_notifier(&g_NotifierBlock);
     
    145144#else   /* Not supported / Not needed */
    146145
    147 int rtR0MpNotificationNativeInit(void *pvOS)
     146int rtR0MpNotificationNativeInit(void)
    148147{
    149     NOREF(pvOS);
    150148    return VINF_SUCCESS;
    151149}
    152150
    153 void rtR0MpNotificationNativeTerm(void *pvOS)
     151void rtR0MpNotificationNativeTerm(void)
    154152{
    155     NOREF(pvOS);
    156153}
    157154
  • trunk/src/VBox/Runtime/r0drv/mp-r0drv.h

    r9588 r9602  
    6262typedef RTMPARGS *PRTMPARGS;
    6363
    64 int rtR0MpNotificationNativeInit(void *pvOS);
    65 void rtR0MpNotificationNativeTerm(void *pvOS);
     64/* Called from initterm-r0drv.cpp: */
     65int rtR0MpNotificationInit(void);
     66void rtR0MpNotificationTerm(void);
     67
     68/* The following is only relevant when using mpnotifcation-r0drv.cpp: */
     69int rtR0MpNotificationNativeInit(void);
     70void rtR0MpNotificationNativeTerm(void);
    6671void rtMpNotificationDoCallbacks(RTMPEVENT enmEvent, RTCPUID idCpu);
    6772
     
    6974
    7075#endif
     76
  • trunk/src/VBox/Runtime/r0drv/mpnotification-r0drv.c

    r9311 r9602  
    276276
    277277
    278 RTR0DECL(int) RTR0MpNotificationInit(void *pvOS)
     278int rtR0MpNotificationInit(void)
    279279{
    280280    int rc = VINF_SUCCESS;
     
    285285        if (RT_SUCCESS(rc))
    286286        {
    287             rc = rtR0MpNotificationNativeInit(pvOS);
     287            rc = rtR0MpNotificationNativeInit();
    288288            if (RT_SUCCESS(rc))
    289289                return rc;
     
    298298
    299299
    300 RTR0DECL(void) RTR0MpNotificationTerm(void *pvOS)
     300void rtR0MpNotificationTerm(void)
    301301{
    302302    RTSPINLOCK hSpinlock = g_hRTMpNotifySpinLock;
     
    310310            RTSPINLOCKTMP Tmp;
    311311
    312             rtR0MpNotificationNativeTerm(pvOS);
     312            rtR0MpNotificationNativeTerm();
    313313
    314314            /* pick up the list and the spinlock. */
  • trunk/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp

    r9582 r9602  
    4646 * KeQueryActiveProcssors() cannot be called at all IRQLs and therefore we'll
    4747 * 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.)
    5251 */
    5352RTCPUSET g_rtMpNtCpuSet;
     
    7877    g_pfnrtNtKeFlushQueuedDpcs = (PFNMYKEFLUSHQUEUEDDPCS)MmGetSystemRoutineAddress(&RoutineName);
    7978
    80 
    81 #if 0 /* W2K8 support */
    82     return RTR0MpNotificationInit(NULL);
    83 #else
    8479    return VINF_SUCCESS;
    85 #endif
    8680}
    8781
     
    8983void rtR0TermNative(void)
    9084{
    91 #if 0 /* W2K8 support */
    9285    RTR0MpNotificationTerm(NULL);
    93 #endif
    9486}
    9587
  • trunk/src/VBox/Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp

    r9567 r9602  
    130130
    131131
    132 int rtR0MpNotificationNativeInit(void *pvOS)
     132int rtR0MpNotificationNativeInit(void)
    133133{
    134134    /*
     
    169169
    170170
    171 void rtR0MpNotificationNativeTerm(void *pvOS)
     171void rtR0MpNotificationNativeTerm(void)
    172172{
    173173    if (    g_pfnKeDeregisterProcessorChangeCallback
     
    181181#else   /* Not supported */
    182182
    183 int rtR0MpNotificationNativeInit(void *pvOS)
     183int rtR0MpNotificationNativeInit(void)
    184184{
    185     NOREF(pvOS);
    186185    return VINF_SUCCESS;
    187186}
    188187
    189 void rtR0MpNotificationNativeTerm(void *pvOS)
     188void rtR0MpNotificationNativeTerm(void)
    190189{
    191     NOREF(pvOS);
    192190}
    193191
  • trunk/src/VBox/Runtime/r0drv/solaris/mpnotification-r0drv-solaris.c

    r9318 r9602  
    6868
    6969
    70 int rtR0MpNotificationNativeInit(void *pvOS)
     70int rtR0MpNotificationNativeInit(void)
    7171{
    72     NOREF(pvOS);
    7372    register_cpu_setup_func(rtMpNotificationSolarisCallback, NULL);
    7473}
    7574
    7675
    77 void rtR0MpNotificationNativeTerm(void *pvOS)
     76void rtR0MpNotificationNativeTerm(void)
    7877{
    79     NOREF(pvOS);
    8078    unregister_cpu_setup_func(rtMpNotificationSolarisCallback, NULL);
    8179}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette