VirtualBox

source: vbox/trunk/src/VBox/Devices/Bus/PciInline.h@ 107139

Last change on this file since 107139 was 106061, checked in by vboxsync, 6 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
File size: 2.9 KB
Line 
1/* $Id: PciInline.h 106061 2024-09-16 14:03:52Z vboxsync $ */
2/** @file
3 * PCI - The PCI Controller And Devices, inline device helpers.
4 */
5
6/*
7 * Copyright (C) 2006-2024 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VBOX_INCLUDED_SRC_Bus_PciInline_h
29#define VBOX_INCLUDED_SRC_Bus_PciInline_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34DECLINLINE(void) pciDevSetPci2PciBridge(PPDMPCIDEV pDev)
35{
36 pDev->Int.s.fFlags |= PCIDEV_FLAG_PCI_TO_PCI_BRIDGE;
37}
38
39DECLINLINE(bool) pciDevIsPci2PciBridge(PPDMPCIDEV pDev)
40{
41 return (pDev->Int.s.fFlags & PCIDEV_FLAG_PCI_TO_PCI_BRIDGE) != 0;
42}
43
44DECLINLINE(void) pciDevSetPciExpress(PPDMPCIDEV pDev)
45{
46 pDev->Int.s.fFlags |= PCIDEV_FLAG_PCI_EXPRESS_DEVICE;
47}
48
49DECLINLINE(bool) pciDevIsPciExpress(PPDMPCIDEV pDev)
50{
51 return (pDev->Int.s.fFlags & PCIDEV_FLAG_PCI_EXPRESS_DEVICE) != 0;
52}
53
54DECLINLINE(void) pciDevSetMsiCapable(PPDMPCIDEV pDev)
55{
56 pDev->Int.s.fFlags |= PCIDEV_FLAG_MSI_CAPABLE;
57}
58
59DECLINLINE(void) pciDevClearMsiCapable(PPDMPCIDEV pDev)
60{
61 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_MSI_CAPABLE;
62}
63
64DECLINLINE(bool) pciDevIsMsiCapable(PPDMPCIDEV pDev)
65{
66 return (pDev->Int.s.fFlags & PCIDEV_FLAG_MSI_CAPABLE) != 0;
67}
68
69DECLINLINE(void) pciDevSetMsi64Capable(PPDMPCIDEV pDev)
70{
71 pDev->Int.s.fFlags |= PCIDEV_FLAG_MSI64_CAPABLE;
72}
73
74DECLINLINE(void) pciDevClearMsi64Capable(PPDMPCIDEV pDev)
75{
76 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_MSI64_CAPABLE;
77}
78
79DECLINLINE(bool) pciDevIsMsi64Capable(PPDMPCIDEV pDev)
80{
81 return (pDev->Int.s.fFlags & PCIDEV_FLAG_MSI64_CAPABLE) != 0;
82}
83
84DECLINLINE(void) pciDevSetMsixCapable(PPDMPCIDEV pDev)
85{
86 pDev->Int.s.fFlags |= PCIDEV_FLAG_MSIX_CAPABLE;
87}
88
89DECLINLINE(void) pciDevClearMsixCapable(PPDMPCIDEV pDev)
90{
91 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_MSIX_CAPABLE;
92}
93
94DECLINLINE(bool) pciDevIsMsixCapable(PPDMPCIDEV pDev)
95{
96 return (pDev->Int.s.fFlags & PCIDEV_FLAG_MSIX_CAPABLE) != 0;
97}
98
99DECLINLINE(void) pciDevSetPassthrough(PPDMPCIDEV pDev)
100{
101 pDev->Int.s.fFlags |= PCIDEV_FLAG_PASSTHROUGH;
102}
103
104DECLINLINE(void) pciDevClearPassthrough(PPDMPCIDEV pDev)
105{
106 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_PASSTHROUGH;
107}
108
109DECLINLINE(bool) pciDevIsPassthrough(PPDMPCIDEV pDev)
110{
111 return (pDev->Int.s.fFlags & PCIDEV_FLAG_PASSTHROUGH) != 0;
112}
113
114#endif /* !VBOX_INCLUDED_SRC_Bus_PciInline_h */
115
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