Changeset 19178 in vbox for trunk/include/VBox
- Timestamp:
- Apr 24, 2009 6:30:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vm.h
r19141 r19178 436 436 #endif 437 437 438 /** @def VMCPU_IS_EMT 439 * Checks if the current thread is the emulation thread (EMT) for the specified 440 * virtual CPU. 441 */ 442 #ifdef IN_RC 443 # define VMCPU_IS_EMT(pVCpu) true 444 #elif defined(IN_RING0) 445 # define VMCPU_IS_EMT(pVCpu) fixme - need to call HWACCM I think... /** @todo SMP */ 446 #else 447 /** @todo need to rework this macro for the case of multiple emulation threads for SMP */ 448 # define VMCPU_IS_EMT(pVCpu) ((pVCpu)->hNativeThread == RTThreadNativeSelf()) 449 #endif 450 438 451 /** @def VM_ASSERT_EMT 439 452 * Asserts that the current thread IS the emulation thread (EMT). … … 449 462 #endif 450 463 464 /** @def VMCPU_ASSERT_EMT 465 * Asserts that the current thread IS the emulation thread (EMT) of the 466 * specified virtual CPU. 467 */ 468 #ifdef IN_RC 469 # define VMCPU_ASSERT_EMT(pVCpu) Assert(VMCPU_IS_EMT(pVCpu)) 470 #elif defined(IN_RING0) 471 # define VMCPU_ASSERT_EMT(pVCpu) Assert(VMCPU_IS_EMT(pVCpu)) 472 #else 473 # define VMCPU_ASSERT_EMT(pVCpu) \ 474 AssertMsg(VMCPU_IS_EMT(pVCpu), \ 475 ("Not emulation thread! Thread=%RTnthrd ThreadEMT=%RTnthrd idCpu=%#x\n", \ 476 RTThreadNativeSelf(), (pVCpu)->hNativeThread, (pVCpu)->idCpu)) 477 #endif 478 451 479 /** @def VM_ASSERT_EMT_RETURN 452 480 * Asserts that the current thread IS the emulation thread (EMT) and returns if it isn't. … … 463 491 #endif 464 492 493 /** @def VMCPU_ASSERT_EMT_RETURN 494 * Asserts that the current thread IS the emulation thread (EMT) and returns if it isn't. 495 */ 496 #ifdef IN_RC 497 # define VMCPU_ASSERT_EMT_RETURN(pVCpu, rc) AssertReturn(VMCPU_IS_EMT(pVCpu), (rc)) 498 #elif defined(IN_RING0) 499 # define VMCPU_ASSERT_EMT_RETURN(pVCpu, rc) AssertReturn(VMCPU_IS_EMT(pVCpu), (rc)) 500 #else 501 # define VMCPU_ASSERT_EMT_RETURN(pVCpu, rc) \ 502 AssertMsg(VMCPU_IS_EMT(pVCpu), \ 503 ("Not emulation thread! Thread=%RTnthrd ThreadEMT=%RTnthrd idCpu=%#x\n", \ 504 RTThreadNativeSelf(), (pVCpu)->hNativeThread, (pVCpu)->idCpu), \ 505 (rc)) 506 #endif 507 465 508 466 509 /** … … 486 529 (rc)) 487 530 488 531 /** @def VM_ASSERT_VALID_EXT_RETURN 532 * Asserts a the VM handle is valid for external access, i.e. not being 533 * destroy or terminated. 534 */ 535 #define VM_ASSERT_VALID_EXT_RETURN(pVM, rc) \ 536 AssertMsgReturn( RT_VALID_ALIGNED_PTR(pVM, PAGE_SIZE) \ 537 && (unsigned)(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING, \ 538 ("pVM=%p state %s\n", (pVM), RT_VALID_ALIGNED_PTR(pVM, PAGE_SIZE) \ 539 ? VMGetStateName(pVM->enmVMState) : ""), \ 540 (rc)) 541 542 /** @def VMCPU_ASSERT_VALID_EXT_RETURN 543 * Asserts a the VMCPU handle is valid for external access, i.e. not being 544 * destroy or terminated. 545 */ 546 #define VMCPU_ASSERT_VALID_EXT_RETURN(pVCpu, rc) \ 547 AssertMsgReturn( RT_VALID_ALIGNED_PTR(pVCpu, 64) \ 548 && RT_VALID_ALIGNED_PTR((pVCpu)->CTX_SUFF(pVM), PAGE_SIZE) \ 549 && (unsigned)(pVCpu)->CTX_SUFF(pVM)->enmVMState < (unsigned)VMSTATE_DESTROYING, \ 550 ("pVCpu=%p pVM=%p state %s\n", (pVCpu), RT_VALID_ALIGNED_PTR(pVCpu, 64) ? (pVCpu)->CTX_SUFF(pVM) : NULL, \ 551 RT_VALID_ALIGNED_PTR(pVCpu, 64) && RT_VALID_ALIGNED_PTR((pVCpu)->CTX_SUFF(pVM), PAGE_SIZE) \ 552 ? VMGetStateName((pVCpu)->pVMR3->enmVMState) : ""), \ 553 (rc)) 489 554 490 555
Note:
See TracChangeset
for help on using the changeset viewer.