VirtualBox

source: vbox/trunk/src/VBox/Main/include/ResourceAssignmentManager.h

Last change on this file was 102517, checked in by vboxsync, 5 months ago

Main/ConsoleImplConfigArmV8.cpp: Get rid of most hardcoded addresses and introduce a (very barebones right now) resource manager for managing the address map and interrupt assignments, most of the MMIO regions are now moved to the top of the address space. Only exception is the flash device holding the firmware and the MMIO region for PCI MEM32 BARs, bugref:10528

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: ResourceAssignmentManager.h 102517 2023-12-07 10:28:20Z vboxsync $ */
2/** @file
3 * VirtualBox resource assignment (Address ranges, interrupts) manager.
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_ResourceAssignmentManager_h
29#define MAIN_INCLUDED_ResourceAssignmentManager_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include "VBox/types.h"
35#include "VirtualBoxBase.h"
36#include <vector>
37
38class ResourceAssignmentManager
39{
40private:
41 struct State;
42 State *pState;
43
44 ResourceAssignmentManager();
45
46public:
47 static ResourceAssignmentManager *createInstance(PCVMMR3VTABLE pVMM, ChipsetType_T chipsetType, IommuType_T iommuType,
48 RTGCPHYS GCPhysMmioTop, RTGCPHYS GCPhysRamStart,
49 RTGCPHYS GCPhysMmio32Start, RTGCPHYS cbMmio32,
50 uint32_t cInterrupts);
51
52 ~ResourceAssignmentManager();
53
54 HRESULT assignMmioRegion(const char *pszName, RTGCPHYS cbRegion, PRTGCPHYS pGCPhysStart, PRTGCPHYS pcbRegion);
55 HRESULT assignMmio32Region(const char *pszName, RTGCPHYS cbRegion, PRTGCPHYS pGCPhysStart, PRTGCPHYS pcbRegion);
56 HRESULT assignMmioRegionAligned(const char *pszName, RTGCPHYS cbRegion, RTGCPHYS cbAlignment, PRTGCPHYS pGCPhysStart, PRTGCPHYS pcbRegion);
57 HRESULT assignFixedAddress(const char *pszName, RTGCPHYS GCPhysStart, RTGCPHYS cbRegion);
58 HRESULT assignRamRegion(const char *pszName, RTGCPHYS cbRam, PRTGCPHYS pGCPhysStart);
59 HRESULT assignInterrupts(const char *pszName, uint32_t cInterrupts, uint32_t *piInterruptFirst);
60 HRESULT assignSingleInterrupt(const char *pszName, uint32_t *piInterrupt);
61 HRESULT queryMmioRegion(PRTGCPHYS pGCPhysMmioStart, PRTGCPHYS pcbMmio);
62 HRESULT queryMmio32Region(PRTGCPHYS pGCPhysMmioStart, PRTGCPHYS pcbMmio);
63};
64
65#endif /* !MAIN_INCLUDED_ResourceAssignmentManager_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use