VirtualBox

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

Last change on this file since 81810 was 76565, checked in by vboxsync, 6 years ago

Devices: Use VBOX_INCLUDED_SRC_ as header guard prefix with 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.6 KB
Line 
1/* $Id: PciInline.h 76565 2019-01-01 04:23:20Z vboxsync $ */
2/** @file
3 * PCI - The PCI Controller And Devices, inline device helpers.
4 */
5
6/*
7 * Copyright (C) 2006-2019 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#ifndef VBOX_INCLUDED_SRC_Bus_PciInline_h
19#define VBOX_INCLUDED_SRC_Bus_PciInline_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24DECLINLINE(void) pciDevSetPci2PciBridge(PPDMPCIDEV pDev)
25{
26 pDev->Int.s.fFlags |= PCIDEV_FLAG_PCI_TO_PCI_BRIDGE;
27}
28
29DECLINLINE(bool) pciDevIsPci2PciBridge(PPDMPCIDEV pDev)
30{
31 return (pDev->Int.s.fFlags & PCIDEV_FLAG_PCI_TO_PCI_BRIDGE) != 0;
32}
33
34DECLINLINE(void) pciDevSetPciExpress(PPDMPCIDEV pDev)
35{
36 pDev->Int.s.fFlags |= PCIDEV_FLAG_PCI_EXPRESS_DEVICE;
37}
38
39DECLINLINE(bool) pciDevIsPciExpress(PPDMPCIDEV pDev)
40{
41 return (pDev->Int.s.fFlags & PCIDEV_FLAG_PCI_EXPRESS_DEVICE) != 0;
42}
43
44DECLINLINE(void) pciDevSetMsiCapable(PPDMPCIDEV pDev)
45{
46 pDev->Int.s.fFlags |= PCIDEV_FLAG_MSI_CAPABLE;
47}
48
49DECLINLINE(void) pciDevClearMsiCapable(PPDMPCIDEV pDev)
50{
51 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_MSI_CAPABLE;
52}
53
54DECLINLINE(bool) pciDevIsMsiCapable(PPDMPCIDEV pDev)
55{
56 return (pDev->Int.s.fFlags & PCIDEV_FLAG_MSI_CAPABLE) != 0;
57}
58
59DECLINLINE(void) pciDevSetMsi64Capable(PPDMPCIDEV pDev)
60{
61 pDev->Int.s.fFlags |= PCIDEV_FLAG_MSI64_CAPABLE;
62}
63
64DECLINLINE(void) pciDevClearMsi64Capable(PPDMPCIDEV pDev)
65{
66 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_MSI64_CAPABLE;
67}
68
69DECLINLINE(bool) pciDevIsMsi64Capable(PPDMPCIDEV pDev)
70{
71 return (pDev->Int.s.fFlags & PCIDEV_FLAG_MSI64_CAPABLE) != 0;
72}
73
74DECLINLINE(void) pciDevSetMsixCapable(PPDMPCIDEV pDev)
75{
76 pDev->Int.s.fFlags |= PCIDEV_FLAG_MSIX_CAPABLE;
77}
78
79DECLINLINE(void) pciDevClearMsixCapable(PPDMPCIDEV pDev)
80{
81 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_MSIX_CAPABLE;
82}
83
84DECLINLINE(bool) pciDevIsMsixCapable(PPDMPCIDEV pDev)
85{
86 return (pDev->Int.s.fFlags & PCIDEV_FLAG_MSIX_CAPABLE) != 0;
87}
88
89DECLINLINE(void) pciDevSetPassthrough(PPDMPCIDEV pDev)
90{
91 pDev->Int.s.fFlags |= PCIDEV_FLAG_PASSTHROUGH;
92}
93
94DECLINLINE(void) pciDevClearPassthrough(PPDMPCIDEV pDev)
95{
96 pDev->Int.s.fFlags &= ~PCIDEV_FLAG_PASSTHROUGH;
97}
98
99DECLINLINE(bool) pciDevIsPassthrough(PPDMPCIDEV pDev)
100{
101 return (pDev->Int.s.fFlags & PCIDEV_FLAG_PASSTHROUGH) != 0;
102}
103
104#endif /* !VBOX_INCLUDED_SRC_Bus_PciInline_h */
105
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