1 | /*
|
---|
2 | * Copyright (C) 2010 Sun Microsystems, Inc.
|
---|
3 | *
|
---|
4 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
5 | * available from http://www.virtualbox.org. This file is free software;
|
---|
6 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
7 | * General Public License (GPL) as published by the Free Software
|
---|
8 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
9 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
10 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
11 | *
|
---|
12 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
13 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
14 | * additional information or have any questions.
|
---|
15 | */
|
---|
16 | #ifndef ___VBoxVideoShgsmi_h___
|
---|
17 | #define ___VBoxVideoShgsmi_h___
|
---|
18 |
|
---|
19 | #include <iprt/cdefs.h>
|
---|
20 | #include <VBox/VBoxVideo.h>
|
---|
21 |
|
---|
22 | typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext);
|
---|
23 | typedef FNVBOXSHGSMICMDCOMPLETION *PFNVBOXSHGSMICMDCOMPLETION;
|
---|
24 |
|
---|
25 | typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION_IRQ(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext,
|
---|
26 | PFNVBOXSHGSMICMDCOMPLETION *ppfnCompletion, void **ppvCompletion);
|
---|
27 | typedef FNVBOXSHGSMICMDCOMPLETION_IRQ *PFNVBOXSHGSMICMDCOMPLETION_IRQ;
|
---|
28 |
|
---|
29 | typedef struct VBOXSHGSMILIST_ENTRY
|
---|
30 | {
|
---|
31 | struct VBOXSHGSMILIST_ENTRY *pNext;
|
---|
32 | } VBOXSHGSMILIST_ENTRY, *PVBOXSHGSMILIST_ENTRY;
|
---|
33 |
|
---|
34 | typedef struct VBOXSHGSMILIST
|
---|
35 | {
|
---|
36 | PVBOXSHGSMILIST_ENTRY pFirst;
|
---|
37 | PVBOXSHGSMILIST_ENTRY pLast;
|
---|
38 | } VBOXSHGSMILIST, *PVBOXSHGSMILIST;
|
---|
39 |
|
---|
40 | DECLINLINE(bool) vboxSHGSMIListIsEmpty(PVBOXSHGSMILIST pList)
|
---|
41 | {
|
---|
42 | return !pList->pFirst;
|
---|
43 | }
|
---|
44 |
|
---|
45 | DECLINLINE(void) vboxSHGSMIListInit(PVBOXSHGSMILIST pList)
|
---|
46 | {
|
---|
47 | pList->pFirst = pList->pLast = NULL;
|
---|
48 | }
|
---|
49 |
|
---|
50 | DECLINLINE(void) vboxSHGSMIListPut(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST_ENTRY pFirst, PVBOXSHGSMILIST_ENTRY pLast)
|
---|
51 | {
|
---|
52 | Assert(pFirst);
|
---|
53 | Assert(pLast);
|
---|
54 | if (pList->pLast)
|
---|
55 | {
|
---|
56 | Assert(pList->pFirst);
|
---|
57 | pList->pLast->pNext = pFirst;
|
---|
58 | pList->pLast = pLast;
|
---|
59 | pLast->pNext = NULL;
|
---|
60 | }
|
---|
61 | else
|
---|
62 | {
|
---|
63 | Assert(!pList->pFirst);
|
---|
64 | pList->pFirst = pFirst;
|
---|
65 | pList->pLast = pLast;
|
---|
66 | }
|
---|
67 | }
|
---|
68 |
|
---|
69 | DECLINLINE(void) vboxSHGSMIListCat(PVBOXSHGSMILIST pList1, PVBOXSHGSMILIST pList2)
|
---|
70 | {
|
---|
71 | vboxSHGSMIListPut(pList1, pList2->pFirst, pList2->pLast);
|
---|
72 | pList2->pFirst = pList2->pLast = NULL;
|
---|
73 | }
|
---|
74 |
|
---|
75 | DECLINLINE(void) vboxSHGSMICmdListDetach(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST_ENTRY *ppFirst, PVBOXSHGSMILIST_ENTRY *ppLast)
|
---|
76 | {
|
---|
77 | *ppFirst = pList->pFirst;
|
---|
78 | if (ppLast)
|
---|
79 | *ppLast = pList->pLast;
|
---|
80 | pList->pFirst = NULL;
|
---|
81 | pList->pLast = NULL;
|
---|
82 | }
|
---|
83 |
|
---|
84 | DECLINLINE(void) vboxSHGSMICmdListDetach2List(PVBOXSHGSMILIST pList, PVBOXSHGSMILIST pDstList)
|
---|
85 | {
|
---|
86 | vboxSHGSMICmdListDetach(pList, &pDstList->pFirst, &pDstList->pLast);
|
---|
87 | }
|
---|
88 |
|
---|
89 | void VBoxSHGSMICommandSubmitAsynch (struct _HGSMIHEAP *pHeap, PVOID pvBuff, FNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
|
---|
90 | void VBoxSHGSMICommandSubmitAsynchIrq (struct _HGSMIHEAP * pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags);
|
---|
91 | void VBoxSHGSMICommandSubmitAsynchEvent (struct _HGSMIHEAP * pHeap, PVOID pvBuff, RTSEMEVENT hEventSem);
|
---|
92 | int VBoxSHGSMICommandSubmitSynch (struct _HGSMIHEAP * pHeap, PVOID pCmd);
|
---|
93 | int VBoxSHGSMICommandSubmitSynchCompletion (struct _HGSMIHEAP * pHeap, PVOID pCmd);
|
---|
94 | void* VBoxSHGSMICommandAlloc (struct _HGSMIHEAP * pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo);
|
---|
95 | void VBoxSHGSMICommandFree (struct _HGSMIHEAP * pHeap, void *pvBuffer);
|
---|
96 | int VBoxSHGSMICommandProcessCompletion (struct _HGSMIHEAP * pHeap, HGSMIOFFSET offCmd, bool bIrq, PVBOXSHGSMILIST pPostProcessList);
|
---|
97 | int VBoxSHGSMICommandPostprocessCompletion (struct _HGSMIHEAP * pHeap, PVBOXSHGSMILIST pPostProcessList);
|
---|
98 |
|
---|
99 | void vboxSHGSMICbCommandWrite(struct _HGSMIHEAP * pHeap, HGSMIOFFSET data);
|
---|
100 |
|
---|
101 | #endif /* #ifndef ___VBoxVideoShgsmi_h___ */
|
---|