- Timestamp:
- Apr 26, 2013 1:20:24 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/VMMSwitcher.cpp
r45746 r45750 917 917 918 918 /** 919 * Wrapper around SELMGetHyperGDT() that avoids calling it when raw-mode context 920 * is not initialized. 921 * 922 * @returns Raw-mode contet GDT address. Null pointer if not applicable. 923 * @param pVM The cross context VM structure. 924 */ 925 static RTRCPTR vmmR3SwitcherGetHyperGDT(PVM pVM) 926 { 927 if (HMIsRawModeCtxNeeded(pVM)) 928 return SELMGetHyperGDT(pVM); 929 #if HC_ARCH_BITS != 32 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) 930 AssertFailed(); /* This path is only applicable to some 32-bit hosts. */ 931 #endif 932 return NIL_RTRCPTR; 933 } 934 935 /** 919 936 * Relocator for the 32-Bit to 32-Bit world switcher. 920 937 */ … … 942 959 { 943 960 vmmR3SwitcherGenericRelocate(pVM, pSwitcher, R0PtrCode, pu8CodeR3, GCPtrCode, u32IDCode, 944 SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), SELMGetHyperGDT(pVM), SELMGetHyperCS64(pVM));961 SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), vmmR3SwitcherGetHyperGDT(pVM), SELMGetHyperCS64(pVM)); 945 962 } 946 963 … … 971 988 { 972 989 vmmR3SwitcherGenericRelocate(pVM, pSwitcher, R0PtrCode, pu8CodeR3, GCPtrCode, u32IDCode, 973 SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), SELMGetHyperGDT(pVM), SELMGetHyperCS64(pVM));990 SELMGetHyperCS(pVM), SELMGetHyperDS(pVM), SELMGetHyperTSS(pVM), vmmR3SwitcherGetHyperGDT(pVM), SELMGetHyperCS64(pVM)); 974 991 } 975 992 … … 1060 1077 * Validate input. 1061 1078 */ 1062 if ( enmSwitcher < VMMSWITCHER_INVALID 1063 || enmSwitcher >= VMMSWITCHER_MAX) 1064 { 1065 AssertMsgFailed(("Invalid input enmSwitcher=%d\n", enmSwitcher)); 1066 return NIL_RTR0PTR; 1067 } 1079 AssertMsgReturn( enmSwitcher == VMMSWITCHER_32_TO_AMD64 1080 || enmSwitcher == VMMSWITCHER_PAE_TO_AMD64, 1081 ("%d\n", enmSwitcher), 1082 NIL_RTR0PTR); 1083 AssertReturn(HMIsEnabled(pVM), NIL_RTR0PTR); 1068 1084 1069 1085 /* 1070 1086 * Select the new switcher. 1071 1087 */ 1072 const PVMMSWITCHERDEF *papSwitchers = HMIsEnabled(pVM) ? g_apHmSwitchers : g_apRawModeSwitchers;1088 const PVMMSWITCHERDEF *papSwitchers = g_apHmSwitchers; 1073 1089 PVMMSWITCHERDEF pSwitcher = papSwitchers[enmSwitcher]; 1074 1090 if (pSwitcher) 1075 1091 { 1076 RTR0PTR pbCodeR0 = (RTR0PTR)pVM->vmm.s.pvCoreCodeR0 + pVM->vmm.s.aoffSwitchers[enmSwitcher]; /** @todo fix the pvCoreCodeR0 type */ 1092 /** @todo fix the pvCoreCodeR0 type */ 1093 RTR0PTR pbCodeR0 = (RTR0PTR)pVM->vmm.s.pvCoreCodeR0 + pVM->vmm.s.aoffSwitchers[enmSwitcher]; 1077 1094 return pbCodeR0 + pSwitcher->offR0ToRawMode; 1078 1095 }
Note:
See TracChangeset
for help on using the changeset viewer.