1 | /* $Id: PGMGst.h 73261 2018-07-20 11:00:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox - Page Manager / Monitor, Guest Paging Template.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2018 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 | * Internal Functions *
|
---|
21 | *********************************************************************************************************************************/
|
---|
22 | RT_C_DECLS_BEGIN
|
---|
23 | /* all */
|
---|
24 | PGM_GST_DECL(int, Enter)(PVMCPU pVCpu, RTGCPHYS GCPhysCR3);
|
---|
25 | PGM_GST_DECL(int, Exit)(PVMCPU pVCpu);
|
---|
26 | PGM_GST_DECL(int, GetPage)(PVMCPU pVCpu, RTGCPTR GCPtr, uint64_t *pfFlags, PRTGCPHYS pGCPhys);
|
---|
27 | PGM_GST_DECL(int, ModifyPage)(PVMCPU pVCpu, RTGCPTR GCPtr, size_t cb, uint64_t fFlags, uint64_t fMask);
|
---|
28 | PGM_GST_DECL(int, GetPDE)(PVMCPU pVCpu, RTGCPTR GCPtr, PX86PDEPAE pPDE);
|
---|
29 |
|
---|
30 | /* r3 */
|
---|
31 | PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta);
|
---|
32 | RT_C_DECLS_END
|
---|
33 |
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * Relocate any GC pointers related to guest mode paging.
|
---|
37 | *
|
---|
38 | * @returns VBox status code.
|
---|
39 | * @param pVCpu The cross context virtual CPU structure.
|
---|
40 | * @param offDelta The relocation offset.
|
---|
41 | */
|
---|
42 | PGM_GST_DECL(int, Relocate)(PVMCPU pVCpu, RTGCPTR offDelta)
|
---|
43 | {
|
---|
44 | pVCpu->pgm.s.pGst32BitPdRC += offDelta;
|
---|
45 |
|
---|
46 | for (unsigned i = 0; i < RT_ELEMENTS(pVCpu->pgm.s.apGstPaePDsRC); i++)
|
---|
47 | {
|
---|
48 | pVCpu->pgm.s.apGstPaePDsRC[i] += offDelta;
|
---|
49 | }
|
---|
50 | pVCpu->pgm.s.pGstPaePdptRC += offDelta;
|
---|
51 |
|
---|
52 | return VINF_SUCCESS;
|
---|
53 | }
|
---|
54 |
|
---|