VirtualBox

Changeset 50391 in vbox


Ignore:
Timestamp:
Feb 10, 2014 2:55:45 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92149
Message:

Additions/common/VBoxGuest: in-code documentation for capability acquiring.

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
2 edited

Legend:

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

    r50372 r50391  
    7575#define VBOXGUEST_ACQUIRE_STYLE_EVENTS (VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST)
    7676
     77/** Return the mask of VMM device events that this session is allowed to see,
     78 *  ergo, all events except those in "acquire" mode which have not been acquired
     79 *  by this session. */
    7780DECLINLINE(uint32_t) VBoxGuestCommonGetHandledEventsLocked(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
    7881{
     
    8083        return VMMDEV_EVENT_VALID_EVENT_MASK;
    8184
     85    /** @note VMMDEV_EVENT_VALID_EVENT_MASK should actually be the mask of valid
     86     *        capabilities, but that doesn't affect this code. */
    8287    uint32_t u32AllowedGuestCaps = pSession->u32AquiredGuestCaps | (VMMDEV_EVENT_VALID_EVENT_MASK & ~pDevExt->u32AcquireModeGuestCaps);
    8388    uint32_t u32CleanupEvents = VBOXGUEST_ACQUIRE_STYLE_EVENTS;
     
    98103}
    99104
     105/** Puts a capability in "acquire" or "set" mode and returns the mask of
     106 * capabilities currently in the other mode.  Once a capability has been put in
     107 * one of the two modes it can no longer be removed from that mode. */
    100108DECLINLINE(bool) VBoxGuestCommonGuestCapsModeSet(PVBOXGUESTDEVEXT pDevExt, uint32_t fCaps, bool fAcquire, uint32_t *pu32OtherVal)
    101109{
     
    25372545}
    25382546
     2547/** Check whether any unreported VMM device events should be reported to any of
     2548 * the currently listening sessions.  In addition, report any events in
     2549 * @a fGenFakeEvents.
     2550 * @note This is called by GUEST_CAPS_ACQUIRE in case any pending events can now
     2551 *       be dispatched to the session which acquired capabilities.  The fake
     2552 *       events are a hack to wake up threads in that session which would not
     2553 *       otherwise be woken.
     2554 * @todo Why not just use CANCEL_ALL_WAITEVENTS to do the waking up rather than
     2555 *       adding additional code to the driver?
     2556 * @todo Why does acquiring capabilities block and unblock events?  Capabilities
     2557 *       are supposed to control what is reported to the host, we already have
     2558 *       separate requests for blocking and unblocking events. */
    25392559static void VBoxGuestCommonCheckEvents(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fGenFakeEvents)
    25402560{
     
    25742594}
    25752595
     2596/** Switch the capabilities in @a fOrMask to "acquire" mode if they are not
     2597 * already in "set" mode.  If @a enmFlags is not set to
     2598 * VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE, also try to acquire those
     2599 * capabilities for the current session and release those in @a fNotFlag. */
    25762600static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fOrMask, uint32_t fNotMask, VBOXGUESTCAPSACQUIRE_FLAGS enmFlags)
    25772601{
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h

    r50372 r50391  
    180180    /** Callback and user data for a kernel mouse handler. */
    181181    VBoxGuestMouseSetNotifyCallback MouseNotifyCallback;
    182     /* list of caps used in acquire mode */
     182    /** Guest capabilities which have been set to "acquire" mode.  This means
     183     * that only one session can use them at a time, and that they will be
     184     * automatically cleaned up if that session exits without doing so. */
    183185    uint32_t                    u32AcquireModeGuestCaps;
    184     /* list of caps used in set mode */
     186    /** Guest capabilities which have been set to "set" mode.  This just means
     187     * that they have been blocked from ever being set to "acquire" mode. */
    185188    uint32_t                    u32SetModeGuestCaps;
    186     /* currently acquired (and reported) guest caps */
     189    /** Mask of all capabilities which are currently acquired by some session
     190     * and as such reported to the host. */
    187191    uint32_t                    u32GuestCaps;
    188192} VBOXGUESTDEVEXT;
     
    235239    bool                        fOpened;
    236240#endif
    237     /* Guest Caps Acquired & Reported by this session */
     241    /** Mask of guest capabilities acquired by this session.  These will all be
     242     *  reported to the host. */
    238243    uint32_t                    u32AquiredGuestCaps;
    239244    /** Whether a CANCEL_ALL_WAITEVENTS is pending.  This happens when
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