VirtualBox

Changeset 75584 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Nov 19, 2018 5:18:36 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126752
Message:

VBoxGuest-linux.c,VBoxGuest-solaris.c: Setup the IRQ after calling VGDrvCommonInitDevExt so that it's ready for it, like everyone else does it. Linux was also tearing down IRQs after common code terminated, this was also reverted (solaris got this right already).

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c

    r74965 r75584  
    614614    {
    615615        /*
    616          * Register the interrupt service routine for it.
     616         * Call the common device extension initializer.
    617617         */
    618         rc = vgdrvLinuxInitISR();
    619         if (rc >= 0)
     618#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_X86)
     619        VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux26;
     620#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_AMD64)
     621        VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux26_x64;
     622#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) && defined(RT_ARCH_X86)
     623        VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux24;
     624#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) && defined(RT_ARCH_AMD64)
     625        VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux24_x64;
     626#else
     627# warning "huh? which arch + version is this?"
     628        VBOXOSTYPE enmOsType = VBOXOSTYPE_Linux;
     629#endif
     630        rc = VGDrvCommonInitDevExt(&g_DevExt,
     631                                   g_IOPortBase,
     632                                   g_pvMMIOBase,
     633                                   g_cbMMIO,
     634                                   enmOSType,
     635                                   VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
     636        if (RT_SUCCESS(rc))
    620637        {
    621638            /*
    622              * Call the common device extension initializer.
     639             * Register the interrupt service routine for it now that g_DevExt can handle IRQs.
    623640             */
    624 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_X86)
    625             VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux26;
    626 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && defined(RT_ARCH_AMD64)
    627             VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux26_x64;
    628 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) && defined(RT_ARCH_X86)
    629             VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux24;
    630 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) && defined(RT_ARCH_AMD64)
    631             VBOXOSTYPE enmOSType = VBOXOSTYPE_Linux24_x64;
    632 #else
    633 # warning "huh? which arch + version is this?"
    634             VBOXOSTYPE enmOsType = VBOXOSTYPE_Linux;
    635 #endif
    636             rc = VGDrvCommonInitDevExt(&g_DevExt,
    637                                        g_IOPortBase,
    638                                        g_pvMMIOBase,
    639                                        g_cbMMIO,
    640                                        enmOSType,
    641                                        VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
    642             if (RT_SUCCESS(rc))
     641            rc = vgdrvLinuxInitISR();
     642            if (rc >= 0) /** @todo r=bird: status check differs from that inside vgdrvLinuxInitISR. */
    643643            {
    644644#ifdef VBOXGUEST_WITH_INPUT_DRIVER
     
    687687                }
    688688#endif
    689                 VGDrvCommonDeleteDevExt(&g_DevExt);
     689                vgdrvLinuxTermISR();
    690690            }
    691             else
    692             {
    693                 LogRel((DEVICE_NAME ": VGDrvCommonInitDevExt failed with rc=%Rrc\n", rc));
    694                 rc = RTErrConvertFromErrno(rc);
    695             }
    696             vgdrvLinuxTermISR();
     691            VGDrvCommonDeleteDevExt(&g_DevExt);
     692        }
     693        else
     694        {
     695            LogRel((DEVICE_NAME ": VGDrvCommonInitDevExt failed with rc=%Rrc\n", rc));
     696            rc = RTErrConvertFromErrno(rc);
    697697        }
    698698    }
     
    723723    VGDrvCommonCloseSession(&g_DevExt, g_pKernelSession);
    724724#endif
     725    vgdrvLinuxTermISR();
    725726    VGDrvCommonDeleteDevExt(&g_DevExt);
    726     vgdrvLinuxTermISR();
    727727    pci_unregister_driver(&g_PciDriver);
    728728    RTLogDestroy(RTLogRelSetDefaultInstance(NULL));
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c

    r70876 r75584  
    325325                        {
    326326                            /*
    327                              * Add IRQ of VMMDev.
     327                             * Call the common device extension initializer.
    328328                             */
    329                             rc = vgdrvSolarisAddIRQ(pDip);
    330                             if (rc == DDI_SUCCESS)
     329                            rc = VGDrvCommonInitDevExt(&g_DevExt, g_uIOPortBase, g_pMMIOBase, g_cbMMIO,
     330#if ARCH_BITS == 64
     331                                                       VBOXOSTYPE_Solaris_x64,
     332#else
     333                                                       VBOXOSTYPE_Solaris,
     334#endif
     335                                                       VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
     336                            if (RT_SUCCESS(rc))
    331337                            {
    332338                                /*
    333                                  * Call the common device extension initializer.
     339                                 * Add IRQ of VMMDev.
    334340                                 */
    335                                 rc = VGDrvCommonInitDevExt(&g_DevExt, g_uIOPortBase, g_pMMIOBase, g_cbMMIO,
    336 #if ARCH_BITS == 64
    337                                                            VBOXOSTYPE_Solaris_x64,
    338 #else
    339                                                            VBOXOSTYPE_Solaris,
    340 #endif
    341                                                            VMMDEV_EVENT_MOUSE_POSITION_CHANGED);
    342                                 if (RT_SUCCESS(rc))
     341                                rc = vgdrvSolarisAddIRQ(pDip);
     342                                if (rc == DDI_SUCCESS)
    343343                                {
    344344                                    /*
     
    346346                                     */
    347347                                    VGDrvCommonProcessOptionsFromHost(&g_DevExt);
    348 
    349348
    350349                                    rc = ddi_create_minor_node(pDip, DEVICE_NAME, S_IFCHR, instance, DDI_PSEUDO, 0 /* fFlags */);
     
    357356
    358357                                    LogRel((DEVICE_NAME "::Attach: ddi_create_minor_node failed.\n"));
    359                                     VGDrvCommonDeleteDevExt(&g_DevExt);
     358                                    vgdrvSolarisRemoveIRQ(pDip);
    360359                                }
    361360                                else
    362                                     LogRel((DEVICE_NAME "::Attach: VGDrvCommonInitDevExt failed.\n"));
    363 
    364                                 vgdrvSolarisRemoveIRQ(pDip);
     361                                    LogRel((DEVICE_NAME "::Attach: vgdrvSolarisAddIRQ failed.\n"));
     362                                VGDrvCommonDeleteDevExt(&g_DevExt);
    365363                            }
    366364                            else
    367                                 LogRel((DEVICE_NAME "::Attach: vgdrvSolarisAddIRQ failed.\n"));
     365                                LogRel((DEVICE_NAME "::Attach: VGDrvCommonInitDevExt failed.\n"));
    368366                            ddi_regs_map_free(&g_PciMMIOHandle);
    369367                        }
Note: See TracChangeset for help on using the changeset viewer.

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