VirtualBox

Changeset 99962 in vbox


Ignore:
Timestamp:
May 24, 2023 11:27:39 PM (18 months ago)
Author:
vboxsync
Message:

VBox/types.h,pdmnetifs.h: Replaced PDMDATASEG with RTSGSEG since the two structures are identical. This should make it easy to create a RTSGBUF for a PDMSCATTERGATHER buffer (just limit the operations to cbUsed bytes).

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r99241 r99962  
    10161016
    10171017/**
    1018  * Data transport buffer (scatter/gather)
    1019  */
    1020 typedef struct PDMDATASEG
    1021 {
    1022     /** Length of buffer in entry. */
    1023     size_t  cbSeg;
    1024     /** Pointer to the start of the buffer. */
    1025     void   *pvSeg;
    1026 } PDMDATASEG;
    1027 /** Pointer to a data transport segment. */
    1028 typedef PDMDATASEG *PPDMDATASEG;
    1029 /** Pointer to a const data transport segment. */
    1030 typedef PDMDATASEG const *PCPDMDATASEG;
    1031 
    1032 
    1033 /**
    10341018 * Forms of generic segment offloading.
    10351019 */
  • trunk/include/VBox/vmm/pdmnetifs.h

    r98103 r99962  
    4141
    4242#include <VBox/types.h>
     43#include <iprt/sg.h>
    4344
    4445
     
    5354/**
    5455 * PDM scatter/gather buffer.
    55  *
     56 * 
     57 * @note    This is a little bit similar to the RTSGBUF structure in IPRT.
     58 * 
     59 *          It is possible to reuse the PDMSCATTERGATHER::aSegs member here in a
     60 *          RTSGBUF, but must always remember to specify
     61 *          PDMSCATTERGATHER::cbUsed as the max length to any RTSgBufXxxx API
     62 *          call, since the segments here will (normally) describe the full
     63 *          PDMSCATTERGATHER::cbAvailable length.
     64 * 
    5665 * @todo Promote this to VBox/types.h, VBox/vmm/pdmcommon.h or some such place.
    5766 */
     
    7382     * This is set on alloc and not changed by the user. */
    7483    size_t          cSegs;
    75     /** Variable sized array of segments. */
    76     PDMDATASEG      aSegs[1];
     84    /** Variable sized array of segments.
     85     * This describes the max allocated buffer length, consumers must limit
     86     * operations to PDMSCATTERGATHER::cbUser. */
     87    RTSGSEG         aSegs[1];
    7788} PDMSCATTERGATHER;
    7889/** Pointer to a PDM scatter/gather buffer. */
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