VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMR0/IOMR0.cpp@ 93705

Last change on this file since 93705 was 93650, checked in by vboxsync, 3 years ago

VMM/PGM,*: Split the physical access handler type registration into separate ring-0 and ring-3 steps, expanding the type to 64-bit. bugref:10094

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/* $Id: IOMR0.cpp 93650 2022-02-08 10:43:53Z vboxsync $ */
2/** @file
3 * IOM - Host Context Ring 0.
4 */
5
6/*
7 * Copyright (C) 2006-2022 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*********************************************************************************************************************************
20* Header Files *
21*********************************************************************************************************************************/
22#define LOG_GROUP LOG_GROUP_IOM
23#include <VBox/vmm/iom.h>
24#include <VBox/vmm/pgm.h>
25#include "IOMInternal.h"
26#include <VBox/vmm/vmcc.h>
27#include <VBox/log.h>
28#include <iprt/assert.h>
29#include <iprt/assertcompile.h>
30#include <iprt/errcore.h>
31
32
33
34/**
35 * Initializes the per-VM data for the IOM.
36 *
37 * This is called from under the GVMM lock, so it should only initialize the
38 * data so IOMR0CleanupVM and others will work smoothly.
39 *
40 * @param pGVM Pointer to the global VM structure.
41 */
42VMMR0_INT_DECL(void) IOMR0InitPerVMData(PGVM pGVM)
43{
44 AssertCompile(sizeof(pGVM->iom.s) <= sizeof(pGVM->iom.padding));
45 AssertCompile(sizeof(pGVM->iomr0.s) <= sizeof(pGVM->iomr0.padding));
46
47 iomR0IoPortInitPerVMData(pGVM);
48 iomR0MmioInitPerVMData(pGVM);
49}
50
51
52/**
53 * Called during ring-0 init (vmmR0InitVM).
54 *
55 * @returns VBox status code.
56 * @param pGVM Pointer to the global VM structure.
57 */
58VMMR0_INT_DECL(int) IOMR0InitVM(PGVM pGVM)
59{
60 int rc = PGMR0HandlerPhysicalTypeSetUpContext(pGVM, PGMPHYSHANDLERKIND_MMIO, 0 /*fFlags*/,
61 iomMmioHandlerNew, iomMmioPfHandlerNew,
62 "MMIO", pGVM->iom.s.hNewMmioHandlerType);
63 AssertRCReturn(rc, rc);
64 return VINF_SUCCESS;
65}
66
67
68/**
69 * Cleans up any loose ends before the GVM structure is destroyed.
70 */
71VMMR0_INT_DECL(void) IOMR0CleanupVM(PGVM pGVM)
72{
73 iomR0IoPortCleanupVM(pGVM);
74 iomR0MmioCleanupVM(pGVM);
75}
76
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