VirtualBox

source: vbox/trunk/src/VBox/Main/include/PlatformPropertiesImpl.h@ 101041

Last change on this file since 101041 was 101035, checked in by vboxsync, 15 months ago

Initial commit (based draft v2 / on patch v5) for implementing platform architecture support for x86 and ARM. bugref:10384

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.2 KB
Line 
1/* $Id: PlatformPropertiesImpl.h 101035 2023-09-07 08:59:15Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation - Platform properties.
4 */
5
6/*
7 * Copyright (C) 2023 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 MAIN_INCLUDED_PlatformProperties_h
29#define MAIN_INCLUDED_PlatformProperties_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include "PlatformPropertiesWrap.h"
35
36namespace settings
37{
38 struct PlatformProperties;
39}
40
41class ATL_NO_VTABLE PlatformProperties :
42 public PlatformPropertiesWrap
43{
44public:
45
46 DECLARE_COMMON_CLASS_METHODS(PlatformProperties)
47
48 HRESULT FinalConstruct();
49 void FinalRelease();
50
51 // public initializer/uninitializer for internal purposes only
52 HRESULT init(VirtualBox *aParent, bool fIsHost = false);
53 void uninit();
54
55 // public internal methods
56 //HRESULT i_loadSettings(const settings::PlatformProperties &data);
57 //HRESULT i_saveSettings(settings::PlatformProperties &data);
58 //void i_rollback();
59 //void i_commit();
60 //void i_copyFrom(PlatformProperties *aThat);
61 HRESULT i_setArchitecture(PlatformArchitecture_T aArchitecture);
62
63 // public static helper functions
64 static PlatformArchitecture_T s_getHostPlatformArchitecture(void);
65
66 // public static methods, for stuff which does not have a state
67 static ULONG s_getMaxNetworkAdapters(ChipsetType_T aChipset);
68 static ULONG s_getMaxNetworkAdaptersOfType(ChipsetType_T aChipset, NetworkAttachmentType_T aType);
69
70private:
71
72 // wrapped IPlatformProperties properties
73 HRESULT getSerialPortCount(ULONG *aSerialPortCount) RT_OVERRIDE;
74 HRESULT getParallelPortCount(ULONG *aParallelPortCount) RT_OVERRIDE;
75 HRESULT getMaxBootPosition(ULONG *aMaxBootPosition) RT_OVERRIDE;
76 HRESULT getRawModeSupported(BOOL *aRawModeSupported) RT_OVERRIDE;
77 HRESULT getExclusiveHwVirt(BOOL *aExclusiveHwVirt) RT_OVERRIDE;
78 HRESULT setExclusiveHwVirt(BOOL aExclusiveHwVirt) RT_OVERRIDE;
79 HRESULT getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders) RT_OVERRIDE;
80 HRESULT getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes) RT_OVERRIDE;
81 HRESULT getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE;
82 HRESULT getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes) RT_OVERRIDE;
83 HRESULT getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes) RT_OVERRIDE;
84 HRESULT getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes) RT_OVERRIDE;
85 HRESULT getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes) RT_OVERRIDE;
86 HRESULT getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses) RT_OVERRIDE;
87 HRESULT getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes) RT_OVERRIDE;
88 HRESULT getSupportedChipsetTypes(std::vector<ChipsetType_T> &aSupportedChipsetTypes) RT_OVERRIDE;
89 HRESULT getSupportedIommuTypes(std::vector<IommuType_T> &aSupportedIommuTypes) RT_OVERRIDE;
90 HRESULT getSupportedTpmTypes(std::vector<TpmType_T> &aSupportedTpmTypes) RT_OVERRIDE;
91
92 // wrapped IPlatformProperties methods
93 HRESULT getMaxNetworkAdapters(ChipsetType_T aChipset,
94 ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
95 HRESULT getMaxNetworkAdaptersOfType(ChipsetType_T aChipset,
96 NetworkAttachmentType_T aType,
97 ULONG *aMaxNetworkAdapters) RT_OVERRIDE;
98 HRESULT getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
99 ULONG *aMaxDevicesPerPort) RT_OVERRIDE;
100 HRESULT getMinPortCountForStorageBus(StorageBus_T aBus,
101 ULONG *aMinPortCount) RT_OVERRIDE;
102 HRESULT getMaxPortCountForStorageBus(StorageBus_T aBus,
103 ULONG *aMaxPortCount) RT_OVERRIDE;
104 HRESULT getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
105 StorageBus_T aBus,
106 ULONG *aMaxInstances) RT_OVERRIDE;
107 HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus,
108 std::vector<DeviceType_T> &aDeviceTypes) RT_OVERRIDE;
109 HRESULT getStorageBusForStorageControllerType(StorageControllerType_T aStorageControllerType,
110 StorageBus_T *aStorageBus) RT_OVERRIDE;
111 HRESULT getStorageControllerTypesForStorageBus(StorageBus_T aStorageBus,
112 std::vector<StorageControllerType_T> &aStorageControllerTypes) RT_OVERRIDE;
113 HRESULT getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,
114 BOOL *aHotplugCapable) RT_OVERRIDE;
115 HRESULT getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
116 USBControllerType_T aType,
117 ULONG *aMaxInstances) RT_OVERRIDE;
118
119 VirtualBox * const mParent;
120 /** Platform architecture the properties are for. */
121 PlatformArchitecture_T mPlatformArchitecture;
122 /** Flag set to \c true if this instance handles platform properties
123 * for the host, or set to \c false for guests. */
124 bool const mfIsHost;
125
126 // Data
127
128 settings::PlatformProperties *m;
129};
130
131#endif /* !MAIN_INCLUDED_PlatformProperties_h */
132
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