VirtualBox

Changeset 44358 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jan 24, 2013 4:05:55 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83325
Message:

PDMAsyncCompletion: PVM -> PUVM (one instance), internalize internal APIs where possible (not all because of test cases). API docs lives where the implmentation lives, NOT in headers (IPRT is the exception).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmasynccompletion.h

    r36573 r44358  
    44
    55/*
    6  * Copyright (C) 2007-2010 Oracle Corporation
     6 * Copyright (C) 2007-2013 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    105105typedef FNPDMASYNCCOMPLETEINT *PFNPDMASYNCCOMPLETEINT;
    106106
    107 
    108 /**
    109  * Creates an async completion template for a device instance.
    110  *
    111  * The template is used when creating new completion tasks.
    112  *
    113  * @returns VBox status code.
    114  * @param   pVM             Pointer to the shared VM structure.
    115  * @param   pDevIns         The device instance.
    116  * @param   ppTemplate      Where to store the template pointer on success.
    117  * @param   pfnCompleted    The completion callback routine.
    118  * @param   pszDesc         Description.
    119  */
    120 VMMR3DECL(int) PDMR3AsyncCompletionTemplateCreateDevice(PVM pVM, PPDMDEVINS pDevIns, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate, PFNPDMASYNCCOMPLETEDEV pfnCompleted, const char *pszDesc);
    121 
    122 /**
    123  * Creates an async completion template for a driver instance.
    124  *
    125  * The template is used when creating new completion tasks.
    126  *
    127  * @returns VBox status code.
    128  * @param   pVM             Pointer to the shared VM structure.
    129  * @param   pDrvIns         The driver instance.
    130  * @param   ppTemplate      Where to store the template pointer on success.
    131  * @param   pfnCompleted    The completion callback routine.
    132  * @param   pvTemplateUser  Template user argument.
    133  * @param   pszDesc         Description.
    134  */
    135 VMMR3DECL(int) PDMR3AsyncCompletionTemplateCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate, PFNPDMASYNCCOMPLETEDRV pfnCompleted, void *pvTemplateUser, const char *pszDesc);
    136 
    137 /**
    138  * Creates an async completion template for a USB device instance.
    139  *
    140  * The template is used when creating new completion tasks.
    141  *
    142  * @returns VBox status code.
    143  * @param   pVM             Pointer to the shared VM structure.
    144  * @param   pUsbIns         The USB device instance.
    145  * @param   ppTemplate      Where to store the template pointer on success.
    146  * @param   pfnCompleted    The completion callback routine.
    147  * @param   pszDesc         Description.
    148  */
    149 VMMR3DECL(int) PDMR3AsyncCompletionTemplateCreateUsb(PVM pVM, PPDMUSBINS pUsbIns, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate, PFNPDMASYNCCOMPLETEUSB pfnCompleted, const char *pszDesc);
    150 
    151 /**
    152  * Creates an async completion template for internally by the VMM.
    153  *
    154  * The template is used when creating new completion tasks.
    155  *
    156  * @returns VBox status code.
    157  * @param   pVM             Pointer to the shared VM structure.
    158  * @param   ppTemplate      Where to store the template pointer on success.
    159  * @param   pfnCompleted    The completion callback routine.
    160  * @param   pvUser2         The 2nd user argument for the callback.
    161  * @param   pszDesc         Description.
    162  */
    163107VMMR3DECL(int) PDMR3AsyncCompletionTemplateCreateInternal(PVM pVM, PPPDMASYNCCOMPLETIONTEMPLATE ppTemplate, PFNPDMASYNCCOMPLETEINT pfnCompleted, void *pvUser2, const char *pszDesc);
    164 
    165 /**
    166  * Destroys the specified async completion template.
    167  *
    168  * @returns VBox status codes:
    169  * @retval  VINF_SUCCESS on success.
    170  * @retval  VERR_PDM_ASYNC_TEMPLATE_BUSY if the template is still in use.
    171  *
    172  * @param   pTemplate       The template in question.
    173  */
    174108VMMR3DECL(int) PDMR3AsyncCompletionTemplateDestroy(PPDMASYNCCOMPLETIONTEMPLATE pTemplate);
    175 
    176 /**
    177  * Destroys all the specified async completion templates for the given device instance.
    178  *
    179  * @returns VBox status codes:
    180  * @retval  VINF_SUCCESS on success.
    181  * @retval  VERR_PDM_ASYNC_TEMPLATE_BUSY if one or more of the templates are still in use.
    182  *
    183  * @param   pVM             Pointer to the shared VM structure.
    184  * @param   pDevIns         The device instance.
    185  */
    186 VMMR3DECL(int) PDMR3AsyncCompletionTemplateDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
    187 
    188 /**
    189  * Destroys all the specified async completion templates for the given driver instance.
    190  *
    191  * @returns VBox status codes:
    192  * @retval  VINF_SUCCESS on success.
    193  * @retval  VERR_PDM_ASYNC_TEMPLATE_BUSY if one or more of the templates are still in use.
    194  *
    195  * @param   pVM             Pointer to the shared VM structure.
    196  * @param   pDrvIns         The driver instance.
    197  */
    198 VMMR3DECL(int) PDMR3AsyncCompletionTemplateDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns);
    199 
    200 /**
    201  * Destroys all the specified async completion templates for the given USB device instance.
    202  *
    203  * @returns VBox status codes:
    204  * @retval  VINF_SUCCESS on success.
    205  * @retval  VERR_PDM_ASYNC_TEMPLATE_BUSY if one or more of the templates are still in use.
    206  *
    207  * @param   pVM             Pointer to the shared VM structure.
    208  * @param   pUsbIns         The USB device instance.
    209  */
    210 VMMR3DECL(int) PDMR3AsyncCompletionTemplateDestroyUsb(PVM pVM, PPDMUSBINS pUsbIns);
    211 
    212 
    213 /**
    214  * Opens a file as an async completion endpoint.
    215  *
    216  * @returns VBox status code.
    217  * @param   ppEndpoint      Where to store the opaque endpoint handle on success.
    218  * @param   pszFilename     Path to the file which is to be opened. (UTF-8)
    219  * @param   fFlags          Open flags, see grp_pdmacep_file_flags.
    220  * @param   pTemplate       Handle to the completion callback template to use
    221  *                          for this end point.
    222  */
    223109VMMR3DECL(int) PDMR3AsyncCompletionEpCreateForFile(PPPDMASYNCCOMPLETIONENDPOINT ppEndpoint,
    224110                                                   const char *pszFilename, uint32_t fFlags,
     
    239125/** @} */
    240126
    241 /**
    242  * Closes a endpoint waiting for any pending tasks to finish.
    243  *
    244  * @returns nothing.
    245  * @param   pEndpoint       Handle of the endpoint.
    246  */
    247127VMMR3DECL(void) PDMR3AsyncCompletionEpClose(PPDMASYNCCOMPLETIONENDPOINT pEndpoint);
    248 
    249 /**
    250  * Creates a read task on the given endpoint.
    251  *
    252  * @returns VBox status code.
    253  * @param   pEndpoint       The file endpoint to read from.
    254  * @param   off             Where to start reading from.
    255  * @param   paSegments      Scatter gather list to store the data in.
    256  * @param   cSegments       Number of segments in the list.
    257  * @param   cbRead          The overall number of bytes to read.
    258  * @param   pvUser          Opaque user data returned in the completion callback
    259  *                          upon completion of the task.
    260  * @param   ppTask          Where to store the task handle on success.
    261  */
    262128VMMR3DECL(int) PDMR3AsyncCompletionEpRead(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, RTFOFF off,
    263129                                          PCRTSGSEG paSegments, unsigned cSegments,
    264130                                          size_t cbRead, void *pvUser,
    265131                                          PPPDMASYNCCOMPLETIONTASK ppTask);
    266 
    267 /**
    268  * Creates a write task on the given endpoint.
    269  *
    270  * @returns VBox status code.
    271  * @param   pEndpoint       The file endpoint to write to.
    272  * @param   off             Where to start writing at.
    273  * @param   paSegments      Scatter gather list of the data to write.
    274  * @param   cSegments       Number of segments in the list.
    275  * @param   cbWrite         The overall number of bytes to write.
    276  * @param   pvUser          Opaque user data returned in the completion callback
    277  *                          upon completion of the task.
    278  * @param   ppTask          Where to store the task handle on success.
    279  */
    280132VMMR3DECL(int) PDMR3AsyncCompletionEpWrite(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, RTFOFF off,
    281133                                           PCRTSGSEG paSegments, unsigned cSegments,
    282134                                           size_t cbWrite, void *pvUser,
    283135                                           PPPDMASYNCCOMPLETIONTASK ppTask);
    284 
    285 /**
    286  * Creates a flush task on the given endpoint.
    287  *
    288  * Every read and write task initiated before the flush task is
    289  * finished upon completion of this task.
    290  *
    291  * @returns VBox status code.
    292  * @param   pEndpoint       The file endpoint to flush.
    293  * @param   pvUser          Opaque user data returned in the completion callback
    294  *                          upon completion of the task.
    295  * @param   ppTask          Where to store the task handle on success.
    296  */
    297 VMMR3DECL(int) PDMR3AsyncCompletionEpFlush(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
    298                                            void *pvUser,
    299                                            PPPDMASYNCCOMPLETIONTASK ppTask);
    300 
    301 /**
    302  * Queries the size of an endpoint.
    303  * Not that some endpoints may not support this and will return an error
    304  * (sockets for example).
    305  *
    306  * @returns VBox status code.
    307  * @retval  VERR_NOT_SUPPORTED if the endpoint does not support this operation.
    308  * @param   pEndpoint       The file endpoint.
    309  * @param   pcbSize         Where to store the size of the endpoint.
    310  */
    311 VMMR3DECL(int) PDMR3AsyncCompletionEpGetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
    312                                              uint64_t *pcbSize);
    313 
    314 /**
    315  * Sets the size of an endpoint.
    316  * Not that some endpoints may not support this and will return an error
    317  * (sockets for example).
    318  *
    319  * @returns VBox status code.
    320  * @retval  VERR_NOT_SUPPORTED if the endpoint does not support this operation.
    321  * @param   pEndpoint       The file endpoint.
    322  * @param   cbSize          The size to set.
    323  *
    324  * @note PDMR3AsyncCompletionEpFlush should be called before this operation is executed.
    325  */
    326 VMMR3DECL(int) PDMR3AsyncCompletionEpSetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
    327                                              uint64_t cbSize);
    328 
    329 /**
    330  * Assigns or removes a bandwidth control manager to/from the endpoint.
    331  *
    332  * @returns VBox status code.
    333  * @param   pEndpoint       The endpoint.
    334  * @param   pcszBwMgr       The identifer of the new bandwidth manager to assign
    335  *                          or NULL to remove the current one.
    336  */
    337 VMMR3DECL(int) PDMR3AsyncCompletionEpSetBwMgr(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
    338                                               const char *pcszBwMgr);
    339 
    340 /**
    341  * Cancels an async completion task.
    342  *
    343  * If you want to use this method, you have to take great create to make sure
    344  * you will never attempt cancel a task which has been completed. Since there is
    345  * no reference counting or anything on the task it self, you have to serialize
    346  * the cancelation and completion paths such that the aren't racing one another.
    347  *
    348  * @returns VBox status code
    349  * @param   pTask           The Task to cancel.
    350  */
     136VMMR3DECL(int) PDMR3AsyncCompletionEpFlush(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, void *pvUser, PPPDMASYNCCOMPLETIONTASK ppTask);
     137VMMR3DECL(int) PDMR3AsyncCompletionEpGetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t *pcbSize);
     138VMMR3DECL(int) PDMR3AsyncCompletionEpSetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t cbSize);
     139VMMR3DECL(int) PDMR3AsyncCompletionEpSetBwMgr(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, const char *pszBwMgr);
    351140VMMR3DECL(int) PDMR3AsyncCompletionTaskCancel(PPDMASYNCCOMPLETIONTASK pTask);
    352 
    353 /**
    354  * Changes the limit of a bandwidth manager for file endpoints to the given value.
    355  *
    356  * @returns VBox status code.
    357  * @param   pVM             Pointer to the shared VM structure.
    358  * @param   pcszBwMgr       The identifer of the bandwidth manager to change.
    359  * @param   cbMaxNew        The new maximum for the bandwidth manager in bytes/sec.
    360  */
    361 VMMR3DECL(int) PDMR3AsyncCompletionBwMgrSetMaxForFile(PVM pVM, const char *pcszBwMgr, uint32_t cbMaxNew);
     141VMMR3DECL(int) PDMR3AsyncCompletionBwMgrSetMaxForFile(PUVM pUVM, const char *pszBwMgr, uint32_t cbMaxNew);
    362142
    363143/** @} */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette