VirtualBox

Changeset 75710 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Nov 25, 2018 1:47:39 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126909
Message:

SUPDrv-darwin.cpp: Adjustments to better diff with VBoxGuest-darwin.cpp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r75282 r75710  
    7878#endif
    7979
    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 
    8580
    8681/*********************************************************************************************************************************
     
    9388#define DEVICE_NAME_USR     "vboxdrvu"
    9489
     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/** @} */
    9597
    9698
     
    229231
    230232/** Major device number. */
    231 static int              g_iMajorDeviceNo = -1;
     233static int                  g_iMajorDeviceNo = -1;
    232234/** Registered devfs device handle for the system device. */
    233 static void            *g_hDevFsDeviceSys = NULL;
     235static void                *g_hDevFsDeviceSys = NULL;
    234236/** Registered devfs device handle for the user device. */
    235 static void            *g_hDevFsDeviceUsr = NULL;
     237static void                *g_hDevFsDeviceUsr = NULL;
    236238
    237239/** Spinlock protecting g_apSessionHashTab. */
    238 static RTSPINLOCK       g_Spinlock = NIL_RTSPINLOCK;
     240static RTSPINLOCK           g_Spinlock = NIL_RTSPINLOCK;
    239241/** Hash table */
    240 static PSUPDRVSESSION   g_apSessionHashTab[19];
     242static PSUPDRVSESSION       g_apSessionHashTab[19];
    241243/** Calculates the index into g_apSessionHashTab.*/
    242 #define SESSION_HASH(pid)     ((pid) % RT_ELEMENTS(g_apSessionHashTab))
     244#define SESSION_HASH(pid)   ((pid) % RT_ELEMENTS(g_apSessionHashTab))
    243245/** The number of open sessions. */
    244 static int32_t volatile g_cSessions = 0;
     246static int32_t volatile     g_cSessions = 0;
    245247/** The notifier handle for the sleep callback handler. */
    246 static IONotifier      *g_pSleepNotifier = NULL;
     248static IONotifier          *g_pSleepNotifier = NULL;
    247249
    248250/** Pointer to vmx_suspend(). */
     
    277279     * Initialize IPRT.
    278280     */
    279     rc = RTR0Init(0);
     281    int rc = RTR0Init(0);
    280282    if (RT_SUCCESS(rc))
    281283    {
     
    10171019 * Callback for blah blah blah.
    10181020 */
    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));
     1021IOReturn 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));
    10221026
    10231027    if (uMessageType == kIOMessageSystemWillSleep)
     
    19992003
    20002004
    2001 /*
    2002  *
     2005/* 
     2006 * 
    20032007 * org_virtualbox_SupDrv
    20042008 *
     2009 * - IOService diff resync -
     2010 * - IOService diff resync -
     2011 * - IOService diff resync -
     2012 *
    20052013 */
    20062014
     
    20112019bool org_virtualbox_SupDrv::init(OSDictionary *pDictionary)
    20122020{
    2013     LogFlow(("org_virtualbox_SupDrv::init([%p], %p)\n", this, pDictionary));
     2021    LogFlow(("IOService::init([%p], %p)\n", this, pDictionary));
    20142022    if (IOService::init(pDictionary))
    20152023    {
     
    20372045IOService *org_virtualbox_SupDrv::probe(IOService *pProvider, SInt32 *pi32Score)
    20382046{
    2039     LogFlow(("org_virtualbox_SupDrv::probe([%p])\n", this));
     2047    LogFlow(("IOService::probe([%p])\n", this));
    20402048    return IOService::probe(pProvider, pi32Score);
    20412049}
     
    21092117        return false;
    21102118
    2111     VBOX_RETRIEVE_CUR_PROC_NAME(pszProcName);
    2112 
    21132119    if (u32Type != SUP_DARWIN_IOSERVICE_COOKIE)
    21142120    {
    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));
    21162123        return false;
    21172124    }
     
    23022309IOReturn org_virtualbox_SupDrvClient::clientDied(void)
    23032310{
    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()));
    23062312
    23072313    /* IOUserClient::clientDied() calls clientClose, so we'll just do the work there. */
     
    23152321bool org_virtualbox_SupDrvClient::terminate(IOOptionBits fOptions)
    23162322{
    2317     LogFlow(("org_virtualbox_SupDrvClient::terminate([%p], %#x)\n", this, fOptions));
     2323    LogFlow(("IOService::terminate([%p], %#x)\n", this, fOptions));
    23182324    return IOUserClient::terminate(fOptions);
    23192325}
     
    23252331bool org_virtualbox_SupDrvClient::finalize(IOOptionBits fOptions)
    23262332{
    2327     LogFlow(("org_virtualbox_SupDrvClient::finalize([%p], %#x)\n", this, fOptions));
     2333    LogFlow(("IOService::finalize([%p], %#x)\n", this, fOptions));
    23282334    return IOUserClient::finalize(fOptions);
    23292335}
     
    23352341void org_virtualbox_SupDrvClient::stop(IOService *pProvider)
    23362342{
    2337     LogFlow(("org_virtualbox_SupDrvClient::stop([%p])\n", this));
     2343    LogFlow(("IOService::stop([%p])\n", this));
    23382344    IOUserClient::stop(pProvider);
    23392345}
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