1 | /* $Id: VBoxGuestR3LibMisc.cpp 27687 2010-03-24 22:14:20Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxGuestR3Lib - Ring-3 Support Library for VirtualBox guest additions, Misc.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2007-2010 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 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | *
|
---|
26 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
27 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
28 | * additional information or have any questions.
|
---|
29 | */
|
---|
30 |
|
---|
31 |
|
---|
32 | /*******************************************************************************
|
---|
33 | * Header Files *
|
---|
34 | *******************************************************************************/
|
---|
35 | #include <VBox/log.h>
|
---|
36 | #include "VBGLR3Internal.h"
|
---|
37 |
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Change the IRQ filter mask.
|
---|
41 | *
|
---|
42 | * @returns IPRT status code.
|
---|
43 | * @param fOr The OR mask.
|
---|
44 | * @param fNo The NOT mask.
|
---|
45 | */
|
---|
46 | VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t fOr, uint32_t fNot)
|
---|
47 | {
|
---|
48 | VBoxGuestFilterMaskInfo Info;
|
---|
49 | Info.u32OrMask = fOr;
|
---|
50 | Info.u32NotMask = fNot;
|
---|
51 | return vbglR3DoIOCtl(VBOXGUEST_IOCTL_CTL_FILTER_MASK, &Info, sizeof(Info));
|
---|
52 | }
|
---|
53 |
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * Report a change in the capabilities that we support to the host.
|
---|
57 | *
|
---|
58 | * @returns IPRT status code.
|
---|
59 | * @param fOr Capabilities which have been added.
|
---|
60 | * @param fNot Capabilities which have been removed.
|
---|
61 | *
|
---|
62 | * @todo Move to a different file.
|
---|
63 | */
|
---|
64 | VBGLR3DECL(int) VbglR3SetGuestCaps(uint32_t fOr, uint32_t fNot)
|
---|
65 | {
|
---|
66 | VMMDevReqGuestCapabilities2 Req;
|
---|
67 |
|
---|
68 | vmmdevInitRequest(&Req.header, VMMDevReq_SetGuestCapabilities);
|
---|
69 | Req.u32OrMask = fOr;
|
---|
70 | Req.u32NotMask = fNot;
|
---|
71 | int rc = vbglR3GRPerform(&Req.header);
|
---|
72 | #if defined(DEBUG)
|
---|
73 | if (RT_SUCCESS(rc))
|
---|
74 | LogRel(("Successfully changed guest capabilities: or mask 0x%x, not mask 0x%x.\n", fOr, fNot));
|
---|
75 | else
|
---|
76 | LogRel(("Failed to change guest capabilities: or mask 0x%x, not mask 0x%x. rc=%Rrc.\n", fOr, fNot, rc));
|
---|
77 | #endif
|
---|
78 | return rc;
|
---|
79 | }
|
---|
80 |
|
---|