VirtualBox

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

Last change on this file since 55342 was 55342, checked in by vboxsync, 10 years ago

HGSMI: cleanup, comments.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/** @file
2 *
3 * VBox Host Guest Shared Memory Interface (HGSMI).
4 * Host part.
5 */
6
7/*
8 * Copyright (C) 2006-2015 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
64int HGSMIChannelRegisterName (PHGSMIINSTANCE pIns,
65 const char *pszChannel,
66 PFNHGSMICHANNELHANDLER pfnChannelHandler,
67 void *pvChannelHandler,
68 uint8_t *pu8Channel);
69
70int HGSMISetupHostHeap (PHGSMIINSTANCE pIns,
71 HGSMIOFFSET offHeap,
72 HGSMISIZE cbHeap);
73
74int HGSMISaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
75int HGSMILoadStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
76
77/*
78 * Virtual hardware IO handlers.
79 */
80
81/* Guests passes a new command buffer to the host. */
82void HGSMIGuestWrite (PHGSMIINSTANCE pIns,
83 HGSMIOFFSET offBuffer);
84
85/* Guest reads information about guest buffers. */
86HGSMIOFFSET HGSMIGuestRead (PHGSMIINSTANCE pIns);
87
88/* Guest reads the host FIFO to get a command. */
89HGSMIOFFSET HGSMIHostRead (PHGSMIINSTANCE pIns);
90
91/* Guest reports that the command at this offset has been processed. */
92void HGSMIHostWrite (PHGSMIINSTANCE pIns,
93 HGSMIOFFSET offBuffer);
94
95void HGSMISetHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
96
97void HGSMIClearHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
98
99/*
100 * Low level interface for submitting buffers to the guest.
101 *
102 * These functions are not directly available for anyone but the
103 * virtual hardware device.
104 */
105
106/* Allocate a buffer in the host heap. */
107int HGSMIHostCommandAlloc (PHGSMIINSTANCE pIns,
108 void **ppvMem,
109 HGSMISIZE cbMem,
110 uint8_t u8Channel,
111 uint16_t u16ChannelInfo);
112
113int HGSMIHostCommandProcess (PHGSMIINSTANCE pIns,
114 void *pvMem);
115
116int HGSMIHostCommandProcessAndFreeAsynch (PHGSMIINSTANCE pIns,
117 void *pvMem,
118 bool bDoIrq);
119
120int HGSMIHostCommandFree (PHGSMIINSTANCE pIns,
121 void *pvMem);
122
123int HGSMIHostLoadStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM, uint32_t u32Version);
124
125int HGSMIHostSaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
126
127#ifdef VBOX_WITH_WDDM
128int HGSMICompleteGuestCommand(PHGSMIINSTANCE pIns, void *pvMem, bool bDoIrq);
129#endif
130
131#endif /* !___HGSMIHost_h*/
132
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