VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.h@ 37636

Last change on this file since 37636 was 35346, checked in by vboxsync, 14 years ago

VMM reorg: Moving the public include files from include/VBox to include/VBox/vmm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1/** @file
2 *
3 * VBox Host Guest Shared Memory Interface (HGSMI).
4 * Host part.
5 */
6
7/*
8 * Copyright (C) 2006-2008 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
20#ifndef ___HGSMIHost_h
21#define ___HGSMIHost_h
22
23#include <VBox/vmm/vm.h>
24
25#include <VBox/HGSMI/HGSMI.h>
26#include <VBox/HGSMI/HGSMIChSetup.h>
27
28struct _HGSMIINSTANCE;
29typedef struct _HGSMIINSTANCE *PHGSMIINSTANCE;
30
31/* Callback for the guest notification about a new host buffer. */
32typedef DECLCALLBACK(void) FNHGSMINOTIFYGUEST(void *pvCallback);
33typedef FNHGSMINOTIFYGUEST *PFNHGSMINOTIFYGUEST;
34
35/*
36 * Public Host API for virtual devices.
37 */
38
39int HGSMICreate (PHGSMIINSTANCE *ppIns,
40 PVM pVM,
41 const char *pszName,
42 HGSMIOFFSET offBase,
43 uint8_t *pu8MemBase,
44 HGSMISIZE cbMem,
45 PFNHGSMINOTIFYGUEST pfnNotifyGuest,
46 void *pvNotifyGuest,
47 size_t cbContext);
48
49void HGSMIDestroy (PHGSMIINSTANCE pIns);
50
51void *HGSMIContext (PHGSMIINSTANCE pIns);
52
53void *HGSMIOffsetToPointerHost (PHGSMIINSTANCE pIns,
54 HGSMIOFFSET offBuffer);
55
56HGSMIOFFSET HGSMIPointerToOffsetHost (PHGSMIINSTANCE pIns,
57 const void *pv);
58
59int HGSMIHostChannelRegister (PHGSMIINSTANCE pIns,
60 uint8_t u8Channel,
61 PFNHGSMICHANNELHANDLER pfnChannelHandler,
62 void *pvChannelHandler,
63 HGSMICHANNELHANDLER *pOldHandler);
64
65int HGSMIChannelRegisterName (PHGSMIINSTANCE pIns,
66 const char *pszChannel,
67 PFNHGSMICHANNELHANDLER pfnChannelHandler,
68 void *pvChannelHandler,
69 uint8_t *pu8Channel,
70 HGSMICHANNELHANDLER *pOldHandler);
71
72int HGSMIChannelHandlerCall (PHGSMIINSTANCE pIns,
73 const HGSMICHANNELHANDLER *pHandler,
74 const HGSMIBUFFERHEADER *pHeader);
75
76
77int HGSMISetupHostHeap (PHGSMIINSTANCE pIns,
78 HGSMIOFFSET offHeap,
79 HGSMISIZE cbHeap);
80
81int HGSMISaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
82int HGSMILoadStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
83
84/*
85 * Virtual hardware IO handlers.
86 */
87
88/* Guests passes a new command buffer to the host. */
89void HGSMIGuestWrite (PHGSMIINSTANCE pIns,
90 HGSMIOFFSET offBuffer);
91
92/* Guest reads information about guest buffers. */
93HGSMIOFFSET HGSMIGuestRead (PHGSMIINSTANCE pIns);
94
95/* Guest reads the host FIFO to get a command. */
96HGSMIOFFSET HGSMIHostRead (PHGSMIINSTANCE pIns);
97
98/* Guest reports that the command at this offset has been processed. */
99void HGSMIHostWrite (PHGSMIINSTANCE pIns,
100 HGSMIOFFSET offBuffer);
101
102void HGSMISetHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
103
104void HGSMIClearHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
105
106/*
107 * Low level interface for submitting buffers to the guest.
108 *
109 * These functions are not directly available for anyone but the
110 * virtual hardware device.
111 */
112
113/* Allocate a buffer in the host heap. */
114int HGSMIHostCommandAlloc (PHGSMIINSTANCE pIns,
115 void **ppvMem,
116 HGSMISIZE cbMem,
117 uint8_t u8Channel,
118 uint16_t u16ChannelInfo);
119
120int HGSMIHostCommandProcess (PHGSMIINSTANCE pIns,
121 void *pvMem);
122
123int HGSMIHostCommandProcessAndFreeAsynch (PHGSMIINSTANCE pIns,
124 void *pvMem,
125 bool bDoIrq);
126
127int HGSMIHostCommandFree (PHGSMIINSTANCE pIns,
128 void *pvMem);
129
130int HGSMIHostLoadStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM, uint32_t u32Version);
131
132int HGSMIHostSaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
133
134#ifdef VBOX_WITH_WDDM
135int HGSMICompleteGuestCommand(PHGSMIINSTANCE pIns, void *pvMem, bool bDoIrq);
136#endif
137
138#endif /* !___HGSMIHost_h*/
139
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