VirtualBox

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

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

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

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1/* $Id: HGSMIHost.h 71590 2018-03-31 18:34:28Z 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);
52
53int HGSMIHostChannelRegister(PHGSMIINSTANCE pIns, uint8_t u8Channel,
54 PFNHGSMICHANNELHANDLER pfnChannelHandler, void *pvChannelHandler);
55#if 0 /* unused */
56int HGSMIChannelRegisterName (PHGSMIINSTANCE pIns,
57 const char *pszChannel,
58 PFNHGSMICHANNELHANDLER pfnChannelHandler,
59 void *pvChannelHandler,
60 uint8_t *pu8Channel);
61#endif
62
63int HGSMIHostHeapSetup(PHGSMIINSTANCE pIns, HGSMIOFFSET offHeap, HGSMISIZE cbHeap);
64
65/*
66 * Virtual hardware IO handlers.
67 */
68
69/* Guests passes a new command buffer to the host. */
70void HGSMIGuestWrite(PHGSMIINSTANCE pIns, HGSMIOFFSET offBuffer);
71
72/* Guest reads information about guest buffers. */
73HGSMIOFFSET HGSMIGuestRead(PHGSMIINSTANCE pIns);
74
75/* Guest reads the host FIFO to get a command. */
76HGSMIOFFSET HGSMIHostRead(PHGSMIINSTANCE pIns);
77
78/* Guest reports that the command at this offset has been processed. */
79void HGSMIHostWrite(PHGSMIINSTANCE pIns, HGSMIOFFSET offBuffer);
80
81void HGSMISetHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
82uint32_t HGSMIGetHostGuestFlags(HGSMIINSTANCE *pIns);
83
84void HGSMIClearHostGuestFlags(PHGSMIINSTANCE pIns, uint32_t flags);
85
86/*
87 * Low level interface for submitting buffers to the guest.
88 *
89 * These functions are not directly available for anyone but the
90 * virtual hardware device.
91 */
92
93/* Allocate a buffer in the host heap. */
94int HGSMIHostCommandAlloc(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST **ppvData, HGSMISIZE cbData,
95 uint8_t u8Channel, uint16_t u16ChannelInfo);
96int HGSMIHostCommandSubmitAndFreeAsynch(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST *pvData, bool fDoIrq);
97int HGSMIHostCommandFree(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST *pvData);
98
99int HGSMIHostLoadStateExec(PHGSMIINSTANCE pIns, PSSMHANDLE pSSM, uint32_t u32Version);
100int HGSMIHostSaveStateExec(PHGSMIINSTANCE pIns, PSSMHANDLE pSSM);
101
102#ifdef VBOX_WITH_WDDM
103int HGSMICompleteGuestCommand(PHGSMIINSTANCE pIns, void RT_UNTRUSTED_VOLATILE_GUEST *pvMem, bool fDoIrq);
104#endif
105
106#endif /* !___HGSMIHost_h*/
107
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette