1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox Host Guest Shared Memory Interface (HGSMI).
|
---|
4 | * OS-independent guest structures.
|
---|
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 | * The contents of this file may alternatively be used under the terms
|
---|
19 | * of the Common Development and Distribution License Version 1.0
|
---|
20 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
21 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
22 | * CDDL are applicable instead of those of the GPL.
|
---|
23 | *
|
---|
24 | * You may elect to license modified versions of this file under the
|
---|
25 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
26 | */
|
---|
27 |
|
---|
28 |
|
---|
29 | #ifndef __HGSMI_GUEST_h__
|
---|
30 | #define __HGSMI_GUEST_h__
|
---|
31 |
|
---|
32 | #include <VBox/HGSMI/HGSMI.h>
|
---|
33 | #include <VBox/HGSMI/HGSMIChSetup.h>
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * Structure grouping the context needed for submitting commands to the host
|
---|
37 | * via HGSMI
|
---|
38 | */
|
---|
39 | typedef struct _HGSMIGUESTCOMMANDCONTEXT
|
---|
40 | {
|
---|
41 | /** Information about the memory heap located in VRAM from which data
|
---|
42 | * structures to be sent to the host are allocated. */
|
---|
43 | HGSMIHEAP heapCtx;
|
---|
44 | /** The I/O port used for submitting commands to the host by writing their
|
---|
45 | * offsets into the heap. */
|
---|
46 | RTIOPORT port;
|
---|
47 | } HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT;
|
---|
48 |
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * Structure grouping the context needed for receiving commands from the host
|
---|
52 | * via HGSMI
|
---|
53 | */
|
---|
54 | typedef struct _HGSMIHOSTCOMMANDCONTEXT
|
---|
55 | {
|
---|
56 | /** Information about the memory area located in VRAM in which the host
|
---|
57 | * places data structures to be read by the guest. */
|
---|
58 | HGSMIAREA areaCtx;
|
---|
59 | /** Convenience structure used for matching host commands to handlers. */
|
---|
60 | /** @todo handlers are registered individually in code rather than just
|
---|
61 | * passing a static structure in order to gain extra flexibility. There is
|
---|
62 | * currently no expected usage case for this though. Is the additional
|
---|
63 | * complexity really justified? */
|
---|
64 | HGSMICHANNELINFO channels;
|
---|
65 | /** Flag to indicate that one thread is currently processing the command
|
---|
66 | * queue. */
|
---|
67 | volatile bool fHostCmdProcessing;
|
---|
68 | /* Pointer to the VRAM location where the HGSMI host flags are kept. */
|
---|
69 | volatile HGSMIHOSTFLAGS *pfHostFlags;
|
---|
70 | /** The I/O port used for receiving commands from the host as offsets into
|
---|
71 | * the memory area and sending back confirmations (command completion,
|
---|
72 | * IRQ acknowlegement). */
|
---|
73 | RTIOPORT port;
|
---|
74 | } HGSMIHOSTCOMMANDCONTEXT, *PHGSMIHOSTCOMMANDCONTEXT;
|
---|
75 |
|
---|
76 |
|
---|
77 | #endif /* __HGSMI_GUEST_h__*/
|
---|