Changeset 75710 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Nov 25, 2018 1:47:39 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126909
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r75282 r75710 78 78 #endif 79 79 80 /* Temporary debugging - very temporary... */81 #define VBOX_PROC_SELFNAME_LEN (20)82 #define VBOX_RETRIEVE_CUR_PROC_NAME(_name) char _name[VBOX_PROC_SELFNAME_LEN]; \83 proc_selfname(pszProcName, VBOX_PROC_SELFNAME_LEN)84 85 80 86 81 /********************************************************************************************************************************* … … 93 88 #define DEVICE_NAME_USR "vboxdrvu" 94 89 90 91 /** @name For debugging/whatever, now permanent. 92 * @{ */ 93 #define VBOX_PROC_SELFNAME_LEN 31 94 #define VBOX_RETRIEVE_CUR_PROC_NAME(a_Name) char a_Name[VBOX_PROC_SELFNAME_LEN + 1]; \ 95 proc_selfname(a_Name, VBOX_PROC_SELFNAME_LEN) 96 /** @} */ 95 97 96 98 … … 229 231 230 232 /** Major device number. */ 231 static int g_iMajorDeviceNo = -1;233 static int g_iMajorDeviceNo = -1; 232 234 /** Registered devfs device handle for the system device. */ 233 static void *g_hDevFsDeviceSys = NULL;235 static void *g_hDevFsDeviceSys = NULL; 234 236 /** Registered devfs device handle for the user device. */ 235 static void *g_hDevFsDeviceUsr = NULL;237 static void *g_hDevFsDeviceUsr = NULL; 236 238 237 239 /** Spinlock protecting g_apSessionHashTab. */ 238 static RTSPINLOCK g_Spinlock = NIL_RTSPINLOCK;240 static RTSPINLOCK g_Spinlock = NIL_RTSPINLOCK; 239 241 /** Hash table */ 240 static PSUPDRVSESSION g_apSessionHashTab[19];242 static PSUPDRVSESSION g_apSessionHashTab[19]; 241 243 /** Calculates the index into g_apSessionHashTab.*/ 242 #define SESSION_HASH(pid) 244 #define SESSION_HASH(pid) ((pid) % RT_ELEMENTS(g_apSessionHashTab)) 243 245 /** The number of open sessions. */ 244 static int32_t volatile g_cSessions = 0;246 static int32_t volatile g_cSessions = 0; 245 247 /** The notifier handle for the sleep callback handler. */ 246 static IONotifier *g_pSleepNotifier = NULL;248 static IONotifier *g_pSleepNotifier = NULL; 247 249 248 250 /** Pointer to vmx_suspend(). */ … … 277 279 * Initialize IPRT. 278 280 */ 279 rc = RTR0Init(0);281 int rc = RTR0Init(0); 280 282 if (RT_SUCCESS(rc)) 281 283 { … … 1017 1019 * Callback for blah blah blah. 1018 1020 */ 1019 IOReturn VBoxDrvDarwinSleepHandler(void * /* pvTarget */, void *pvRefCon, UInt32 uMessageType, IOService * /* pProvider */, void * /* pvMessageArgument */, vm_size_t /* argSize */) 1020 { 1021 LogFlow(("VBoxDrv: Got sleep/wake notice. Message type was %X\n", (uint)uMessageType)); 1021 IOReturn VBoxDrvDarwinSleepHandler(void * /* pvTarget */, void *pvRefCon, UInt32 uMessageType, 1022 IOService *pProvider, void *pvMsgArg, vm_size_t cbMsgArg) 1023 { 1024 RT_NOREF(pProvider, pvMsgArg, cbMsgArg); 1025 LogFlow(("VBoxDrv: Got sleep/wake notice. Message type was %x\n", uMessageType)); 1022 1026 1023 1027 if (uMessageType == kIOMessageSystemWillSleep) … … 1999 2003 2000 2004 2001 /* 2002 * 2005 /* 2006 * 2003 2007 * org_virtualbox_SupDrv 2004 2008 * 2009 * - IOService diff resync - 2010 * - IOService diff resync - 2011 * - IOService diff resync - 2012 * 2005 2013 */ 2006 2014 … … 2011 2019 bool org_virtualbox_SupDrv::init(OSDictionary *pDictionary) 2012 2020 { 2013 LogFlow((" org_virtualbox_SupDrv::init([%p], %p)\n", this, pDictionary));2021 LogFlow(("IOService::init([%p], %p)\n", this, pDictionary)); 2014 2022 if (IOService::init(pDictionary)) 2015 2023 { … … 2037 2045 IOService *org_virtualbox_SupDrv::probe(IOService *pProvider, SInt32 *pi32Score) 2038 2046 { 2039 LogFlow((" org_virtualbox_SupDrv::probe([%p])\n", this));2047 LogFlow(("IOService::probe([%p])\n", this)); 2040 2048 return IOService::probe(pProvider, pi32Score); 2041 2049 } … … 2109 2117 return false; 2110 2118 2111 VBOX_RETRIEVE_CUR_PROC_NAME(pszProcName);2112 2113 2119 if (u32Type != SUP_DARWIN_IOSERVICE_COOKIE) 2114 2120 { 2115 LogRelMax(10,("org_virtualbox_SupDrvClient::initWithTask: Bad cookie %#x (%s)\n", u32Type, pszProcName)); 2121 VBOX_RETRIEVE_CUR_PROC_NAME(szProcName); 2122 LogRelMax(10,("org_virtualbox_SupDrvClient::initWithTask: Bad cookie %#x (%s)\n", u32Type, szProcName)); 2116 2123 return false; 2117 2124 } … … 2302 2309 IOReturn org_virtualbox_SupDrvClient::clientDied(void) 2303 2310 { 2304 LogFlow(("org_virtualbox_SupDrvClient::clientDied([%p]) m_Task=%p R0Process=%p Process=%d\n", 2305 this, m_Task, RTR0ProcHandleSelf(), RTProcSelf())); 2311 LogFlow(("IOService::clientDied([%p]) m_Task=%p R0Process=%p Process=%d\n", this, m_Task, RTR0ProcHandleSelf(), RTProcSelf())); 2306 2312 2307 2313 /* IOUserClient::clientDied() calls clientClose, so we'll just do the work there. */ … … 2315 2321 bool org_virtualbox_SupDrvClient::terminate(IOOptionBits fOptions) 2316 2322 { 2317 LogFlow((" org_virtualbox_SupDrvClient::terminate([%p], %#x)\n", this, fOptions));2323 LogFlow(("IOService::terminate([%p], %#x)\n", this, fOptions)); 2318 2324 return IOUserClient::terminate(fOptions); 2319 2325 } … … 2325 2331 bool org_virtualbox_SupDrvClient::finalize(IOOptionBits fOptions) 2326 2332 { 2327 LogFlow((" org_virtualbox_SupDrvClient::finalize([%p], %#x)\n", this, fOptions));2333 LogFlow(("IOService::finalize([%p], %#x)\n", this, fOptions)); 2328 2334 return IOUserClient::finalize(fOptions); 2329 2335 } … … 2335 2341 void org_virtualbox_SupDrvClient::stop(IOService *pProvider) 2336 2342 { 2337 LogFlow((" org_virtualbox_SupDrvClient::stop([%p])\n", this));2343 LogFlow(("IOService::stop([%p])\n", this)); 2338 2344 IOUserClient::stop(pProvider); 2339 2345 }
Note:
See TracChangeset
for help on using the changeset viewer.