VirtualBox

source: vbox/trunk/src/VBox/Main/include/BusAssignmentManager.h@ 76549

Last change on this file since 76549 was 76487, checked in by vboxsync, 6 years ago

Main/include: Slapped #pragma once on all headers in prep for GCC precompiled headers. Won't catch repeat includes of an already precompiled header otherwise, i.e. killing most of the PCH gain.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: BusAssignmentManager.h 76487 2018-12-27 03:31:39Z vboxsync $ */
2/** @file
3 * VirtualBox bus slots assignment manager
4 */
5
6/*
7 * Copyright (C) 2010-2017 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#ifndef ___H_BUSASSIGNMENTMANAGER
18#define ___H_BUSASSIGNMENTMANAGER
19#ifndef RT_WITHOUT_PRAGMA_ONCE
20# pragma once
21#endif
22
23#include "VBox/types.h"
24#include "VBox/pci.h"
25#include "VirtualBoxBase.h"
26#include <vector>
27
28class BusAssignmentManager
29{
30private:
31 struct State;
32 State *pState;
33
34 BusAssignmentManager();
35 virtual ~BusAssignmentManager();
36
37 HRESULT assignPCIDeviceImpl(const char *pszDevName, PCFGMNODE pCfg, PCIBusAddress& GuestAddress,
38 PCIBusAddress HostAddress, bool fGuestAddressRequired = false);
39
40public:
41 struct PCIDeviceInfo
42 {
43 com::Utf8Str strDeviceName;
44 PCIBusAddress guestAddress;
45 PCIBusAddress hostAddress;
46 };
47
48 static BusAssignmentManager *createInstance(ChipsetType_T chipsetType);
49 virtual void AddRef();
50 virtual void Release();
51
52 virtual HRESULT assignHostPCIDevice(const char *pszDevName, PCFGMNODE pCfg, PCIBusAddress HostAddress,
53 PCIBusAddress& GuestAddress, bool fAddressRequired = false)
54 {
55 return assignPCIDeviceImpl(pszDevName, pCfg, GuestAddress, HostAddress, fAddressRequired);
56 }
57
58 virtual HRESULT assignPCIDevice(const char *pszDevName, PCFGMNODE pCfg, PCIBusAddress& Address, bool fAddressRequired = false)
59 {
60 PCIBusAddress HostAddress;
61 return assignPCIDeviceImpl(pszDevName, pCfg, Address, HostAddress, fAddressRequired);
62 }
63
64 virtual HRESULT assignPCIDevice(const char *pszDevName, PCFGMNODE pCfg)
65 {
66 PCIBusAddress GuestAddress;
67 PCIBusAddress HostAddress;
68 return assignPCIDeviceImpl(pszDevName, pCfg, GuestAddress, HostAddress, false);
69 }
70 virtual bool findPCIAddress(const char *pszDevName, int iInstance, PCIBusAddress& Address);
71 virtual bool hasPCIDevice(const char *pszDevName, int iInstance)
72 {
73 PCIBusAddress Address;
74 return findPCIAddress(pszDevName, iInstance, Address);
75 }
76 virtual void listAttachedPCIDevices(std::vector<PCIDeviceInfo> &aAttached);
77};
78
79#endif // __BusAssignmentManager_h
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette