VirtualBox

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

Last change on this file since 22652 was 22652, checked in by vboxsync, 15 years ago

fixed OSE headers

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