VirtualBox

Changeset 48034 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 23, 2013 4:03:04 PM (11 years ago)
Author:
vboxsync
Message:

Guest Additions: add release logger to VBoxGuest driver (enabled for darwin only); make VBoxGuest.kext workable on 64 bit system.

Location:
trunk/src/VBox/Additions/common
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r45459 r48034  
    3939 VBoxGuest_DEFS.solaris  = VBOX_SVN_REV=$(VBOX_SVN_REV)
    4040 VBoxGuest_DEFS.win      = # VBOX_WITH_VRDP_SESSION_HANDLING
     41 VBoxGuest_DEFS.darwin   = VBOX_GUESTDRV_WITH_RELEASE_LOGGER
    4142 ifeq ($(KBUILD_TYPE),release)
    4243  # Allow stopping/removing the driver without a reboot
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp

    r46354 r48034  
    799799                                /* register the service. */
    800800                                registerService();
    801                                 printf("VBoxGuest: Successfully started I/O kit class instance.\n");
     801                                LogRel(("VBoxGuest: Successfully started I/O kit class instance.\n"));
    802802                                return true;
    803803                            }
    804804
    805                             printf("VBoxGuest: Failed to set up interrupts\n");
     805                            LogRel(("VBoxGuest: Failed to set up interrupts\n"));
    806806                            VbgdDarwinCharDevRemove();
    807807                        }
    808808                        else
    809                             printf("VBoxGuest: Failed to initialize character device (rc=%d).\n", rc);
     809                            LogRel(("VBoxGuest: Failed to initialize character device (rc=%d).\n", rc));
    810810
    811811                        VBoxGuestDeleteDevExt(&g_DevExt);
    812812                    }
    813813                    else
    814                         printf("VBoxGuest: Failed to initialize common code (rc=%d).\n", rc);
     814                        LogRel(("VBoxGuest: Failed to initialize common code (rc=%d).\n", rc));
    815815
    816816                    if (m_pMap)
     
    822822            }
    823823            else
    824                 printf("VBoxGuest: The device missing is the I/O port range (#0).\n");
     824                LogRel(("VBoxGuest: The device missing is the I/O port range (#0).\n"));
    825825        }
    826826        else
    827             printf("VBoxGuest: Not the VMMDev (%#x:%#x).\n",
    828                    m_pIOPCIDevice->configRead16(kIOPCIConfigVendorID), m_pIOPCIDevice->configRead16(kIOPCIConfigDeviceID));
     827            LogRel(("VBoxGuest: Not the VMMDev (%#x:%#x).\n",
     828                   m_pIOPCIDevice->configRead16(kIOPCIConfigVendorID), m_pIOPCIDevice->configRead16(kIOPCIConfigDeviceID)));
    829829    }
    830830    else
    831         printf("VBoxGuest: Provider is not an instance of IOPCIDevice.\n");
     831        LogRel(("VBoxGuest: Provider is not an instance of IOPCIDevice.\n"));
    832832
    833833    ASMAtomicXchgBool(&g_fInstantiated, false);
     
    850850    /* Low level termination should be performed only once */
    851851    if (!disableVmmDevInterrupts())
    852         printf("vboxguest: unable to unregister interrupt handler\n");
     852        LogRel(("vboxguest: unable to unregister interrupt handler\n"));
    853853
    854854    VbgdDarwinCharDevRemove();
     
    865865    ASMAtomicWriteBool(&g_fInstantiated, false);
    866866
    867     printf("vboxguest module unloaded\n");
     867    LogRel(("vboxguest module unloaded\n"));
    868868}
    869869
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r47294 r48034  
    751751    unsigned i;
    752752
     753#ifdef VBOX_GUESTDRV_WITH_RELEASE_LOGGER
     754    /*
     755     * Create the release log.
     756     */
     757    static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
     758    PRTLOGGER pRelLogger;
     759    rc = RTLogCreate(&pRelLogger, 0 /* fFlags */, "all",
     760                     "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_STDOUT | RTLOGDEST_DEBUGGER, NULL);
     761    if (RT_SUCCESS(rc))
     762        RTLogRelSetDefaultInstance(pRelLogger);
     763    /** @todo Add native hook for getting logger config parameters and setting
     764     *        them. On linux we should use the module parameter stuff... */
     765#endif
     766
    753767    /*
    754768     * Adjust fFixedEvents.
     
    905919    rc2 = RTSpinlockDestroy(pDevExt->EventSpinlock); AssertRC(rc2);
    906920    rc2 = RTSpinlockDestroy(pDevExt->SessionSpinlock); AssertRC(rc2);
     921
     922#ifdef VBOX_GUESTDRV_WITH_RELEASE_LOGGER
     923    RTLogDestroy(RTLogRelSetDefaultInstance(NULL));
     924    RTLogDestroy(RTLogSetDefaultInstance(NULL));
     925#endif
    907926    return rc; /* (failed) */
    908927}
     
    974993    pDevExt->IOPortBase = 0;
    975994    pDevExt->pIrqAckEvents = NULL;
     995
     996#ifdef VBOX_GUESTDRV_WITH_RELEASE_LOGGER
     997    RTLogDestroy(RTLogRelSetDefaultInstance(NULL));
     998    RTLogDestroy(RTLogSetDefaultInstance(NULL));
     999#endif
     1000
    9761001}
    9771002
     
    13851410    if (RT_UNLIKELY(iEvent < 0))
    13861411    {
    1387         Log(("VBoxGuestCommonIOCtl: WAITEVENT: Invalid input mask %#x!!\n", fReqEvents));
     1412        LogRel(("VBoxGuestCommonIOCtl: WAITEVENT: Invalid input mask %#x!!\n", fReqEvents));
    13881413        return VERR_INVALID_PARAMETER;
    13891414    }
     
    17151740    if (cbReq < cbMinSize)
    17161741    {
    1717         Log(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid hdr size %#x, expected >= %#x; type=%#x!!\n",
     1742        LogRel(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid hdr size %#x, expected >= %#x; type=%#x!!\n",
    17181743             cbReq, cbMinSize, enmType));
    17191744        return VERR_INVALID_PARAMETER;
     
    17211746    if (cbReq > cbData)
    17221747    {
    1723         Log(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid size %#x, expected >= %#x (hdr); type=%#x!!\n",
     1748        LogRel(("VBoxGuestCommonIOCtl: VMMREQUEST: invalid size %#x, expected >= %#x (hdr); type=%#x!!\n",
    17241749             cbData, cbReq, enmType));
    17251750        return VERR_INVALID_PARAMETER;
  • trunk/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp

    r45459 r48034  
    5050/** The max parameter buffer size for a kernel request. */
    5151#define VBGLR0_MAX_HGCM_KERNEL_PARM     (16*_1M)
    52 #if defined(RT_OS_LINUX) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86))
     52#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
    5353/** Linux needs to use bounce buffers since RTR0MemObjLockUser has unwanted
    5454 * side effects.
    55  * Darwin 32bit also needs this because of 4GB/4GB user/kernel space. */
     55 * Darwin 32bit & 64bit also needs this because of 4GB/4GB user/kernel space. */
    5656# define USE_BOUNCE_BUFFERS
    5757#endif
Note: See TracChangeset for help on using the changeset viewer.

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