Changeset 15041 in vbox
- Timestamp:
- Dec 5, 2008 1:30:33 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40420
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r15003 r15041 54 54 #include <iprt/process.h> 55 55 #include <iprt/alloc.h> 56 #include <iprt/power.h> 56 57 #include <VBox/err.h> 57 58 #include <VBox/log.h> … … 66 67 #include <IOKit/IOService.h> 67 68 #include <IOKit/IOUserclient.h> 69 #include <IOKit/pwr_mgt/RootDomain.h> 68 70 69 71 … … 90 92 91 93 static int VBoxDrvDarwinErr2DarwinErr(int rc); 94 95 static IOReturn VBoxDrvDarwinSleepHandler(void *pvTarget, void *pvRefCon, UInt32 uMessageType, IOService *pProvider, void *pvMessageArgument, vm_size_t argSize); 92 96 __END_DECLS 93 97 … … 202 206 /** The number of open sessions. */ 203 207 static int32_t volatile g_cSessions = 0; 208 /** The notifier handle for the sleep callback handler. */ 209 static IONotifier *g_pSleepNotifier = NULL; 204 210 205 211 … … 251 257 LogRel(("VBoxDrv: version " VBOX_VERSION_STRING " r%d; IOCtl version %#x; IDC version %#x; dev major=%d\n", 252 258 VBOX_SVN_REV, SUPDRV_IOC_VERSION, SUPDRV_IDC_VERSION, g_iMajorDeviceNo)); 259 260 /* Bird: please acknowledge! */ 261 #if 0 262 /* Register a sleep/wakeup notification callback */ 263 void *pvData = NULL; 264 g_pSleepNotifier = registerPrioritySleepWakeInterest(&VBoxDrvDarwinSleepHandler, pvData, NULL); 265 if (g_pSleepNotifier == NULL) 266 LogRel(("VBoxDrv: register for sleep/wakeup events failed\n")); 267 #endif 268 253 269 return KMOD_RETURN_SUCCESS; 254 270 } … … 293 309 * Undo the work done during start (in reverse order). 294 310 */ 311 if (g_pSleepNotifier) 312 { 313 g_pSleepNotifier->remove(); 314 g_pSleepNotifier = NULL; 315 } 316 295 317 devfs_remove(g_hDevFsDevice); 296 318 g_hDevFsDevice = NULL; … … 658 680 NOREF(prc); 659 681 return false; 682 } 683 684 IOReturn VBoxDrvDarwinSleepHandler(void * /* pvTarget */, void *pvRefCon, UInt32 uMessageType, IOService * /* pProvider */, void * /* pvMessageArgument */, vm_size_t /* argSize */) 685 { 686 /* IOLog("VBoxDrv: Got sleep/wake notice. Message type was %X\n", (uint)uMessageType); */ 687 688 if (uMessageType == kIOMessageSystemWillSleep) 689 RTPowerSignalEvent(RTPOWEREVENT_SUSPEND); 690 else if (uMessageType == kIOMessageSystemHasPoweredOn) 691 RTPowerSignalEvent(RTPOWEREVENT_RESUME); 692 693 acknowledgeSleepWakeNotification(pvRefCon); 694 695 return 0; 660 696 } 661 697
Note:
See TracChangeset
for help on using the changeset viewer.