vbox的更動 13149 路徑 trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
- 時間撮記:
- 2008-10-9 下午11:06:42 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r13148 r13149 2094 2094 VMMDECL(int) PGMPhysSimpleWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, const void *pvSrc, size_t cb) 2095 2095 { 2096 # if defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) || defined(VBOX_WITH_NEW_PHYS_CODE)2097 2096 /* 2098 2097 * Treat the first page as a special case. … … 2150 2149 } 2151 2150 /* won't ever get here. */ 2152 2153 # else /* !VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 && !VBOX_WITH_NEW_PHYS_CODE */2154 2155 /*2156 * Anything to do?2157 */2158 if (!cb)2159 return VINF_SUCCESS;2160 2161 LogFlow(("PGMPhysSimpleWriteGCPtr: %VGv %d\n", GCPtrDst, cb));2162 2163 /*2164 * Optimize writes within a single page.2165 */2166 if (((RTGCUINTPTR)GCPtrDst & PAGE_OFFSET_MASK) + cb <= PAGE_SIZE)2167 {2168 void *pvDst;2169 int rc = PGMPhysGCPtr2HCPtr(pVM, GCPtrDst, &pvDst);2170 if (VBOX_FAILURE(rc))2171 return rc;2172 memcpy(pvDst, pvSrc, cb);2173 return VINF_SUCCESS;2174 }2175 2176 /*2177 * Page by page.2178 */2179 for (;;)2180 {2181 /* convert */2182 void *pvDst;2183 int rc = PGMPhysGCPtr2HCPtr(pVM, GCPtrDst, &pvDst);2184 if (VBOX_FAILURE(rc))2185 return rc;2186 2187 /* copy */2188 size_t cbWrite = PAGE_SIZE - ((RTGCUINTPTR)GCPtrDst & PAGE_OFFSET_MASK);2189 if (cbWrite >= cb)2190 {2191 memcpy(pvDst, pvSrc, cb);2192 return VINF_SUCCESS;2193 }2194 memcpy(pvDst, pvSrc, cbWrite);2195 2196 /* next */2197 cb -= cbWrite;2198 pvSrc = (uint8_t *)pvSrc + cbWrite;2199 GCPtrDst += cbWrite;2200 }2201 # endif /* !VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 && !VBOX_WITH_NEW_PHYS_CODE */2202 2151 } 2203 2152
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器