Changeset 25966 in vbox for trunk/src/VBox/Devices/VirtIO
- Timestamp:
- Jan 22, 2010 11:15:43 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56818
- Location:
- trunk/src/VBox/Devices/VirtIO
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VirtIO/Virtio.cpp
r25830 r25966 2 2 /** @file 3 3 * Virtio - Virtio Common Functions (VRing, VQueue, Virtio PCI) 4 *5 4 */ 6 5 7 6 /* 8 * Copyright (C) 2009 Sun Microsystems, Inc.7 * Copyright (C) 2009-2010 Sun Microsystems, Inc. 9 8 * 10 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 24 26 25 #include <iprt/param.h> 26 #include <iprt/uuid.h> 27 27 #include <VBox/pdmdev.h> 28 28 #include "Virtio.h" … … 522 522 523 523 #ifdef IN_RING3 524 /** 525 * Provides interfaces to the driver. 526 * 527 * @returns Pointer to interface. NULL if the interface is not supported. 528 * @param pInterface Pointer to this interface structure. 529 * @param enmInterface The requested interface identification. 530 * @thread EMT 531 */ 532 void *vpciQueryInterface(struct PDMIBASE *pInterface, PDMINTERFACE enmInterface) 533 { 534 VPCISTATE *pState = IFACE_TO_STATE(pInterface, IBase); 535 Assert(&pState->IBase == pInterface); 536 switch (enmInterface) 537 { 538 case PDMINTERFACE_BASE: 539 return &pState->IBase; 540 case PDMINTERFACE_LED_PORTS: 541 return &pState->ILeds; 542 default: 543 return NULL; 544 } 524 525 /** 526 * @interface_method_impl{PDMIBASE,pfnQueryInterface} 527 */ 528 void *vpciQueryInterface(struct PDMIBASE *pInterface, const char *pszIID) 529 { 530 VPCISTATE *pThis = IFACE_TO_STATE(pInterface, IBase); 531 Assert(&pThis->IBase == pInterface); 532 533 if (RTUuidCompare2Strs(pszIID, PDMIBASE_IID) == 0) 534 return &pThis->IBase; 535 if (RTUuidCompare2Strs(pszIID, PDMINTERFACE_LED_PORTS) == 0) 536 return &pThis->ILeds; 537 return NULL; 545 538 } 546 539 … … 934 927 } 935 928 936 937 929 #endif /* IN_RING3 */ 938 930 -
trunk/src/VBox/Devices/VirtIO/Virtio.h
r25158 r25966 2 2 /** @file 3 3 * Virtio.h - Virtio Declarations 4 *5 4 */ 6 5 … … 162 161 }; 163 162 163 164 /** 165 * The state of the VirtIO PCI device 166 * 167 * @implements PDMILEDPORTS 168 */ 164 169 struct VPCIState_st 165 170 { … … 172 177 #endif 173 178 179 /** Status LUN: Base interface. */ 174 180 PDMIBASE IBase; 175 PDMILEDPORTS ILeds; /**< LED interface */ 181 /** Status LUN: LED port interface. */ 182 PDMILEDPORTS ILeds; 183 /** Status LUN: LED connector (peer). */ 176 184 R3PTRTYPE(PPDMILEDCONNECTORS) pLedsConnector; 177 185 … … 263 271 void vpciRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta); 264 272 void vpciReset(PVPCISTATE pState); 265 void *vpciQueryInterface(struct PDMIBASE *pInterface, 266 PDMINTERFACE enmInterface); 273 void *vpciQueryInterface(struct PDMIBASE *pInterface, const char *pszIID); 267 274 PVQUEUE vpciAddQueue(VPCISTATE* pState, unsigned uSize, 268 275 void (*pfnCallback)(void *pvState, PVQUEUE pQueue),
Note:
See TracChangeset
for help on using the changeset viewer.