VirtualBox

Ignore:
Timestamp:
Apr 27, 2015 9:13:02 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99782
Message:

Reverted bad commit r99781.

File:
1 edited

Legend:

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

    r55435 r55436  
    4848# include <iprt/power.h>
    4949# define VBOX_WITH_SUSPEND_NOTIFICATION
    50 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
    51 #  define VBOX_WITH_PRE_SUSPEND_NOTIFICATION
    52 # endif
    5350#endif
    5451
     
    6259#ifdef VBOX_WITH_SUSPEND_NOTIFICATION
    6360# include <linux/platform_device.h>
    64 #endif
    65 #ifdef VBOX_WITH_PRE_SUSPEND_NOTIFICATION
    66 # include <linux/suspend.h>
    67 # include <linux/notifier.h>
    6861#endif
    6962#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) && defined(SUPDRV_WITH_MSR_PROBER)
     
    129122# endif
    130123static void VBoxDevRelease(struct device *pDev);
    131 # ifdef VBOX_WITH_PRE_SUSPEND_NOTIFICATION
    132 static int VBoxDrvPowerNotificationCallback(struct notifier_block *, unsigned long, void *);
    133 # endif
    134124#endif
    135125
     
    280270    }
    281271};
    282 
    283 # ifdef VBOX_WITH_PRE_SUSPEND_NOTIFICATION
    284 static struct notifier_block *g_pNotifier;
    285 # endif /* VBOX_WITH_PRE_SUSPEND_NOTIFICATION */
    286272#endif /* VBOX_WITH_SUSPEND_NOTIFICATION */
    287273
     
    432418#endif
    433419                    {
    434 # ifdef VBOX_WITH_PRE_SUSPEND_NOTIFICATION
    435                         size_t const cbNotifier = sizeof(*g_pNotifier);
    436                         g_pNotifier = RTMemAllocZ(cbNotifier);
    437                         if (g_pNotifier)
    438                         {
    439                             g_pNotifier->notifier_call = VBoxDrvPowerNotificationCallback;
    440                             g_pNotifier->priority = 0;
    441                             rc = register_pm_notifier(g_pNotifier);
    442                             if (!rc)
    443                                 printk(KERN_INFO "vboxdrv: Successfully registered power notifier\n");
    444                             else
    445                             {
    446                                 printk(KERN_INFO "vboxdrv: Failed to register power notifier! rc=%d\n", rc);
    447                                 rc = 0;
    448                             }
    449                         }
    450                         else
    451                             printk(KERN_INFO "vboxdrv: Failed to alloc %lu bytes for power notifier\n", cbNotifier);
    452 # endif
    453 
    454420                        printk(KERN_INFO "vboxdrv: TSC mode is %s, tentative frequency %llu Hz\n",
    455421                               SUPGetGIPModeName(g_DevExt.pGip), g_DevExt.pGip->u64CpuHz);
     
    505471    platform_device_unregister(&gPlatformDevice);
    506472    platform_driver_unregister(&gPlatformDriver);
    507 # ifdef VBOX_WITH_PRE_SUSPEND_NOTIFICATION
    508     if (g_pNotifier)
    509     {
    510         unregister_pm_notifier(g_pNotifier);
    511         g_pNotifier = NULL;
    512     }
    513 # endif
    514473#endif
    515474
     
    675634#endif /* VBOX_WITH_SUSPEND_NOTIFICATION */
    676635
    677 
    678 #ifdef VBOX_WITH_PRE_SUSPEND_NOTIFICATION
    679 static int VBoxDrvPowerNotificationCallback(struct notifier_block *pNotifier, unsigned long uEvent, void *pvUnused)
    680 {
    681     NOREF(pvUnused);
    682     if (uEvent == PM_SUSPEND_PREPARE)
    683         RTPowerSignalEvent(RTPOWEREVENT_PRE_SUSPEND);
    684     /* The remaining events are taken care by VBoxDrvSuspend() and VboxDrvResume() hooks. */
    685     return NOTIFY_DONE;
    686 }
    687 #endif
    688636
    689637/**
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