VirtualBox

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

Last change on this file since 40532 was 36107, checked in by vboxsync, 14 years ago

PCI: some Main work to provide correct attachment info for physical devices

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/* $Id: BusAssignmentManager.h 36107 2011-02-28 18:24:32Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox bus slots assignment manager
6 */
7
8/*
9 * Copyright (C) 2010 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19#ifndef __BusAssignmentManager_h
20#define __BusAssignmentManager_h
21
22#include "VBox/types.h"
23#include "VBox/pci.h"
24#include "VirtualBoxBase.h"
25
26class BusAssignmentManager
27{
28private:
29 struct State;
30 State* pState;
31
32 BusAssignmentManager();
33 virtual ~BusAssignmentManager();
34
35 HRESULT assignPciDeviceImpl(const char* pszDevName, PCFGMNODE pCfg, PciBusAddress& GuestAddress, PciBusAddress HostAddress, bool fGuestAddressRequired = false);
36
37public:
38 static BusAssignmentManager* createInstance(ChipsetType_T chipsetType);
39 virtual void AddRef();
40 virtual void Release();
41
42 virtual HRESULT assignHostPciDevice(const char* pszDevName, PCFGMNODE pCfg, PciBusAddress HostAddress, PciBusAddress& GuestAddress, bool fAddressRequired = false)
43 {
44 return assignPciDeviceImpl(pszDevName, pCfg, GuestAddress, HostAddress, fAddressRequired);
45 }
46
47 virtual HRESULT assignPciDevice(const char* pszDevName, PCFGMNODE pCfg, PciBusAddress& Address, bool fAddressRequired = false)
48 {
49 PciBusAddress HostAddress;
50 return assignPciDeviceImpl(pszDevName, pCfg, Address, HostAddress, fAddressRequired);
51 }
52
53 virtual HRESULT assignPciDevice(const char* pszDevName, PCFGMNODE pCfg)
54 {
55 PciBusAddress GuestAddress;
56 PciBusAddress HostAddress;
57 return assignPciDeviceImpl(pszDevName, pCfg, GuestAddress, HostAddress, false);
58 }
59 virtual bool findPciAddress(const char* pszDevName, int iInstance, PciBusAddress& Address);
60 virtual bool hasPciDevice(const char* pszDevName, int iInstance)
61 {
62 PciBusAddress Address;
63 return findPciAddress(pszDevName, iInstance, Address);
64 }
65 virtual void listAttachedPciDevices(ComSafeArrayOut(IPciDeviceAttachment*, aAttached));
66};
67
68#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