VirtualBox

Changeset 39504 in vbox


Ignore:
Timestamp:
Dec 1, 2011 9:39:09 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
75175
Message:

RTReq: A bit more.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/req.h

    r39503 r39504  
    6666    RTREQTYPE_MAX
    6767} RTREQTYPE;
    68 
    69 /**
    70  * Request state.
    71  */
    72 typedef enum RTREQSTATE
    73 {
    74     /** The state is invalid. */
    75     RTREQSTATE_INVALID = 0,
    76     /** The request have been allocated and is in the process of being filed. */
    77     RTREQSTATE_ALLOCATED,
    78     /** The request is queued by the requester. */
    79     RTREQSTATE_QUEUED,
    80     /** The request is begin processed. */
    81     RTREQSTATE_PROCESSING,
    82     /** The request is completed, the requester is begin notified. */
    83     RTREQSTATE_COMPLETED,
    84     /** The request packet is in the free chain. (The requester */
    85     RTREQSTATE_FREE
    86 } RTREQSTATE;
    8768
    8869/**
     
    10283
    10384
    104 /**
    105  * RT Request packet.
    106  *
    107  * This is used to request an action in the queue handler thread.
    108  */
    109 #if defined(IN_RT) || defined(IN_RT_R3) || defined(IN_RT_R0) || defined(IN_RT_RC)
    110 typedef struct RTREQ
    111 {
    112     /** Magic number (RTREQ_MAGIC). */
    113     uint32_t                u32Magic;
    114     /** Set if the event semaphore is clear. */
    115     volatile bool           fEventSemClear;
    116     /** Set if pool, clear if queue. */
    117     volatile bool           fPoolOrQueue;
    118     /** IPRT status code for the completed request. */
    119     volatile int32_t        iStatusX;
    120     /** Request state. */
    121     volatile RTREQSTATE     enmState;
    122 
    123     /** Pointer to the next request in the chain. */
    124     struct RTREQ * volatile pNext;
    125 
    126     union
    127     {
    128         /** Pointer to the pool this packet belongs to. */
    129         RTREQPOOL           hPool;
    130         /** Pointer to the queue this packet belongs to. */
    131         RTREQQUEUE          hQueue;
    132     } uOwner;
    133 
    134     /** Requester event sem.
    135      * The request can use this event semaphore to wait/poll for completion
    136      * of the request.
    137      */
    138     RTSEMEVENT              EventSem;
    139     /** Flags, RTREQ_FLAGS_*. */
    140     uint32_t                fFlags;
    141     /** Request type. */
    142     RTREQTYPE               enmType;
    143     /** Request specific data. */
    144     union RTREQ_U
    145     {
    146         /** RTREQTYPE_INTERNAL. */
    147         struct
    148         {
    149             /** Pointer to the function to be called. */
    150             PFNRT               pfn;
    151             /** Number of arguments. */
    152             uint32_t            cArgs;
    153             /** Array of arguments. */
    154             uintptr_t           aArgs[64];
    155         } Internal;
    156     } u;
    157 } RTREQ;
    158 #else
     85/** A request packet. */
    15986typedef struct RTREQ RTREQ;
    160 #endif
    16187/** Pointer to an RT request packet. */
    16288typedef RTREQ *PRTREQ;
  • trunk/src/VBox/Runtime/include/internal/req.h

    r39500 r39504  
    3030#include <iprt/types.h>
    3131
     32
    3233RT_C_DECLS_BEGIN
     34
     35/**
     36 * Request state.
     37 */
     38typedef enum RTREQSTATE
     39{
     40    /** The state is invalid. */
     41    RTREQSTATE_INVALID = 0,
     42    /** The request have been allocated and is in the process of being filed. */
     43    RTREQSTATE_ALLOCATED,
     44    /** The request is queued by the requester. */
     45    RTREQSTATE_QUEUED,
     46    /** The request is begin processed. */
     47    RTREQSTATE_PROCESSING,
     48    /** The request is completed, the requester is begin notified. */
     49    RTREQSTATE_COMPLETED,
     50    /** The request packet is in the free chain. (The requester */
     51    RTREQSTATE_FREE
     52} RTREQSTATE;
     53
     54
     55/**
     56 * RT Request packet.
     57 *
     58 * This is used to request an action in the queue handler thread.
     59 */
     60struct RTREQ
     61{
     62    /** Magic number (RTREQ_MAGIC). */
     63    uint32_t                u32Magic;
     64    /** Set if the event semaphore is clear. */
     65    volatile bool           fEventSemClear;
     66    /** Set if pool, clear if queue. */
     67    volatile bool           fPoolOrQueue;
     68    /** IPRT status code for the completed request. */
     69    volatile int32_t        iStatusX;
     70    /** Request state. */
     71    volatile RTREQSTATE     enmState;
     72
     73    /** Pointer to the next request in the chain. */
     74    struct RTREQ * volatile pNext;
     75
     76    union
     77    {
     78        /** Pointer to the pool this packet belongs to. */
     79        RTREQPOOL           hPool;
     80        /** Pointer to the queue this packet belongs to. */
     81        RTREQQUEUE          hQueue;
     82    } uOwner;
     83
     84    /** Requester event sem.
     85     * The request can use this event semaphore to wait/poll for completion
     86     * of the request.
     87     */
     88    RTSEMEVENT              EventSem;
     89    /** Flags, RTREQ_FLAGS_*. */
     90    uint32_t                fFlags;
     91    /** Request type. */
     92    RTREQTYPE               enmType;
     93    /** Request specific data. */
     94    union RTREQ_U
     95    {
     96        /** RTREQTYPE_INTERNAL. */
     97        struct
     98        {
     99            /** Pointer to the function to be called. */
     100            PFNRT               pfn;
     101            /** Number of arguments. */
     102            uint32_t            cArgs;
     103            /** Array of arguments. */
     104            uintptr_t           aArgs[64];
     105        } Internal;
     106    } u;
     107};
     108
    33109
    34110/**
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