Changeset 107894 in vbox for trunk/include/VBox
- Timestamp:
- Jan 22, 2025 3:56:33 PM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 167115
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/vm.h
r107893 r107894 1165 1165 1166 1166 /** @def VM_IS_VALID_EXT 1167 * Asserts a the VM handle is valid for external access, i.e. not being destroy 1168 * or terminated. */ 1169 #define VM_IS_VALID_EXT(pVM) \ 1170 ( RT_VALID_ALIGNED_PTR(pVM, PAGE_SIZE) \ 1171 && ( (unsigned)(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING \ 1172 || ( (unsigned)(pVM)->enmVMState == (unsigned)VMSTATE_DESTROYING \ 1173 && VM_IS_EMT(pVM))) ) 1167 * Check that a VM handle is valid for external access, i.e. not being destroy 1168 * or terminated and matching the target platform architecture (ring-3). */ 1169 #ifdef VMTARGET_DEFAULT 1170 # define VM_IS_VALID_EXT(pVM) \ 1171 ( RT_VALID_ALIGNED_PTR(pVM, PAGE_SIZE) \ 1172 && ( (unsigned)(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING \ 1173 || ( (unsigned)(pVM)->enmVMState == (unsigned)VMSTATE_DESTROYING \ 1174 && VM_IS_EMT(pVM))) \ 1175 && (pVM)->enmTarget != VMTARGET_DEFAULT) 1176 #else 1177 # define VM_IS_VALID_EXT(pVM) \ 1178 ( RT_VALID_ALIGNED_PTR(pVM, PAGE_SIZE) \ 1179 && ( (unsigned)(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING \ 1180 || ( (unsigned)(pVM)->enmVMState == (unsigned)VMSTATE_DESTROYING \ 1181 && VM_IS_EMT(pVM))) ) 1182 #endif 1174 1183 1175 1184 /** @def VM_ASSERT_VALID_EXT_RETURN 1176 * Asserts a the VM handle is valid for external access, i.e. not being1177 * destroyor terminated.1185 * Asserts that a VM handle is valid for external access, i.e. not being destroy 1186 * or terminated. 1178 1187 */ 1179 1188 #define VM_ASSERT_VALID_EXT_RETURN(pVM, rc) \ 1180 1189 AssertMsgReturn(VM_IS_VALID_EXT(pVM), \ 1181 ("pVM=%p state %s \n", (pVM), RT_VALID_ALIGNED_PTR(pVM, PAGE_SIZE) \1182 ? VMGetStateName(pVM->enmVMState) : "" ), \1190 ("pVM=%p state %s enmTarget=%#x\n", (pVM), RT_VALID_ALIGNED_PTR(pVM, PAGE_SIZE) \ 1191 ? VMGetStateName(pVM->enmVMState) : "", (pVM)->enmTarget), \ 1183 1192 (rc)) 1184 1193 1194 /** @def VMCPU_IS_VALID_EXT 1195 * Checks that a VMCPU handle is valid for external access, i.e. not being 1196 * destroy or terminated and matching the target platform architecture (r3). */ 1197 #ifdef VMTARGET_DEFAULT 1198 # define VMCPU_IS_VALID_EXT(a_pVCpu) \ 1199 ( RT_VALID_ALIGNED_PTR(a_pVCpu, 64) \ 1200 && RT_VALID_ALIGNED_PTR((a_pVCpu)->CTX_SUFF(pVM), PAGE_SIZE) \ 1201 && (unsigned)(a_pVCpu)->CTX_SUFF(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING \ 1202 && (pVM)->enmTarget != VMTARGET_DEFAULT) 1203 #else 1204 # define VMCPU_IS_VALID_EXT(a_pVCpu) \ 1205 ( RT_VALID_ALIGNED_PTR(a_pVCpu, 64) \ 1206 && RT_VALID_ALIGNED_PTR((a_pVCpu)->CTX_SUFF(pVM), PAGE_SIZE) \ 1207 && (unsigned)(a_pVCpu)->CTX_SUFF(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING) 1208 #endif 1209 1185 1210 /** @def VMCPU_ASSERT_VALID_EXT_RETURN 1186 * Asserts a theVMCPU handle is valid for external access, i.e. not being1187 * destroy or terminated .1211 * Asserts that a VMCPU handle is valid for external access, i.e. not being 1212 * destroy or terminated and matching the target platform architecutre (r3). 1188 1213 */ 1189 1214 #define VMCPU_ASSERT_VALID_EXT_RETURN(pVCpu, rc) \ 1190 AssertMsgReturn( RT_VALID_ALIGNED_PTR(pVCpu, 64) \ 1191 && RT_VALID_ALIGNED_PTR((pVCpu)->CTX_SUFF(pVM), PAGE_SIZE) \ 1192 && (unsigned)(pVCpu)->CTX_SUFF(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING, \ 1193 ("pVCpu=%p pVM=%p state %s\n", (pVCpu), RT_VALID_ALIGNED_PTR(pVCpu, 64) ? (pVCpu)->CTX_SUFF(pVM) : NULL, \ 1215 AssertMsgReturn(VMCPU_IS_VALID_EXT(pVCpu), \ 1216 ("pVCpu=%p pVM=%p state %s enmTarget=%#x\n", (pVCpu), \ 1217 RT_VALID_ALIGNED_PTR(pVCpu, 64) ? (pVCpu)->CTX_SUFF(pVM) : NULL, \ 1194 1218 RT_VALID_ALIGNED_PTR(pVCpu, 64) && RT_VALID_ALIGNED_PTR((pVCpu)->CTX_SUFF(pVM), PAGE_SIZE) \ 1195 ? VMGetStateName((pVCpu)->pVMR3->enmVMState) : "" ), \1219 ? VMGetStateName((pVCpu)->pVMR3->enmVMState) : "", (pVCpu)->enmTarget), \ 1196 1220 (rc)) 1197 1221
Note:
See TracChangeset
for help on using the changeset viewer.