VirtualBox

Changeset 71136 in vbox for trunk/include/iprt/nt


Ignore:
Timestamp:
Feb 27, 2018 1:17:36 PM (7 years ago)
Author:
vboxsync
Message:

SUPDrv,VMM/NEM/win: Abstracted kernel I/O control work in SUPDrv, currently only implemented & needed on windows. Made first I/O control call to VID from ring-0. bugref:9044

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nt/vid.h

    r71131 r71136  
    108108typedef VID_IOCTL_INPUT_MESSAGE_SLOT_HANDLE_AND_GET_NEXT const *PCVID_IOCTL_INPUT_MESSAGE_SLOT_HANDLE_AND_GET_NEXT;
    109109
    110 
    111 RT_C_DECLS_BEGIN
    112 
    113 /** Calling convention. */
    114 #ifndef WINAPI
    115 # define VIDAPI __stdcall
    116 #else
    117 # define VIDAPI WINAPI
    118 #endif
    119 
    120 /** Partition handle. */
    121 #ifndef WINAPI
    122 typedef void *VID_PARTITION_HANDLE;
    123 #else
    124 typedef HANDLE VID_PARTITION_HANDLE;
    125 #endif
    126 
    127 /**
    128  * Gets the partition ID.
    129  *
    130  * The partition ID is the numeric identifier used when making hypercalls to the
    131  * hypervisor.
    132  */
    133 DECLIMPORT(BOOL) VIDAPI VidGetHvPartitionId(VID_PARTITION_HANDLE hPartition, HV_PARTITION_ID *pidPartition);
    134 
    135 /**
    136  * Starts asynchronous execution of a virtual CPU.
    137  */
    138 DECLIMPORT(BOOL) VIDAPI VidStartVirtualProcessor(VID_PARTITION_HANDLE hPartition, HV_VP_INDEX iCpu);
    139 
    140 /**
    141  * Stops the asynchronous execution of a virtual CPU.
    142  *
    143  * @retval ERROR_VID_STOP_PENDING if busy with intercept, check messages.
    144  */
    145 DECLIMPORT(BOOL) VIDAPI VidStopVirtualProcessor(VID_PARTITION_HANDLE hPartition, HV_VP_INDEX iCpu);
    146 
    147 /**
    148  * WHvCreateVirtualProcessor boils down to a call to VidMessageSlotMap and
    149  * some internal WinHvPlatform state fiddling.
    150  *
    151  * Looks like it maps memory and returns the pointer to it.
    152  * VidMessageSlotHandleAndGetNext is later used to wait for the next message and
    153  * put (??) it into that memory mapping.
    154  *
    155  * @returns Success indicator (details in LastStatusValue and LastErrorValue).
    156  *
    157  * @param   hPartition  The partition handle.
    158  * @param   pOutput     Where to return the pointer to the message memory
    159  *                      mapping.  The CPU index is also returned here.
    160  * @param   iCpu        The CPU to wait-and-get messages for.
    161  */
    162 DECLIMPORT(BOOL) VIDAPI VidMessageSlotMap(VID_PARTITION_HANDLE hPartition, PVID_MAPPED_MESSAGE_SLOT pOutput, HV_VP_INDEX iCpu);
    163 
    164 /**
    165  * This is used by WHvRunVirtualProcessor to wait for the next exit msg.
    166  *
    167  * The message appears in the memory mapping returned by VidMessageSlotMap.
    168  *
    169  * @returns Success indicator (details only in LastErrorValue - LastStatusValue
    170  *          is not set).
    171  * @retval  STATUS_TIMEOUT for STATUS_TIMEOUT as well as STATUS_USER_APC and
    172  *          STATUS_ALERTED.
    173  *
    174  * @param   hPartition  The partition handle.
    175  * @param   iCpu        The CPU to wait-and-get messages for.
    176  * @param   fFlags      Flags. At least one of the two flags must be set:
    177  *                          - VID_MSHAGN_F_GET_NEXT_MESSAGE (bit 0)
    178  *                          - VID_MSHAGN_F_HANDLE_MESSAGE (bit 1)
    179  * @param   cMillies    The timeout, presumably in milliseconds.
    180  *
    181  * @todo    Would be awfully nice if someone at Microsoft could hit at the
    182  *          flags here.
    183  * @note
    184  */
    185 DECLIMPORT(BOOL) VIDAPI VidMessageSlotHandleAndGetNext(VID_PARTITION_HANDLE hPartition, HV_VP_INDEX iCpu,
    186                                                        uint32_t fFlags, uint32_t cMillies);
    187110/** @name VID_MSHAGN_F_GET_XXX - Flags for VidMessageSlotHandleAndGetNext
    188111 * @{ */
     
    196119/** @} */
    197120
     121
     122#ifdef IN_RING3
     123RT_C_DECLS_BEGIN
     124
     125/** Calling convention. */
     126#ifndef WINAPI
     127# define VIDAPI __stdcall
     128#else
     129# define VIDAPI WINAPI
     130#endif
     131
     132/** Partition handle. */
     133#ifndef WINAPI
     134typedef void *VID_PARTITION_HANDLE;
     135#else
     136typedef HANDLE VID_PARTITION_HANDLE;
     137#endif
     138
     139/**
     140 * Gets the partition ID.
     141 *
     142 * The partition ID is the numeric identifier used when making hypercalls to the
     143 * hypervisor.
     144 */
     145DECLIMPORT(BOOL) VIDAPI VidGetHvPartitionId(VID_PARTITION_HANDLE hPartition, HV_PARTITION_ID *pidPartition);
     146
     147/**
     148 * Starts asynchronous execution of a virtual CPU.
     149 */
     150DECLIMPORT(BOOL) VIDAPI VidStartVirtualProcessor(VID_PARTITION_HANDLE hPartition, HV_VP_INDEX iCpu);
     151
     152/**
     153 * Stops the asynchronous execution of a virtual CPU.
     154 *
     155 * @retval ERROR_VID_STOP_PENDING if busy with intercept, check messages.
     156 */
     157DECLIMPORT(BOOL) VIDAPI VidStopVirtualProcessor(VID_PARTITION_HANDLE hPartition, HV_VP_INDEX iCpu);
     158
     159/**
     160 * WHvCreateVirtualProcessor boils down to a call to VidMessageSlotMap and
     161 * some internal WinHvPlatform state fiddling.
     162 *
     163 * Looks like it maps memory and returns the pointer to it.
     164 * VidMessageSlotHandleAndGetNext is later used to wait for the next message and
     165 * put (??) it into that memory mapping.
     166 *
     167 * @returns Success indicator (details in LastStatusValue and LastErrorValue).
     168 *
     169 * @param   hPartition  The partition handle.
     170 * @param   pOutput     Where to return the pointer to the message memory
     171 *                      mapping.  The CPU index is also returned here.
     172 * @param   iCpu        The CPU to wait-and-get messages for.
     173 */
     174DECLIMPORT(BOOL) VIDAPI VidMessageSlotMap(VID_PARTITION_HANDLE hPartition, PVID_MAPPED_MESSAGE_SLOT pOutput, HV_VP_INDEX iCpu);
     175
     176/**
     177 * This is used by WHvRunVirtualProcessor to wait for the next exit msg.
     178 *
     179 * The message appears in the memory mapping returned by VidMessageSlotMap.
     180 *
     181 * @returns Success indicator (details only in LastErrorValue - LastStatusValue
     182 *          is not set).
     183 * @retval  STATUS_TIMEOUT for STATUS_TIMEOUT as well as STATUS_USER_APC and
     184 *          STATUS_ALERTED.
     185 *
     186 * @param   hPartition  The partition handle.
     187 * @param   iCpu        The CPU to wait-and-get messages for.
     188 * @param   fFlags      Flags. At least one of the two flags must be set:
     189 *                          - VID_MSHAGN_F_GET_NEXT_MESSAGE (bit 0)
     190 *                          - VID_MSHAGN_F_HANDLE_MESSAGE (bit 1)
     191 * @param   cMillies    The timeout, presumably in milliseconds.
     192 *
     193 * @todo    Would be awfully nice if someone at Microsoft could hit at the
     194 *          flags here.
     195 * @note
     196 */
     197DECLIMPORT(BOOL) VIDAPI VidMessageSlotHandleAndGetNext(VID_PARTITION_HANDLE hPartition, HV_VP_INDEX iCpu,
     198                                                       uint32_t fFlags, uint32_t cMillies);
    198199/**
    199200 * Gets the processor running status.
     
    219220
    220221RT_C_DECLS_END
     222#endif /* IN_RING3 */
    221223
    222224#endif
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