VirtualBox

Changeset 8374 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Apr 24, 2008 10:12:12 PM (17 years ago)
Author:
vboxsync
Message:

AHCI: Remove temporary buffer, map the pages of the guest in R3 and use scatter gather I/O instead.

File:
1 edited

Legend:

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

    r8312 r8374  
    9090     * used by the iSCSI media driver.  */
    9191    PDMINTERFACE_ISCSITRANSPORT,
     92    /** PDMIISCSITRANSPORTASYNC - The asynchronous iSCSI interface      (Up)    Couple with PDMINTERFACE_ISCSITRANSPORT.
     93     * extension used by the iSCSI media driver.  */
     94    PDMINTERFACE_ISCSITRANSPORTASYNC,
     95    /** PDMIISCSITRANSPORTASYNCPORT - The asynchronous iSCSI interface  (Down)  Couple with PDMINTERFACE_ISCSITRANSPORTASYNC.
     96     * notify port used by the iSCSI media driver.  */
     97    PDMINTERFACE_ISCSITRANSPORTASYNCPORT,
    9298    /** PDMIMEDIAASYNC          - Async version of the media interface  (Down)  Coupled with PDMINTERFACE_MEDIA_ASYNC_PORT. */
    9399    PDMINTERFACE_MEDIA_ASYNC,
     
    11031109} PDMIISCSITRANSPORT;
    11041110
     1111/**
     1112 * Data transport buffer (scatter/gather)
     1113 */
     1114typedef struct PDMIDATATRANSPORTSEG
     1115{
     1116    /** Length of buffer in entry. */
     1117    size_t  cbSeg;
     1118    /** Pointer to the start of the buffer. */
     1119    void   *pvSeg;
     1120} PDMIDATATRANSPORTSEG;
     1121
     1122/** Pointer to a data transport segment. */
     1123typedef PDMIDATATRANSPORTSEG *PPDMIDATATRANSPORTSEG;
     1124
     1125/** Pointer to an asynchronous iSCSI transport driver interface. */
     1126typedef struct PDMIISCSITRANSPORTASYNC *PPDMIISCSITRANSPORTASYNC;
     1127/**
     1128 * Asynchronous iSCSI transport driver interface.
     1129 */
     1130typedef struct PDMIISCSITRANSPORTASYNC
     1131{
     1132    /**
     1133     * Start an asynchronous read request from an iSCSI transport stream. Padding is performed when necessary.
     1134     *
     1135     * @returns VBox status code.
     1136     * @param   pTransport      Pointer to the interface structure containing the called function pointer.
     1137     * @param   prgResponse     Pointer to the first scatter list entry.
     1138     * @param   cnResponse      Number of scatter list entries.
     1139     * @param   pvUser          User argument which is returned in completion callback.
     1140     * @thread  EMT thread.
     1141     */
     1142    DECLR3CALLBACKMEMBER(int, pfnStartRead,(PPDMIISCSITRANSPORTASYNC pTransport, PISCSIRES prgResponse, unsigned int cnResponse, void *pvUser));
     1143
     1144    /**
     1145     * Start an asychronous write to an iSCSI transport stream. Padding is performed when necessary.
     1146     *
     1147     * @returns VBox status code.
     1148     * @param   pTransport      Pointer to the interface structure containing the called function pointer.
     1149     * @param   prgRequest      Pointer to the fist gather list entry.
     1150     * @param   cnRequest       Number of gather list entries.
     1151     * @param   pvUser          User argument which is returned in completion callback.
     1152     * @thread  EMT thread.
     1153     */
     1154    DECLR3CALLBACKMEMBER(int, pfnStartWrite,(PPDMIISCSITRANSPORTASYNC pTransport, PISCSIREQ prgRequest, unsigned int cnRequest, void *pvUser));
     1155} PDMIISCSITRANSPORTASYNC;
     1156
     1157/** Pointer to a asynchronous iSCSI transport notify interface. */
     1158typedef struct PDMIISCSITRANSPORTASYNCPORT *PPDMIISCSITRANSPORTASYNCPORT;
     1159/**
     1160 * Asynchronous iSCSI transport notify interface.
     1161 * Pair with PDMIISCSITRANSPORTASYNC.
     1162 */
     1163typedef struct PDMIISCSITRANSPORTASYNCPORT
     1164{
     1165    /**
     1166     * Notify completion of a read task.
     1167     *
     1168     * @returns VBox status code.
     1169     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     1170     * @param   prgResponse     Pointer to the first scatter list entry.
     1171     * @param   cnResponse      Number of scatter list entries.
     1172     * @param   pvUser          The user argument given in pfnStartRead.
     1173     * @thread  Any thread.
     1174     */
     1175    DECLR3CALLBACKMEMBER(int, pfnReadCompleteNotify, (PPDMIISCSITRANSPORTASYNCPORT pInterface, PISCSIRES prgResponse, unsigned int cnResponse, void *pvUser));
     1176
     1177    /**
     1178     * Notify completion of a write task.
     1179     *
     1180     * @returns VBox status code.
     1181     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     1182     * @param   prgRequest      Pointer to the fist gather list entry.
     1183     * @param   cnRequest       Number of gather list entries.
     1184     * @param   pvUser          The user argument given in pfnStartWrite.
     1185     * @thread  Any thread.
     1186     */
     1187    DECLR3CALLBACKMEMBER(int, pfnWriteCompleteNotify, (PPDMIISCSITRANSPORTASYNCPORT pTransport, PISCSIREQ prgRequest, unsigned int cnRequest, void *pvUser));
     1188} PDMIISCSITRANSPORTASYNCPORT;
    11051189
    11061190/** Pointer to a asynchronous block notify interface. */
     
    11181202     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    11191203     * @param   off             Offset the task read from.
    1120      * @param   pvBuf           The buffer containig the read data.
     1204     * @param   pSeg            Pointer to the first element in the gather list.
     1205     * @param   cSeg            Number of segments in the gather list.
    11211206     * @param   cbRead          Number of bytes read.
    11221207     * @param   pvUser          The user argument given in pfnStartRead.
    11231208     * @thread  Any thread.
    11241209     */
    1125     DECLR3CALLBACKMEMBER(int, pfnReadCompleteNotify, (PPDMIBLOCKASYNCPORT pInterface, uint64_t off, void *pvBuf, size_t cbRead, void *pvUser));
     1210    DECLR3CALLBACKMEMBER(int, pfnReadCompleteNotify, (PPDMIBLOCKASYNCPORT pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbRead, void *pvUser));
    11261211
    11271212    /**
     
    11311216     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    11321217     * @param   off             Offset the task has written to.
    1133      * @param   pvBuf           The buffer containig the written data.
    1134      * @param   cbWrite         Number of bytes actually written.
     1218     * @param   pSeg            Pointer to the first element in the scatter list.
     1219     * @param   cSeg            Number of segments in the scatter list.
     1220     * @param   cbWritten       Number of bytes actually written.
    11351221     * @param   pvUser          The user argument given in pfnStartWrite.
    11361222     * @thread  Any thread.
    11371223     */
    1138     DECLR3CALLBACKMEMBER(int, pfnWriteCompleteNotify, (PPDMIBLOCKASYNCPORT pInterface, uint64_t off, void *pvBuf, size_t cbWrite, void *pvUser));
     1224    DECLR3CALLBACKMEMBER(int, pfnWriteCompleteNotify, (PPDMIBLOCKASYNCPORT pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbWritten, void *pvUser));
    11391225} PDMIBLOCKASYNCPORT;
    11401226
     
    11541240     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    11551241     * @param   off             Offset to start reading from.
    1156      * @param   pvBuf           Where to store the read bits.
     1242     * @param   pSeg            Pointer to the first element in the scatter list.
     1243     * @param   cSeg            Number of entries in the list.
    11571244     * @param   cbRead          Number of bytes to read.
    11581245     * @param   pvUser          User argument which is returned in completion callback.
    11591246     * @thread  Any thread.
    11601247     */
    1161     DECLR3CALLBACKMEMBER(int, pfnStartRead,(PPDMIBLOCKASYNC pInterface, uint64_t off, void *pvBuf, size_t cbRead, void *pvUser));
     1248    DECLR3CALLBACKMEMBER(int, pfnStartRead,(PPDMIBLOCKASYNC pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbRead, void *pvUser));
    11621249
    11631250    /**
     
    11671254     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    11681255     * @param   off             Offset to start writing at.
    1169      * @param   pvBuf           Where to store the write bits.
     1256     * @param   pSeg            Pointer to the first element in the gather list.
     1257     * @param   cSeg            Number of entries in the list.
    11701258     * @param   cbWrite         Number of bytes to write.
    11711259     * @param   pvUser          User argument which is returned in completion callback.
    11721260     * @thread  Any thread.
    11731261     */
    1174     DECLR3CALLBACKMEMBER(int, pfnStartWrite,(PPDMIBLOCKASYNC pInterface, uint64_t off, const void *pvBuf, size_t cbWrite, void *pvUser));
     1262    DECLR3CALLBACKMEMBER(int, pfnStartWrite,(PPDMIBLOCKASYNC pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbWrite, void *pvUser));
    11751263
    11761264} PDMIBLOCKASYNC;
     
    11911279     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    11921280     * @param   off             Offset the task read from.
    1193      * @param   pvBuf           The buffer containig the read data.
     1281     * @param   pSeg            Pointer to the first element in the scatter list.
     1282     * @param   cSeg            Number of entries in the list.
    11941283     * @param   cbRead          Number of bytes read.
    11951284     * @param   pvUser          The user argument given in pfnStartRead.
    11961285     * @thread  Any thread.
    11971286     */
    1198     DECLR3CALLBACKMEMBER(int, pfnReadCompleteNotify, (PPDMIMEDIAASYNCPORT pInterface, uint64_t off, void *pvBuf, size_t cbRead, void *pvUser));
     1287    DECLR3CALLBACKMEMBER(int, pfnReadCompleteNotify, (PPDMIMEDIAASYNCPORT pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbRead, void *pvUser));
    11991288
    12001289    /**
     
    12041293     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    12051294     * @param   off             Offset the task has written to.
    1206      * @param   pvBuf           The buffer containig the written data.
     1295     * @param   pSeg            Pointer to the first element in the gather list.
     1296     * @param   cSeg            Number of entries in the list.
    12071297     * @param   cbWritten       Number of bytes actually written.
    12081298     * @param   pvUser          The user argument given in pfnStartWrite.
    12091299     * @thread  Any thread.
    12101300     */
    1211     DECLR3CALLBACKMEMBER(int, pfnWriteCompleteNotify, (PPDMIMEDIAASYNCPORT pInterface, uint64_t off, void *pvBuf, size_t cbWritten, void *pvUser));
     1301    DECLR3CALLBACKMEMBER(int, pfnWriteCompleteNotify, (PPDMIMEDIAASYNCPORT pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbWritten, void *pvUser));
    12121302} PDMIMEDIAASYNCPORT;
    12131303
     
    12271317     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    12281318     * @param   off             Offset to start reading from.
    1229      * @param   pvBuf           Where to store the read bits.
     1319     * @param   pSeg            Pointer to the first element in the scatter list.
     1320     * @param   cSeg            Number of entries in the list.
    12301321     * @param   cbRead          Number of bytes to read.
    12311322     * @param   pvUser          User data.
    12321323     * @thread  Any thread.
    12331324     */
    1234     DECLR3CALLBACKMEMBER(int, pfnStartRead,(PPDMIMEDIAASYNC pInterface, uint64_t off, void *pvBuf, size_t cbRead, void *pvUser));
     1325    DECLR3CALLBACKMEMBER(int, pfnStartRead,(PPDMIMEDIAASYNC pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbRead, void *pvUser));
    12351326
    12361327    /**
     
    12401331     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    12411332     * @param   off             Offset to start writing at.
    1242      * @param   pvBuf           Where to store the write bits.
     1333     * @param   pSeg            Pointer to the first element in the gather list.
     1334     * @param   cSeg            Number of entries in the list.
    12431335     * @param   cbWrite         Number of bytes to write.
    12441336     * @param   pvUser          User data.
    12451337     * @thread  Any thread.
    12461338     */
    1247     DECLR3CALLBACKMEMBER(int, pfnStartWrite,(PPDMIMEDIAASYNC pInterface, uint64_t off, const void *pvBuf, size_t cbWrite, void *pvUser));
     1339    DECLR3CALLBACKMEMBER(int, pfnStartWrite,(PPDMIMEDIAASYNC pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, size_t cbWrite, void *pvUser));
    12481340
    12491341} PDMIMEDIAASYNC;
     
    12641356     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    12651357     * @param   off             Offset the task read from.
    1266      * @param   pvBuf           The buffer containig the read data.
     1358     * @param   pSeg            Pointer to the first element in the scatter list.
     1359     * @param   cSeg            Number of entries in the list.
    12671360     * @param   cbRead          Number of bytes read.
    12681361     * @param   pvUser          The user argument given in pfnStartRead.
    12691362     * @thread  Any thread.
    12701363     */
    1271     DECLR3CALLBACKMEMBER(int, pfnReadCompleteNotify, (PPDMITRANSPORTASYNCPORT pInterface, uint64_t off, void *pvBuf, size_t cbRead, void *pvUser));
     1364    DECLR3CALLBACKMEMBER(int, pfnReadCompleteNotify, (PPDMITRANSPORTASYNCPORT pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg,
     1365                                                      size_t cbRead, void *pvUser));
    12721366
    12731367    /**
     
    12771371     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    12781372     * @param   off             Offset the task has written to.
    1279      * @param   pvBuf           The buffer containig the written data.
     1373     * @param   pSeg            Pointer to the first element in the gather list.
     1374     * @param   cSeg            Number of entries in the list.
    12801375     * @param   cbWritten       Number of bytes actually written.
    12811376     * @param   pvUser          The user argument given in pfnStartWrite.
    12821377     * @thread  Any thread.
    12831378     */
    1284     DECLR3CALLBACKMEMBER(int, pfnWriteCompleteNotify, (PPDMITRANSPORTASYNCPORT pInterface, uint64_t off, void *pvBuf, size_t cbWritten, void *pvUser));
     1379    DECLR3CALLBACKMEMBER(int, pfnWriteCompleteNotify, (PPDMITRANSPORTASYNCPORT pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg,
     1380                                                       size_t cbWritten, void *pvUser));
    12851381} PDMITRANSPORTASYNCPORT;
    12861382
     
    13281424     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    13291425     * @param   off             Offset to start reading from.
    1330      * @param   pvBuf           Where to store the read bits.
     1426     * @param   pSeg            Pointer to the first element in the scatter list.
     1427     * @param   cSeg            Number of entries in the list.
    13311428     * @param   cbRead          Number of bytes to read.
    13321429     * @param   pvUser          User argument returned in completion callback.
    13331430     * @thread  Any thread.
    13341431     */
    1335     DECLR3CALLBACKMEMBER(int, pfnReadStartAsynchronous,(PPDMITRANSPORTASYNC pInterface, uint64_t off, void *pvBuf, size_t cbRead, void *pvUser));
     1432    DECLR3CALLBACKMEMBER(int, pfnReadStartAsynchronous,(PPDMITRANSPORTASYNC pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg,
     1433                                                        size_t cbRead, void *pvUser));
    13361434
    13371435    /**
     
    13411439     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    13421440     * @param   off             Offset to start writing at.
    1343      * @param   pvBuf           Where to store the write bits.
     1441     * @param   pSeg            Pointer to the first element in the gather list.
     1442     * @param   cSeg            Number of entries in the list.
    13441443     * @param   cbWrite         Number of bytes to write.
    13451444     * @param   pvUser          User argument returned in completion callback.
    13461445     * @thread  Any thread.
    13471446     */
    1348     DECLR3CALLBACKMEMBER(int, pfnWriteStartAsynchronous,(PPDMITRANSPORTASYNC pInterface, uint64_t off, const void *pvBuf, size_t cbWrite, void *pvUser));
     1447    DECLR3CALLBACKMEMBER(int, pfnWriteStartAsynchronous,(PPDMITRANSPORTASYNC pInterface, uint64_t off, PPDMIDATATRANSPORTSEG pSeg, unsigned cSeg, 
     1448                                                         size_t cbWrite, void *pvUser));
    13491449
    13501450    /**
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