Changeset 4692 in vbox
- Timestamp:
- Sep 11, 2007 9:53:55 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 24353
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pgm.h
r4689 r4692 784 784 785 785 /** 786 * Page mapping lock. 787 * 788 * @remarks This doesn't work in structures shared between 789 * ring-3, ring-0 and/or GC. 790 */ 791 typedef struct PGMPAGEMAPLOCK 792 { 793 #ifdef IN_GC 794 /** Just a dummy for the time being. */ 795 uint32_t u32Dummy; 796 #else 797 /** Just a dummy for the time being. */ 798 uint32_t u32Dummy; 799 #endif 800 } PGMPAGEMAPLOCK; 801 /** Pointer to a page mapping lock. */ 802 typedef PGMPAGEMAPLOCK *PPGMPAGEMAPLOCK; 803 804 /** 786 805 * Requests the mapping of a guest page into the current context. 787 * 806 * 788 807 * This API should only be used for very short term, as it will consume 789 * scarse resources (R0 and GC) in the mapping cache. When you're done 790 * with the page, call PGMPhys GCPhys2CCPtrRelease() ASAP to release it.791 * 808 * scarse resources (R0 and GC) in the mapping cache. When you're done 809 * with the page, call PGMPhysReleasePageMappingLock() ASAP to release it. 810 * 792 811 * @returns VBox status code. 793 812 * @retval VINF_SUCCESS on success. 794 813 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical backing. 795 814 * @retval VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS if it's not a valid physical address. 796 * 815 * 797 816 * @param pVM The VM handle. 798 817 * @param GCPhys The guest physical address of the page that should be mapped. 799 818 * @param ppv Where to store the address corresponding to GCPhys. 800 * 801 * @remark Avoid calling this API from within critical sections (other than 819 * @param pLock Where to store the lock information that PGMPhysReleasePageMappingLock needs. 820 * 821 * @remark Avoid calling this API from within critical sections (other than 802 822 * the PGM one) because of the deadlock risk. 803 823 */ 804 PGMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv );805 806 /** 824 PGMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock); 825 826 /** 807 827 * Release the mapping of a guest page. 808 828 * 809 * This is the counter part to thePGMPhysGCPhys2CCPtr.810 * 829 * This is the counter part of PGMPhysGCPhys2CCPtr. 830 * 811 831 * @param pVM The VM handle. 812 * @param GCPhys The address that was mapped using PGMPhysGCPhys2CCPtr. 813 * @param pv The address that PGMPhysGCPhys2CCPtr returned. 814 */ 815 PGMDECL(void) PGMPhysGCPhys2CCPtrRelease(PVM pVM, RTGCPHYS GCPhys, void *pv); 832 * @param pLock The lock structure initialized by the mapping function. 833 */ 834 PGMDECL(void) PGMPhysReleasePageMappingLock(PVM pVM, PPGMPAGEMAPLOCK pLock); 816 835 817 836 /** -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r4689 r4692 378 378 * This API should only be used for very short term, as it will consume 379 379 * scarse resources (R0 and GC) in the mapping cache. When you're done 380 * with the page, call PGMPhys GCPhys2CCPtrRelease() ASAP to release it.380 * with the page, call PGMPhysReleasePageMappingLock() ASAP to release it. 381 381 * 382 382 * @returns VBox status code. … … 388 388 * @param GCPhys The guest physical address of the page that should be mapped. 389 389 * @param ppv Where to store the address corresponding to GCPhys. 390 * @param pLock Where to store the lock information that PGMPhysReleasePageMappingLock needs. 390 391 * 391 392 * @remark Avoid calling this API from within critical sections (other than 392 393 * the PGM one) because of the deadlock risk. 393 394 */ 394 PGMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv )395 PGMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock) 395 396 { 396 397 # ifdef NEW_PHYS_CODE … … 455 456 /** 456 457 * Release the mapping of a guest page. 457 * 458 * This is the counter part to thePGMPhysGCPhys2CCPtr.458 * 459 * This is the counter part of PGMPhysGCPhys2CCPtr. 459 460 * 460 461 * @param pVM The VM handle. 461 * @param GCPhys The address that was mapped using PGMPhysGCPhys2CCPtr. 462 * @param pv The address that PGMPhysGCPhys2CCPtr returned. 463 */ 464 PGMDECL(void) PGMPhysGCPhys2CCPtrRelease(PVM pVM, RTGCPHYS GCPhys, void *pv) 462 * @param pLock The lock structure initialized by the mapping function. 463 */ 464 PGMDECL(void) PGMPhysReleasePageMappingLock(PVM pVM, PPGMPAGEMAPLOCK pLock) 465 465 { 466 466 #ifdef NEW_PHYS_CODE … … 536 536 #else 537 537 NOREF(pVM); 538 NOREF(GCPhys); 539 NOREF(pv); 538 NOREF(pLock); 540 539 #endif 541 540 } -
trunk/src/VBox/VMM/VMMAll/TRPMAll.cpp
r4680 r4692 592 592 goto failure; 593 593 594 /** @todo add PGMPhysGCPtr2CCPtr */ 595 PGMPAGEMAPLOCK PageMappingLock; 594 596 RTGCPHYS GCPhysStack; 595 597 rc = PGMPhysGCPtr2GCPhys(pVM, pTrapStackGC, &GCPhysStack); 596 598 if (VBOX_SUCCESS(rc)) 597 rc = PGMPhysGCPhys2CCPtr(pVM, GCPhysStack, (void **)&pTrapStack );599 rc = PGMPhysGCPhys2CCPtr(pVM, GCPhysStack, (void **)&pTrapStack, &PageMappingLock); 598 600 if (VBOX_FAILURE(rc)) 599 601 { … … 710 712 pRegFrame->ss = ss_r0 & ~X86_SEL_RPL; /* set rpl to ring 0 */ 711 713 STAM_PROFILE_ADV_STOP(CTXSUFF(&pVM->trpm.s.StatForwardProf), a); 712 PGMPhys GCPhys2CCPtrRelease(pVM, GCPhysStack, pTrapStack);714 PGMPhysReleasePageMappingLock(pVM, &PageMappingLock); 713 715 return VINF_SUCCESS; 714 716 #endif
Note:
See TracChangeset
for help on using the changeset viewer.