VirtualBox

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

Last change on this file since 71651 was 71651, checked in by vboxsync, 7 years ago

DevVGA,VBoxC,++: Code cleanup in progress. bugref:9094

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/* $Id: HGSMIHost.h 71651 2018-04-04 12:20:08Z vboxsync $ */
2/** @file
3 * VBox Host Guest Shared Memory Interface (HGSMI), host part.
4 */
5
6/*
7 * Copyright (C) 2006-2017 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19#ifndef ___HGSMIHost_h
20#define ___HGSMIHost_h
21
22#include <VBox/vmm/vm.h>
23
24#include <HGSMI.h>
25#include <HGSMIChSetup.h>
26
27struct HGSMIINSTANCE;
28typedef struct HGSMIINSTANCE *PHGSMIINSTANCE;
29
30/** Callback for the guest notification about a new host buffer. */
31typedef DECLCALLBACK(void) FNHGSMINOTIFYGUEST(void *pvCallback);
32typedef FNHGSMINOTIFYGUEST *PFNHGSMINOTIFYGUEST;
33
34/*
35 * Public Host API for virtual devices.
36 */
37
38int HGSMICreate(PHGSMIINSTANCE *ppIns,
39 PVM pVM,
40 const char *pszName,
41 HGSMIOFFSET offBase,
42 uint8_t *pu8MemBase,
43 HGSMISIZE cbMem,
44 PFNHGSMINOTIFYGUEST pfnNotifyGuest,
45 void *pvNotifyGuest,
46 size_t cbContext);
47void HGSMIDestroy(PHGSMIINSTANCE pIns);
48void *HGSMIContext(PHGSMIINSTANCE pIns);
49
50void RT_UNTRUSTED_VOLATILE_GUEST *HGSMIOffsetToPointerHost(PHGSMIINSTANCE pIns, HGSMIOFFSET offBuffer);
51HGSMIOFFSET HGSMIPointerToOffsetHost(PHGSMIINSTANCE pIns, const void RT_UNTRUSTED_VOLATILE_GUEST *pv);
52bool HGSMIIsOffsetValid(PHGSMIINSTANCE pIns, HGSMIOFFSET offBuffer);
53HGSMIOFFSET HGSMIGetAreaOffset(PHGSMIINSTANCE pIns);
54HGSMIOFFSET HGSMIGetAreaSize(PHGSMIINSTANCE pIns);
55
56
57int HGSMIHostChannelRegister(PHGSMIINSTANCE pIns, uint8_t u8Channel,
58 PFNHGSMICHANNELHANDLER pfnChannelHandler, void *pvChannelHandler);
59#if 0 /* unused */
60int HGSMIChannelRegisterName (PHGSMIINSTANCE pIns,
61 const char *pszChannel,
62 PFNHGSMICHANNELHANDLER pfnChannelHandler,
63 void *pvChannelHandler,
64 uint8_t *pu8Channel);
65#endif
66
67int HGSMIHostHeapSetup(PHGSMIINSTANCE pIns, HGSMIOFFSET RT_UNTRUSTED_GUEST offHeap, HGSMISIZE RT_UNTRUSTED_GUEST cbHeap);
68
69/*
70 * Virtual hardware IO handlers.
71 */
72
73/* Guests passes a new command buffer to the host. */
74void HGSMIGuestWrite(PHGSMIINSTANCE pIns, HGSMIOFFSET offBuffer);
75
76/* Guest reads information about guest buffers. */
77HGSMIOFFSET HGSMIGuestRead(PHGSMIINSTANCE pIns);
78
79/* Guest reads the host FIFO to get a command. */
80HGSMIOFFSET HGSMIHostRead(PHGSMIINSTANCE pIns);
81
82/* Guest reports that the command at this offset has been processed. */
83void HGSMIHostWrite(PHGSMIINSTANCE pIns, HGSMIOFFSET offBuffer);
84
85void HGSMISetHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
86uint32_t HGSMIGetHostGuestFlags(HGSMIINSTANCE *pIns);
87
88void HGSMIClearHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
89
90/*
91 * Low level interface for submitting buffers to the guest.
92 *
93 * These functions are not directly available for anyone but the
94 * virtual hardware device.
95 */
96
97/* Allocate a buffer in the host heap. */
98int HGSMIHostCommandAlloc(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST **ppvData, HGSMISIZE cbData,
99 uint8_t u8Channel, uint16_t u16ChannelInfo);
100int HGSMIHostCommandSubmitAndFreeAsynch(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST *pvData, bool fDoIrq);
101int HGSMIHostCommandFree(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST *pvData);
102
103int HGSMIHostLoadStateExec(PHGSMIINSTANCE pIns, PSSMHANDLE pSSM, uint32_t u32Version);
104int HGSMIHostSaveStateExec(PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
105
106#ifdef VBOX_WITH_WDDM
107int HGSMICompleteGuestCommand(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST *pvMem, bool fDoIrq);
108#endif
109
110#endif /* !___HGSMIHost_h*/
111
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