1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox Video miniport driver for NT/2k/XP
|
---|
4 | * HGSMI related functions.
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2009 Oracle Corporation
|
---|
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 |
|
---|
19 | #ifndef ___VBoxHGSMI_h_
|
---|
20 | #define ___VBoxHGSMI_h_
|
---|
21 | typedef void* HVBOXVIDEOHGSMI;
|
---|
22 |
|
---|
23 | /* Complete host commands addressed to the display */
|
---|
24 | typedef DECLCALLBACK(void) FNVBOXVIDEOHGSMICOMPLETION(HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd);
|
---|
25 | typedef FNVBOXVIDEOHGSMICOMPLETION *PFNVBOXVIDEOHGSMICOMPLETION;
|
---|
26 |
|
---|
27 | /* request the host commands addressed to the display */
|
---|
28 | typedef DECLCALLBACK(int) FNVBOXVIDEOHGSMICOMMANDS(HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, struct _VBVAHOSTCMD ** ppCmd);
|
---|
29 | typedef FNVBOXVIDEOHGSMICOMMANDS *PFNVBOXVIDEOHGSMICOMMANDS;
|
---|
30 |
|
---|
31 | /* post guest command (offset) to the host */
|
---|
32 | typedef DECLCALLBACK(void) FNVBOXVIDEOHGSMIPOSTCOMMAND(HVBOXVIDEOHGSMI hHGSMI, HGSMIOFFSET offCmd);
|
---|
33 | typedef FNVBOXVIDEOHGSMIPOSTCOMMAND *PFNVBOXVIDEOHGSMIPOSTCOMMAND;
|
---|
34 |
|
---|
35 | /* Video Port API dynamically picked up at runtime for binary backwards compatibility with older NT versions */
|
---|
36 | #if 0
|
---|
37 | typedef VP_STATUS (*PFNWAITFORSINGLEOBJECT) (IN PVOID HwDeviceExtension, IN PVOID Object, IN PLARGE_INTEGER Timeout OPTIONAL);
|
---|
38 |
|
---|
39 | typedef LONG (*PFNSETEVENT) (IN PVOID HwDeviceExtension, IN PEVENT pEvent);
|
---|
40 | typedef VOID (*PFNCLEAREVENT) (IN PVOID HwDeviceExtension, IN PEVENT pEvent);
|
---|
41 | typedef VP_STATUS (*PFNCREATEEVENT) (IN PVOID HwDeviceExtension, IN ULONG EventFlag, IN PVOID Unused, OUT PEVENT *ppEvent);
|
---|
42 | typedef VP_STATUS (*PFNDELETEEVENT) (IN PVOID HwDeviceExtension, IN PEVENT pEvent);
|
---|
43 |
|
---|
44 | typedef VP_STATUS (*PFNCREATESPINLOCK) (IN PVOID HwDeviceExtension, OUT PSPIN_LOCK *SpinLock);
|
---|
45 | typedef VP_STATUS (*PFNDELETESPINLOCK) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock);
|
---|
46 |
|
---|
47 | typedef VOID (*PFNACQUIRESPINLOCK) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock, OUT PUCHAR OldIrql);
|
---|
48 | typedef VOID (*PFNRELEASESPINLOCK) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock, IN UCHAR NewIrql);
|
---|
49 | typedef VOID (*PFNACQUIRESPINLOCKATDPCLEVEL) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock);
|
---|
50 | typedef VOID (*PFNRELEASESPINLOCKFROMDPCLEVEL) (IN PVOID HwDeviceExtension, IN PSPIN_LOCK SpinLock);
|
---|
51 | #endif
|
---|
52 |
|
---|
53 | typedef long VBOXVP_STATUS;
|
---|
54 | typedef struct _VIDEO_PORT_EVENT *VBOXPEVENT;
|
---|
55 | typedef struct _VIDEO_PORT_SPIN_LOCK *VBOXPSPIN_LOCK;
|
---|
56 | typedef union _LARGE_INTEGER *VBOXPLARGE_INTEGER;
|
---|
57 |
|
---|
58 | typedef enum VBOXVP_POOL_TYPE
|
---|
59 | {
|
---|
60 | VBoxVpNonPagedPool,
|
---|
61 | VBoxVpPagedPool,
|
---|
62 | VBoxVpNonPagedPoolCacheAligned = 4,
|
---|
63 | VBoxVpPagedPoolCacheAligned
|
---|
64 | } VBOXVP_POOL_TYPE;
|
---|
65 |
|
---|
66 | #define VBOXNOTIFICATION_EVENT 0x00000001UL
|
---|
67 |
|
---|
68 | #define VBOXNO_ERROR 0x00000000UL
|
---|
69 |
|
---|
70 | typedef VBOXVP_STATUS (*PFNWAITFORSINGLEOBJECT) (void* HwDeviceExtension, void* Object, VBOXPLARGE_INTEGER Timeout);
|
---|
71 |
|
---|
72 | typedef long (*PFNSETEVENT) (void* HwDeviceExtension, VBOXPEVENT pEvent);
|
---|
73 | typedef void (*PFNCLEAREVENT) (void* HwDeviceExtension, VBOXPEVENT pEvent);
|
---|
74 | typedef VBOXVP_STATUS (*PFNCREATEEVENT) (void* HwDeviceExtension, unsigned long EventFlag, void* Unused, VBOXPEVENT *ppEvent);
|
---|
75 | typedef VBOXVP_STATUS (*PFNDELETEEVENT) (void* HwDeviceExtension, VBOXPEVENT pEvent);
|
---|
76 |
|
---|
77 | typedef VBOXVP_STATUS (*PFNCREATESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK *SpinLock);
|
---|
78 | typedef VBOXVP_STATUS (*PFNDELETESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock);
|
---|
79 |
|
---|
80 | typedef void (*PFNACQUIRESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock, unsigned char * OldIrql);
|
---|
81 | typedef void (*PFNRELEASESPINLOCK) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock, unsigned char NewIrql);
|
---|
82 | typedef void (*PFNACQUIRESPINLOCKATDPCLEVEL) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock);
|
---|
83 | typedef void (*PFNRELEASESPINLOCKFROMDPCLEVEL) (void* HwDeviceExtension, VBOXPSPIN_LOCK SpinLock);
|
---|
84 |
|
---|
85 | typedef void* (*PFNALLOCATEPOOL) (void* HwDeviceExtension, VBOXVP_POOL_TYPE PoolType, size_t NumberOfBytes, unsigned long Tag);
|
---|
86 | typedef void (*PFNFREEPOOL) (void* HwDeviceExtension, void* Ptr);
|
---|
87 |
|
---|
88 | typedef unsigned char (*PFNQUEUEDPC) (void* HwDeviceExtension, void (*CallbackRoutine)(void* HwDeviceExtension, void *Context), void *Context);
|
---|
89 |
|
---|
90 | /* pfn*SpinLock* functions are available */
|
---|
91 | #define VBOXVIDEOPORTPROCS_SPINLOCK 0x00000001
|
---|
92 | /* pfn*Event and pfnWaitForSingleObject functions are available */
|
---|
93 | #define VBOXVIDEOPORTPROCS_EVENT 0x00000002
|
---|
94 | /* pfn*Pool functions are available */
|
---|
95 | #define VBOXVIDEOPORTPROCS_POOL 0x00000004
|
---|
96 | /* pfnQueueDpc function is available */
|
---|
97 | #define VBOXVIDEOPORTPROCS_DPC 0x00000008
|
---|
98 |
|
---|
99 | typedef struct VBOXVIDEOPORTPROCS
|
---|
100 | {
|
---|
101 | /* ored VBOXVIDEOPORTPROCS_xxx constants describing the supported functionality */
|
---|
102 | uint32_t fSupportedTypes;
|
---|
103 |
|
---|
104 | PFNWAITFORSINGLEOBJECT pfnWaitForSingleObject;
|
---|
105 |
|
---|
106 | PFNSETEVENT pfnSetEvent;
|
---|
107 | PFNCLEAREVENT pfnClearEvent;
|
---|
108 | PFNCREATEEVENT pfnCreateEvent;
|
---|
109 | PFNDELETEEVENT pfnDeleteEvent;
|
---|
110 |
|
---|
111 | PFNCREATESPINLOCK pfnCreateSpinLock;
|
---|
112 | PFNDELETESPINLOCK pfnDeleteSpinLock;
|
---|
113 | PFNACQUIRESPINLOCK pfnAcquireSpinLock;
|
---|
114 | PFNRELEASESPINLOCK pfnReleaseSpinLock;
|
---|
115 | PFNACQUIRESPINLOCKATDPCLEVEL pfnAcquireSpinLockAtDpcLevel;
|
---|
116 | PFNRELEASESPINLOCKFROMDPCLEVEL pfnReleaseSpinLockFromDpcLevel;
|
---|
117 |
|
---|
118 | PFNALLOCATEPOOL pfnAllocatePool;
|
---|
119 | PFNFREEPOOL pfnFreePool;
|
---|
120 |
|
---|
121 | PFNQUEUEDPC pfnQueueDpc;
|
---|
122 | } VBOXVIDEOPORTPROCS;
|
---|
123 |
|
---|
124 | #endif /* #ifndef ___VBoxHGSMI_h_ */
|
---|