1 | /** @file
|
---|
2 | * GCM - Guest Compatibility Manager.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2022 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef VBOX_INCLUDED_vmm_gcm_h
|
---|
27 | #define VBOX_INCLUDED_vmm_gcm_h
|
---|
28 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
29 | # pragma once
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include <VBox/cdefs.h>
|
---|
33 | #include <VBox/types.h>
|
---|
34 | #include <VBox/param.h>
|
---|
35 |
|
---|
36 | #include <VBox/vmm/cpum.h>
|
---|
37 | #include <VBox/vmm/pdmifs.h>
|
---|
38 |
|
---|
39 | RT_C_DECLS_BEGIN
|
---|
40 |
|
---|
41 | /** @defgroup grp_gcm The Guest Compatibility Manager API
|
---|
42 | * @ingroup grp_vmm
|
---|
43 | * @{
|
---|
44 | */
|
---|
45 |
|
---|
46 | /**
|
---|
47 | * GCM Fixer Identifiers.
|
---|
48 | * @remarks Part of saved state!
|
---|
49 | */
|
---|
50 | typedef enum GCMFIXERID
|
---|
51 | {
|
---|
52 | /** None. */
|
---|
53 | GCMFIXER_NONE = 0,
|
---|
54 | /** DOS division by zero, the worst. Includes Windows 3.x. */
|
---|
55 | GCMFIXER_DBZ_DOS = RT_BIT(0),
|
---|
56 | /** OS/2 (any version) division by zero. */
|
---|
57 | GCMFIXER_DBZ_OS2 = RT_BIT(1),
|
---|
58 | /** Windows 9x division by zero. */
|
---|
59 | GCMFIXER_DBZ_WIN9X = RT_BIT(2),
|
---|
60 | /** 32-bit hack. */
|
---|
61 | GCMFIXER_32BIT_HACK = 0x7fffffff
|
---|
62 | } GCMFIXERID;
|
---|
63 | AssertCompileSize(GCMFIXERID, sizeof(uint32_t));
|
---|
64 |
|
---|
65 |
|
---|
66 | #ifdef IN_RING3
|
---|
67 | /** @defgroup grp_gcm_r3 The GCM Host Context Ring-3 API
|
---|
68 | * @{
|
---|
69 | */
|
---|
70 | VMMR3_INT_DECL(int) GCMR3Init(PVM pVM);
|
---|
71 | VMMR3_INT_DECL(void) GCMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
|
---|
72 | VMMR3_INT_DECL(int) GCMR3Term(PVM pVM);
|
---|
73 | VMMR3_INT_DECL(void) GCMR3Reset(PVM pVM);
|
---|
74 | /** @} */
|
---|
75 | #endif /* IN_RING3 */
|
---|
76 |
|
---|
77 | VMMDECL(bool) GCMIsEnabled(PVM pVM);
|
---|
78 | VMM_INT_DECL(bool) GCMShouldTrapXcptDE(PVMCPUCC pVCpu);
|
---|
79 | VMM_INT_DECL(VBOXSTRICTRC) GCMXcptDE(PVMCPUCC pVCpu, PCPUMCTX pCtx, PDISCPUSTATE pDis, uint8_t *pcbInstr);
|
---|
80 | /** @} */
|
---|
81 |
|
---|
82 | RT_C_DECLS_END
|
---|
83 |
|
---|
84 | #endif /* !VBOX_INCLUDED_vmm_gcm_h */
|
---|
85 |
|
---|