Changeset 104848 in vbox for trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
- Timestamp:
- Jun 5, 2024 9:38:20 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
r104096 r104848 2181 2181 } 2182 2182 2183 2184 DECLHIDDEN(int) rtR0MemObjNativeZeroInitWithoutMapping(PRTR0MEMOBJINTERNAL pMem) 2185 { 2186 PRTR0MEMOBJLNX const pMemLnx = (PRTR0MEMOBJLNX)pMem; 2187 size_t const cPages = pMemLnx->Core.cb >> PAGE_SHIFT; 2188 size_t iPage; 2189 /** @todo optimize this. */ 2190 for (iPage = 0; iPage < cPages; iPage++) 2191 { 2192 void *pvPage; 2193 2194 /* Get the physical address of the page. */ 2195 RTHCPHYS const HCPhys = rtR0MemObjNativeGetPagePhysAddr(&pMemLnx->Core, iPage); 2196 AssertReturn(HCPhys != NIL_RTHCPHYS, VERR_INTERNAL_ERROR_3); 2197 Assert(!(HCPhys & PAGE_OFFSET_MASK)); 2198 2199 /* Would've like to use valid_phys_addr_range for this test, but it isn't exported. */ 2200 AssertReturn((HCPhys | PAGE_OFFSET_MASK) < __pa(high_memory), VERR_INTERNAL_ERROR_3); 2201 2202 /* Map it. */ 2203 pvPage = phys_to_virt(HCPhys); 2204 AssertPtrReturn(pvPage, VERR_INTERNAL_ERROR_3); 2205 2206 /* Zero it. */ 2207 RT_BZERO(pvPage, PAGE_SIZE); 2208 } 2209 return VINF_SUCCESS; 2210 } 2211
Note:
See TracChangeset
for help on using the changeset viewer.