Changeset 108658 in vbox
- Timestamp:
- Mar 20, 2025 3:33:39 PM (8 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168071
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp
r106061 r108658 45 45 #include <iprt/stream.h> 46 46 #include <iprt/string.h> 47 #include <iprt/system.h> 47 48 48 49 … … 58 59 if (RT_SUCCESS(rc)) 59 60 { 61 uint32_t const cbPage = RTSystemGetPageSize(); 62 uintptr_t const offPageMask = RTSystemGetPageOffsetMask(); 63 60 64 /* 61 65 * Allocate a bit of contiguous memory. … … 77 81 } 78 82 if ( aPages0[iPage].Phys >= _4G 79 || (aPages0[iPage].Phys & PAGE_OFFSET_MASK))83 || (aPages0[iPage].Phys & offPageMask)) 80 84 { 81 85 rcRet++; … … 86 90 { 87 91 for (unsigned iPage = 0; iPage < RT_ELEMENTS(aPages0); iPage++) 88 memset((char *)pvPages0 + iPage * PAGE_SIZE, iPage, PAGE_SIZE);92 memset((char *)pvPages0 + iPage * cbPage, iPage, cbPage); 89 93 for (unsigned iPage = 0; iPage < RT_ELEMENTS(aPages0); iPage++) 90 for (uint8_t *pu8 = (uint8_t *)pvPages0 + iPage * PAGE_SIZE, *pu8End = pu8 + PAGE_SIZE; pu8 < pu8End; pu8++)94 for (uint8_t *pu8 = (uint8_t *)pvPages0 + iPage * cbPage, *pu8End = pu8 + cbPage; pu8 < pu8End; pu8++) 91 95 if (*pu8 != (uint8_t)iPage) 92 96 { 93 97 RTPrintf("tstLow: error: invalid page content %02x != %02x. iPage=%u off=%#x\n", 94 *pu8, (uint8_t)iPage, iPage, (uintptr_t)pu8 & PAGE_OFFSET_MASK);98 *pu8, (uint8_t)iPage, iPage, (uintptr_t)pu8 & offPageMask); 95 99 rcRet++; 96 100 } … … 125 129 } 126 130 if ( aPages1[iPage].Phys >= _4G 127 || (aPages1[iPage].Phys & PAGE_OFFSET_MASK))131 || (aPages1[iPage].Phys & offPageMask)) 128 132 { 129 133 rcRet++; … … 134 138 { 135 139 for (unsigned iPage = 0; iPage < cPages; iPage++) 136 memset((char *)pvPages1 + iPage * PAGE_SIZE, iPage, PAGE_SIZE);140 memset((char *)pvPages1 + iPage * cbPage, iPage, cbPage); 137 141 for (unsigned iPage = 0; iPage < cPages; iPage++) 138 for (uint8_t *pu8 = (uint8_t *)pvPages1 + iPage * PAGE_SIZE, *pu8End = pu8 + PAGE_SIZE; pu8 < pu8End; pu8++)142 for (uint8_t *pu8 = (uint8_t *)pvPages1 + iPage * cbPage, *pu8End = pu8 + cbPage; pu8 < pu8End; pu8++) 139 143 if (*pu8 != (uint8_t)iPage) 140 144 { 141 145 RTPrintf("tstLow: error: invalid page content %02x != %02x. iPage=%p off=%#x\n", 142 *pu8, (uint8_t)iPage, iPage, (uintptr_t)pu8 & PAGE_OFFSET_MASK);146 *pu8, (uint8_t)iPage, iPage, (uintptr_t)pu8 & offPageMask); 143 147 rcRet++; 144 148 }
Note:
See TracChangeset
for help on using the changeset viewer.