1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox Video miniport driver for NT/2k/XP
|
---|
4 | * HGSMI related functions.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2009 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef ___VBoxHGSMI_h_
|
---|
24 | #define ___VBoxHGSMI_h_
|
---|
25 | typedef void* HVBOXVIDEOHGSMI;
|
---|
26 |
|
---|
27 | /* Complete host commands addressed to the display */
|
---|
28 | typedef DECLCALLBACK(void) FNVBOXVIDEOHGSMICOMPLETION(HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd);
|
---|
29 | typedef FNVBOXVIDEOHGSMICOMPLETION *PFNVBOXVIDEOHGSMICOMPLETION;
|
---|
30 |
|
---|
31 | /* request the host commands addressed to the display */
|
---|
32 | typedef DECLCALLBACK(int) FNVBOXVIDEOHGSMICOMMANDS(HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, struct _VBVAHOSTCMD ** ppCmd);
|
---|
33 | typedef FNVBOXVIDEOHGSMICOMMANDS *PFNVBOXVIDEOHGSMICOMMANDS;
|
---|
34 |
|
---|
35 | /* post guest command (offset) to the host */
|
---|
36 | typedef DECLCALLBACK(void) FNVBOXVIDEOHGSMIPOSTCOMMAND(HVBOXVIDEOHGSMI hHGSMI, HGSMIOFFSET offCmd);
|
---|
37 | typedef FNVBOXVIDEOHGSMIPOSTCOMMAND *PFNVBOXVIDEOHGSMIPOSTCOMMAND;
|
---|
38 |
|
---|
39 | /* Video Port API dynamically picked up at runtime for binary backwards compatibility with older NT versions */
|
---|
40 | #if 0
|
---|
41 | typedef VP_STATUS (*PFNWAITFORSINGLEOBJECT) (IN PVOID HwDeviceExtension, IN PVOID Object, IN PLARGE_INTEGER Timeout OPTIONAL);
|
---|
42 |
|
---|
43 | typedef LONG (*PFNSETEVENT) (IN PVOID HwDeviceExtension, IN PEVENT pEvent);
|
---|
44 | typedef VOID (*PFNCLEAREVENT) (IN PVOID HwDeviceExtension, IN PEVENT pEvent);
|
---|
45 | typedef VP_STATUS (*PFNCREATEEVENT) (IN PVOID HwDeviceExtension, IN ULONG EventFlag, IN PVOID Unused, OUT PEVENT *ppEvent);
|
---|
46 | typedef VP_STATUS (*PFNDELETEEVENT) (IN PVOID HwDeviceExtension, IN PEVENT pEvent);
|
---|
47 |
|
---|
48 | typedef VP_STATUS (*PFNCREATESPINLOCK) (IN PVOID HwDeviceExtension, OUT PSPIN_LOCK *SpinLock);
|
---|
49 | typedef VP_STATUS (*PFNDELETESPINLOCK) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock);
|
---|
50 |
|
---|
51 | typedef VOID (*PFNACQUIRESPINLOCK) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock, OUT PUCHAR OldIrql);
|
---|
52 | typedef VOID (*PFNRELEASESPINLOCK) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock, IN UCHAR NewIrql);
|
---|
53 | typedef VOID (*PFNACQUIRESPINLOCKATDPCLEVEL) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock);
|
---|
54 | typedef VOID (*PFNRELEASESPINLOCKFROMDPCLEVEL) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock);
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | typedef long VBOXVP_STATUS;
|
---|
58 | typedef struct _VIDEO_PORT_EVENT *VBOXPEVENT;
|
---|
59 | typedef struct _VIDEO_PORT_SPIN_LOCK *VBOXPSPIN_LOCK;
|
---|
60 | typedef union _LARGE_INTEGER *VBOXPLARGE_INTEGER;
|
---|
61 |
|
---|
62 | typedef enum VBOXVP_POOL_TYPE
|
---|
63 | {
|
---|
64 | VBoxVpNonPagedPool,
|
---|
65 | VBoxVpPagedPool,
|
---|
66 | VBoxVpNonPagedPoolCacheAligned = 4,
|
---|
67 | VBoxVpPagedPoolCacheAligned
|
---|
68 | } VBOXVP_POOL_TYPE;
|
---|
69 |
|
---|
70 | #define VBOXNOTIFICATION_EVENT 0x00000001UL
|
---|
71 |
|
---|
72 | #define VBOXNO_ERROR 0x00000000UL
|
---|
73 |
|
---|
74 | typedef VBOXVP_STATUS (*PFNWAITFORSINGLEOBJECT) (void* HwDeviceExtension, void* Object, VBOXPLARGE_INTEGER Timeout);
|
---|
75 |
|
---|
76 | typedef long (*PFNSETEVENT) (void* HwDeviceExtension, VBOXPEVENT pEvent);
|
---|
77 | typedef void (*PFNCLEAREVENT) (void* HwDeviceExtension, VBOXPEVENT pEvent);
|
---|
78 | typedef VBOXVP_STATUS (*PFNCREATEEVENT) (void* HwDeviceExtension, unsigned long EventFlag, void* Unused, VBOXPEVENT *ppEvent);
|
---|
79 | typedef VBOXVP_STATUS (*PFNDELETEEVENT) (void* HwDeviceExtension, VBOXPEVENT pEvent);
|
---|
80 |
|
---|
81 | typedef VBOXVP_STATUS (*PFNCREATESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK *SpinLock);
|
---|
82 | typedef VBOXVP_STATUS (*PFNDELETESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock);
|
---|
83 |
|
---|
84 | typedef void (*PFNACQUIRESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock, unsigned char * OldIrql);
|
---|
85 | typedef void (*PFNRELEASESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock, unsigned char NewIrql);
|
---|
86 | typedef void (*PFNACQUIRESPINLOCKATDPCLEVEL) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock);
|
---|
87 | typedef void (*PFNRELEASESPINLOCKFROMDPCLEVEL) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock);
|
---|
88 |
|
---|
89 | typedef void* (*PFNALLOCATEPOOL) (void* HwDeviceExtension, VBOXVP_POOL_TYPE PoolType, size_t NumberOfBytes, unsigned long Tag);
|
---|
90 | typedef void (*PFNFREEPOOL) (void* HwDeviceExtension, void* Ptr);
|
---|
91 |
|
---|
92 | typedef unsigned char (*PFNQUEUEDPC) (void* HwDeviceExtension, void (*CallbackRoutine)(void* HwDeviceExtension, void *Context), void *Context);
|
---|
93 |
|
---|
94 | /* pfn*SpinLock* functions are available */
|
---|
95 | #define VBOXVIDEOPORTPROCS_SPINLOCK 0x00000001
|
---|
96 | /* pfn*Event and pfnWaitForSingleObject functions are available */
|
---|
97 | #define VBOXVIDEOPORTPROCS_EVENT 0x00000002
|
---|
98 | /* pfn*Pool functions are available */
|
---|
99 | #define VBOXVIDEOPORTPROCS_POOL 0x00000004
|
---|
100 | /* pfnQueueDpc function is available */
|
---|
101 | #define VBOXVIDEOPORTPROCS_DPC 0x00000008
|
---|
102 |
|
---|
103 | typedef struct VBOXVIDEOPORTPROCS
|
---|
104 | {
|
---|
105 | /* ored VBOXVIDEOPORTPROCS_xxx constants describing the supported functyionality */
|
---|
106 | uint32_t fSupportedTypes;
|
---|
107 |
|
---|
108 | PFNWAITFORSINGLEOBJECT pfnWaitForSingleObject;
|
---|
109 |
|
---|
110 | PFNSETEVENT pfnSetEvent;
|
---|
111 | PFNCLEAREVENT pfnClearEvent;
|
---|
112 | PFNCREATEEVENT pfnCreateEvent;
|
---|
113 | PFNDELETEEVENT pfnDeleteEvent;
|
---|
114 |
|
---|
115 | PFNCREATESPINLOCK pfnCreateSpinLock;
|
---|
116 | PFNDELETESPINLOCK pfnDeleteSpinLock;
|
---|
117 | PFNACQUIRESPINLOCK pfnAcquireSpinLock;
|
---|
118 | PFNRELEASESPINLOCK pfnReleaseSpinLock;
|
---|
119 | PFNACQUIRESPINLOCKATDPCLEVEL pfnAcquireSpinLockAtDpcLevel;
|
---|
120 | PFNRELEASESPINLOCKFROMDPCLEVEL pfnReleaseSpinLockFromDpcLevel;
|
---|
121 |
|
---|
122 | PFNALLOCATEPOOL pfnAllocatePool;
|
---|
123 | PFNFREEPOOL pfnFreePool;
|
---|
124 |
|
---|
125 | PFNQUEUEDPC pfnQueueDpc;
|
---|
126 | } VBOXVIDEOPORTPROCS;
|
---|
127 |
|
---|
128 | #endif /* #ifndef ___VBoxHGSMI_h_ */
|
---|