VirtualBox

source: vbox/trunk/src/VBox/VMM/VMMAll/MMAllPhys.cpp@ 4071

Last change on this file since 4071 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1/* $Id: MMAllPhys.cpp 4071 2007-08-07 17:07:59Z vboxsync $ */
2/** @file
3 * MM - Memory Monitor(/Manager) - Physical Memory.
4 */
5
6/*
7 * Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
13 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14 * distribution. VirtualBox OSE is distributed in the hope that it will
15 * be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18
19/*******************************************************************************
20* Header Files *
21*******************************************************************************/
22#define LOG_GROUP LOG_GROUP_MM_PHYS
23#include <VBox/mm.h>
24#include <VBox/pgm.h>
25#include <VBox/rem.h>
26#include "MMInternal.h"
27#include <VBox/vm.h>
28
29#include <iprt/alloc.h>
30#include <iprt/assert.h>
31#include <VBox/log.h>
32#include <VBox/param.h>
33#include <VBox/err.h>
34
35/**
36 * Convert GC physical address to HC virtual address.
37 *
38 * @returns HC virtual address.
39 * @param pVM VM Handle
40 * @param GCPhys Guest context physical address.
41 * @param cbRange Physical range
42 * @deprecated
43 */
44MMDECL(void *) MMPhysGCPhys2HCVirt(PVM pVM, RTGCPHYS GCPhys, RTUINT cbRange)
45{
46 void *pv;
47 int rc = PGMPhysGCPhys2HCPtr(pVM, GCPhys, cbRange, &pv);
48 if (VBOX_SUCCESS(rc))
49 return pv;
50 AssertMsgFailed(("Invalid address GCPhys=%x\n", GCPhys));
51 return NULL;
52}
53
54
55/**
56 * Convert GC virtual address to HC virtual address.
57 *
58 * This uses the current PD of the guest.
59 *
60 * @returns HC virtual address.
61 * @param pVM VM Handle
62 * @param GCPtr Guest context virtual address.
63 * @deprecated
64 */
65MMDECL(void *) MMPhysGCVirt2HCVirt(PVM pVM, RTGCPTR GCPtr)
66{
67 void *pv;
68 int rc = PGMPhysGCPtr2HCPtr(pVM, GCPtr, &pv);
69 if (VBOX_SUCCESS(rc))
70 return pv;
71 AssertMsgFailed(("%VGv, %Vrc\n", GCPtr, rc));
72 return NULL;
73}
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