VirtualBox

source: vbox/trunk/src/VBox/Main/include/PlatformImpl.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: 3.2 KB
Line 
1/* $Id: PlatformImpl.h 101035 2023-09-07 08:59:15Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation - Platform settings.
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_Platform_h
29#define MAIN_INCLUDED_Platform_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include "PlatformWrap.h"
35#include "PlatformBase.h"
36
37class GuestOSType;
38class PlatformARM;
39class PlatformX86;
40
41namespace settings
42{
43 struct Platform;
44}
45
46class ATL_NO_VTABLE Platform :
47 public PlatformWrap
48{
49public:
50
51 DECLARE_COMMON_CLASS_METHODS(Platform)
52
53 HRESULT FinalConstruct();
54 void FinalRelease();
55
56 // public initializer/uninitializer for internal purposes only
57 HRESULT init(Machine *aParent);
58 HRESULT init(Machine *parent, Platform *that);
59 HRESULT initCopy(Machine *parent, Platform *that);
60 void uninit();
61
62 // public internal methods
63 HRESULT i_loadSettings(const settings::Platform &data);
64 HRESULT i_saveSettings(settings::Platform &data);
65
66 void i_rollback();
67 void i_commit();
68 void i_copyFrom(Platform *aThat);
69
70 HRESULT i_initArchitecture(PlatformArchitecture_T aArchitecture, Platform *that = NULL, bool fCopy = false);
71 HRESULT i_applyDefaults(GuestOSType *aOsType);
72
73 // wrapped IPlatform properties
74 HRESULT getArchitecture(PlatformArchitecture_T *aArchitecture);
75 HRESULT setArchitecture(PlatformArchitecture_T aArchitecture);
76 HRESULT getProperties(ComPtr<IPlatformProperties> &aProperties);
77 HRESULT getX86(ComPtr<IPlatformX86> &aX86);
78 HRESULT getARM(ComPtr<IPlatformARM> &aARM);
79 HRESULT getChipsetType(ChipsetType_T *aChipsetType);
80 HRESULT setChipsetType(ChipsetType_T aChipsetType);
81 HRESULT getIommuType(IommuType_T *aIommuType);
82 HRESULT setIommuType(IommuType_T aIommuType);
83 HRESULT getRTCUseUTC(BOOL *aRTCUseUTC);
84 HRESULT setRTCUseUTC(BOOL aRTCUseUTC);
85
86private:
87
88 // private functions only used internally
89 void uninitArchitecture();
90
91private:
92
93 // wrapped IPlatform methods
94
95 Machine * const mParent;
96
97 struct Data;
98 Data *m;
99
100 // The following fields need special backup/rollback/commit handling,
101 // so they cannot be a part of Data above.
102
103 /** Contains x86-specific platform data.
104 * Only created if platform architecture is x86. */
105 const ComObjPtr<PlatformX86> mX86;
106#ifdef VBOX_WITH_VIRT_ARMV8
107 /** Contains ARM-specific platform data.
108 * Only created if platform architecture is ARM. */
109 const ComObjPtr<PlatformARM> mARM;
110#endif
111};
112
113#endif /* !MAIN_INCLUDED_Platform_h */
114
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