VirtualBox

source: vbox/trunk/include/VBox/pdmqueue.h@ 11153

Last change on this file since 11153 was 11147, checked in by vboxsync, 16 years ago

PDMQueueGCPtr -> PDMQueueRCPtr; strip duplicate comments.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.4 KB
Line 
1/** @file
2 * PDM - Pluggable Device Manager, Queues.
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef ___VBox_pdmqueue_h
31#define ___VBox_pdmqueue_h
32
33#include <VBox/types.h>
34
35__BEGIN_DECLS
36
37/** @defgroup grp_pdm_queue Queues
38 * @ingroup grp_pdm
39 * @{
40 */
41
42/** Pointer to a PDM queue. Also called PDM queue handle. */
43typedef struct PDMQUEUE *PPDMQUEUE;
44
45/** Pointer to a PDM queue item core. */
46typedef struct PDMQUEUEITEMCORE *PPDMQUEUEITEMCORE;
47
48/**
49 * PDM queue item core.
50 */
51typedef struct PDMQUEUEITEMCORE
52{
53 /** Pointer to the next item in the pending list - HC Pointer. */
54 R3R0PTRTYPE(PPDMQUEUEITEMCORE) pNextHC;
55 /** Pointer to the next item in the pending list - GC Pointer. */
56 RCPTRTYPE(PPDMQUEUEITEMCORE) pNextGC;
57#if HC_ARCH_BITS == 64
58 uint32_t Alignment0;
59#endif
60} PDMQUEUEITEMCORE;
61
62
63/**
64 * Queue consumer callback for devices.
65 *
66 * @returns Success indicator.
67 * If false the item will not be removed and the flushing will stop.
68 * @param pDevIns The device instance.
69 * @param pItem The item to consume. Upon return this item will be freed.
70 */
71typedef DECLCALLBACK(bool) FNPDMQUEUEDEV(PPDMDEVINS pDevIns, PPDMQUEUEITEMCORE pItem);
72/** Pointer to a FNPDMQUEUEDEV(). */
73typedef FNPDMQUEUEDEV *PFNPDMQUEUEDEV;
74
75/**
76 * Queue consumer callback for drivers.
77 *
78 * @returns Success indicator.
79 * If false the item will not be removed and the flushing will stop.
80 * @param pDrvIns The driver instance.
81 * @param pItem The item to consume. Upon return this item will be freed.
82 */
83typedef DECLCALLBACK(bool) FNPDMQUEUEDRV(PPDMDRVINS pDrvIns, PPDMQUEUEITEMCORE pItem);
84/** Pointer to a FNPDMQUEUEDRV(). */
85typedef FNPDMQUEUEDRV *PFNPDMQUEUEDRV;
86
87/**
88 * Queue consumer callback for internal component.
89 *
90 * @returns Success indicator.
91 * If false the item will not be removed and the flushing will stop.
92 * @param pVM The VM handle.
93 * @param pItem The item to consume. Upon return this item will be freed.
94 */
95typedef DECLCALLBACK(bool) FNPDMQUEUEINT(PVM pVM, PPDMQUEUEITEMCORE pItem);
96/** Pointer to a FNPDMQUEUEINT(). */
97typedef FNPDMQUEUEINT *PFNPDMQUEUEINT;
98
99/**
100 * Queue consumer callback for external component.
101 *
102 * @returns Success indicator.
103 * If false the item will not be removed and the flushing will stop.
104 * @param pvUser User argument.
105 * @param pItem The item to consume. Upon return this item will be freed.
106 */
107typedef DECLCALLBACK(bool) FNPDMQUEUEEXT(void *pvUser, PPDMQUEUEITEMCORE pItem);
108/** Pointer to a FNPDMQUEUEEXT(). */
109typedef FNPDMQUEUEEXT *PFNPDMQUEUEEXT;
110
111PDMR3DECL(int) PDMR3QueueCreateDevice(PVM pVM, PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
112 PFNPDMQUEUEDEV pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue);
113PDMR3DECL(int) PDMR3QueueCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
114 PFNPDMQUEUEDRV pfnCallback, PPDMQUEUE *ppQueue);
115PDMR3DECL(int) PDMR3QueueCreateInternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
116 PFNPDMQUEUEINT pfnCallback, bool fGCEnabled, PPDMQUEUE *ppQueue);
117PDMR3DECL(int) PDMR3QueueCreateExternal(PVM pVM, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
118 PFNPDMQUEUEEXT pfnCallback, void *pvUser, PPDMQUEUE *ppQueue);
119PDMR3DECL(int) PDMR3QueueDestroy(PPDMQUEUE pQueue);
120PDMR3DECL(int) PDMR3QueueDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
121PDMR3DECL(int) PDMR3QueueDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns);
122PDMR3DECL(void) PDMR3QueueFlushAll(PVM pVM);
123PDMR3DECL(void) PDMR3QueueFlushWorker(PVM pVM, PPDMQUEUE pQueue);
124
125PDMDECL(void) PDMQueueFlush(PPDMQUEUE pQueue);
126PDMDECL(PPDMQUEUEITEMCORE) PDMQueueAlloc(PPDMQUEUE pQueue);
127PDMDECL(void) PDMQueueInsert(PPDMQUEUE pQueue, PPDMQUEUEITEMCORE pItem);
128PDMDECL(void) PDMQueueInsertEx(PPDMQUEUE pQueue, PPDMQUEUEITEMCORE pItem, uint64_t NanoMaxDelay);
129PDMDECL(RCPTRTYPE(PPDMQUEUE)) PDMQueueRCPtr(PPDMQUEUE pQueue);
130/** @todo eliminate PDMQueueGCPtr */
131#define PDMQueueGCPtr(pQueue) PDMQueueRCPtr(pQueue)
132PDMDECL(R0PTRTYPE(PPDMQUEUE)) PDMQueueR0Ptr(PPDMQUEUE pQueue);
133
134/** @} */
135
136__END_DECLS
137
138#endif
139
140
Note: See TracBrowser for help on using the repository browser.

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