VirtualBox

Changeset 26182 in vbox


Ignore:
Timestamp:
Feb 3, 2010 4:59:44 AM (15 years ago)
Author:
vboxsync
Message:

UsbMsd: More hacking.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmusb.h

    r26172 r26182  
    678678#define PDM_USBINS_VERSION                      PDM_VERSION_MAKE(0xeefd, 1, 0)
    679679
     680/**
     681 * Checks the structure versions of the USB device instance and USB device
     682 * helpers, returning if they are incompatible.
     683 *
     684 * This is for use in the constructor.
     685 *
     686 * @param   pUsbIns     The USB device instance pointer.
     687 */
     688#define PDMUSB_CHECK_VERSIONS_RETURN(pUsbIns) \
     689    do \
     690    { \
     691        PPDMUSBINS pUsbInsTypeCheck = (pUsbIns); NOREF(pUsbInsTypeCheck); \
     692        AssertLogRelMsgReturn(PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->u32Version, PDM_USBINS_VERSION), \
     693                              ("DevIns=%#x  mine=%#x\n", (pUsbIns)->u32Version, PDM_USBINS_VERSION), \
     694                              VERR_VERSION_MISMATCH); \
     695        AssertLogRelMsgReturn(PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->pHlpR3->u32Version, PDM_USBHLP_VERSION), \
     696                              ("DevHlp=%#x  mine=%#x\n", (pUsbIns)->pHlpR3->u32Version, PDM_USBHLP_VERSION), \
     697                              VERR_VERSION_MISMATCH); \
     698    } while (0)
     699
     700/**
     701 * Quietly checks the structure versions of the USB device instance and
     702 * USB device helpers, returning if they are incompatible.
     703 *
     704 * This is for use in the destructor.
     705 *
     706 * @param   pUsbIns     The USB device instance pointer.
     707 */
     708#define PDMUSB_CHECK_VERSIONS_RETURN_QUIET(pUsbIns) \
     709    do \
     710    { \
     711        PPDMUSBINS pUsbInsTypeCheck = (pUsbIns); NOREF(pUsbInsTypeCheck); \
     712        if (RT_UNLIKELY(   !PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->u32Version, PDM_USBINS_VERSION) \
     713                        || !PDM_VERSION_ARE_COMPATIBLE((pUsbIns)->pHlpR3->u32Version, PDM_USBHLPR3_VERSION) )) \
     714            return VERR_VERSION_MISMATCH; \
     715    } while (0)
     716
     717
    680718/** Converts a pointer to the PDMUSBINS::IBase to a pointer to PDMUSBINS. */
    681719#define PDMIBASE_2_PDMUSB(pInterface) ( (PPDMUSBINS)((char *)(pInterface) - RT_OFFSETOF(PDMUSBINS, IBase)) )
     
    796834}
    797835
     836/**
     837 * @copydoc PDMUSBHLP::pfnMMHeapAlloc
     838 */
     839DECLINLINE(void *) PDMUsbHlpMMHeapAlloc(PPDMUSBINS pUsbIns, size_t cb)
     840{
     841    return pUsbIns->pHlpR3->pfnMMHeapAlloc(pUsbIns, cb);
     842}
     843
     844/**
     845 * @copydoc PDMUSBHLP::pfnMMHeapAllocZ
     846 */
     847DECLINLINE(void *) PDMUsbHlpMMHeapAllocZ(PPDMUSBINS pUsbIns, size_t cb)
     848{
     849    return pUsbIns->pHlpR3->pfnMMHeapAllocZ(pUsbIns, cb);
     850}
     851
     852/**
     853 * Frees memory allocated by PDMUsbHlpMMHeapAlloc or PDMUsbHlpMMHeapAllocZ.
     854 *
     855 * @param   pUsbIns                 The USB device instance.
     856 * @param   pv                      The memory to free.  NULL is fine.
     857 */
     858DECLINLINE(void) PDMUsbHlpMMHeapFree(PPDMUSBINS pUsbIns, void *pv)
     859{
     860    NOREF(pUsbIns);
     861    MMR3HeapFree(pv);
     862}
    798863
    799864#endif /* IN_RING3 */
  • trunk/include/VBox/scsi.h

    r23356 r26182  
    190190#define SCSI_ASC_MEDIUM_NOT_PRESENT                 0x3a
    191191#define SCSI_ASC_SAVING_PARAMETERS_NOT_SUPPORTED    0x39
     192#define SCSI_ASC_INVALID_MESSAGE                    0x49
    192193#define SCSI_ASC_MEDIA_LOAD_OR_EJECT_FAILED         0x53
    193194#define SCSI_ASC_LOGICAL_UNIT_DOES_NOT_RESPOND_TO_SELECTION 0x00
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