1 | /* $Id: VBGLR3Internal.h 8155 2008-04-18 15:16:47Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxGuestR3Lib - Ring-3 support library for the guest additions, Internal header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | * additional information or have any questions.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef ___VBGLR3Internal_h
|
---|
23 | #define ___VBGLR3Internal_h
|
---|
24 |
|
---|
25 | #include <VBox/VBoxGuest.h>
|
---|
26 |
|
---|
27 | __BEGIN_DECLS
|
---|
28 |
|
---|
29 | int vbglR3DoIOCtl(unsigned iFunction, void *pvData, size_t cbData);
|
---|
30 | int vbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType enmReqType);
|
---|
31 | int vbglR3GRPerform(VMMDevRequestHeader *pReq);
|
---|
32 | void vbglR3GRFree(VMMDevRequestHeader *pReq);
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | DECLINLINE(void) VbglHGCMParmUInt32Set(HGCMFunctionParameter *pParm, uint32_t u32)
|
---|
37 | {
|
---|
38 | pParm->type = VMMDevHGCMParmType_32bit;
|
---|
39 | pParm->u.value64 = 0; /* init unused bits to 0 */
|
---|
40 | pParm->u.value32 = u32;
|
---|
41 | }
|
---|
42 |
|
---|
43 |
|
---|
44 | DECLINLINE(int) VbglHGCMParmUInt32Get(HGCMFunctionParameter *pParm, uint32_t *pu32)
|
---|
45 | {
|
---|
46 | if (pParm->type == VMMDevHGCMParmType_32bit)
|
---|
47 | {
|
---|
48 | *pu32 = pParm->u.value32;
|
---|
49 | return VINF_SUCCESS;
|
---|
50 | }
|
---|
51 | return VERR_INVALID_PARAMETER;
|
---|
52 | }
|
---|
53 |
|
---|
54 |
|
---|
55 | DECLINLINE(void) VbglHGCMParmPtrSet(HGCMFunctionParameter *pParm, void *pv, uint32_t cb)
|
---|
56 | {
|
---|
57 | pParm->type = VMMDevHGCMParmType_LinAddr;
|
---|
58 | pParm->u.Pointer.size = cb;
|
---|
59 | pParm->u.Pointer.u.linearAddr = (vmmDevHypPtr)pv;
|
---|
60 | }
|
---|
61 |
|
---|
62 | __END_DECLS
|
---|
63 |
|
---|
64 | #endif
|
---|