1 | /* $Id: BusAssignmentManager.h 42551 2012-08-02 16:44:39Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox bus slots assignment manager
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2010-2012 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 |
|
---|
26 | class BusAssignmentManager
|
---|
27 | {
|
---|
28 | private:
|
---|
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 |
|
---|
37 | public:
|
---|
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
|
---|