Changeset 14826 in vbox for trunk/src/VBox
- Timestamp:
- Nov 30, 2008 7:55:50 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PDMDevHlp.cpp
r13840 r14826 2578 2578 2579 2579 LogFlow(("pdmR3DevHlp_MMHyperMapMMIO2: caller='%s'/%d: returns %Rrc *pRCPtr=%RRv\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc, *pRCPtr)); 2580 return rc; 2581 } 2582 2583 2584 /** 2585 * @copydoc PDMDEVHLPR3::pfnMMIO2MapKernel 2586 */ 2587 static DECLCALLBACK(int) pdmR3DevHlp_MMIO2MapKernel(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, 2588 const char *pszDesc, PRTR0PTR pR0Ptr) 2589 { 2590 PDMDEV_ASSERT_DEVINS(pDevIns); 2591 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 2592 LogFlow(("pdmR3DevHlp_MMIO2MapKernel: caller='%s'/%d: iRegion=#x off=%RGp cb=%RGp pszDesc=%p:{%s} pR0Ptr=%p\n", 2593 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, iRegion, off, cb, pszDesc, pszDesc, pR0Ptr)); 2594 2595 int rc = PGMR3PhysMMIO2MapKernel(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, off, cb, pszDesc, pR0Ptr); 2596 2597 LogFlow(("pdmR3DevHlp_MMIO2MapKernel: caller='%s'/%d: returns %Rrc *pR0Ptr=%RHv\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc, *pR0Ptr)); 2580 2598 return rc; 2581 2599 } … … 2698 2716 pdmR3DevHlp_MMIO2Unmap, 2699 2717 pdmR3DevHlp_MMHyperMapMMIO2, 2718 pdmR3DevHlp_MMIO2MapKernel, 2700 2719 pdmR3DevHlp_RegisterVMMDevHeap, 2701 2720 pdmR3DevHlp_UnregisterVMMDevHeap, … … 3053 3072 /** @copydoc PDMDEVHLPR3::pfnMMHyperMapMMIO2 */ 3054 3073 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTRCPTR pRCPtr) 3074 { 3075 PDMDEV_ASSERT_DEVINS(pDevIns); 3076 AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance)); 3077 return VERR_ACCESS_DENIED; 3078 } 3079 3080 3081 /** @copydoc PDMDEVHLPR3::pfnMMIO2MapKernel */ 3082 static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMIO2MapKernel(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTR0PTR pR0Ptr) 3055 3083 { 3056 3084 PDMDEV_ASSERT_DEVINS(pDevIns); … … 3168 3196 pdmR3DevHlp_Untrusted_MMIO2Unmap, 3169 3197 pdmR3DevHlp_Untrusted_MMHyperMapMMIO2, 3198 pdmR3DevHlp_Untrusted_MMIO2MapKernel, 3170 3199 pdmR3DevHlp_Untrusted_RegisterVMMDevHeap, 3171 3200 pdmR3DevHlp_Untrusted_UnregisterVMMDevHeap, -
trunk/src/VBox/VMM/PGMPhys.cpp
r14592 r14826 1075 1075 1076 1076 /** 1077 * Maps a portion of an MMIO2 region into kernel space (host). 1078 * 1079 * The kernel mapping will become invalid when the MMIO2 memory is deregistered 1080 * or the VM is terminated. 1081 * 1082 * @return VBox status code. 1083 * 1084 * @param pVM Pointer to the shared VM structure. 1085 * @param pDevIns The device owning the MMIO2 memory. 1086 * @param iRegion The region. 1087 * @param off The offset into the region. Must be page aligned. 1088 * @param cb The number of bytes to map. Must be page aligned. 1089 * @param pszDesc Mapping description. 1090 * @param pR0Ptr Where to store the R0 address. 1091 */ 1092 VMMR3DECL(int) PGMR3PhysMMIO2MapKernel(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, 1093 const char *pszDesc, PRTR0PTR pR0Ptr) 1094 { 1095 /* 1096 * Validate input. 1097 */ 1098 VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT); 1099 AssertPtrReturn(pDevIns, VERR_INVALID_PARAMETER); 1100 AssertReturn(iRegion <= UINT8_MAX, VERR_INVALID_PARAMETER); 1101 1102 PPGMMMIO2RANGE pCur = pgmR3PhysMMIO2Find(pVM, pDevIns, iRegion); 1103 AssertReturn(pCur, VERR_NOT_FOUND); 1104 AssertReturn(off < pCur->RamRange.cb, VERR_INVALID_PARAMETER); 1105 AssertReturn(cb <= pCur->RamRange.cb, VERR_INVALID_PARAMETER); 1106 AssertReturn(off + cb <= pCur->RamRange.cb, VERR_INVALID_PARAMETER); 1107 1108 /* 1109 * Pass the request on to the support library/driver. 1110 */ 1111 int rc = SUPR3PageMapKernel(pCur->pvR3, off, cb, 0, pR0Ptr); 1112 1113 return rc; 1114 } 1115 1116 1117 /** 1077 1118 * Registers a ROM image. 1078 1119 * -
trunk/src/VBox/VMM/VMMR0/PGMR0DynMap.cpp
r14823 r14826 1360 1360 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1361 1361 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 1362 1362 1363 #define CHECK_RET(expr, a) \ 1363 1364 do { \ 1364 if ( !(expr)) \1365 if (RT_UNLIKELY(!(expr))) \ 1365 1366 { \ 1366 1367 RTSpinlockRelease(pThis->hSpinlock, &Tmp); \
Note:
See TracChangeset
for help on using the changeset viewer.