- Timestamp:
- Feb 24, 2022 9:15:14 PM (3 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 21 edited
-
.scm-settings (modified) (1 diff)
-
Audio/testcase/tstAudioMixBuffer.cpp (modified) (1 diff)
-
EFI/DevEFI.cpp (modified) (5 diffs)
-
EFI/DevSmc.cpp (modified) (1 diff)
-
Graphics/DevVGA-SVGA-cmd.cpp (modified) (6 diffs)
-
Graphics/DevVGA-SVGA.cpp (modified) (9 diffs)
-
Graphics/DevVGA.cpp (modified) (15 diffs)
-
Graphics/DevVGA.h (modified) (1 diff)
-
Misc/DevVirtualKD.cpp (modified) (3 diffs)
-
Network/slirp/bsd/sys/mbuf.h (modified) (3 diffs)
-
PC/DevPcBios.cpp (modified) (1 diff)
-
Storage/DevAHCI.cpp (modified) (1 diff)
-
USB/DevOHCI.cpp (modified) (4 diffs)
-
USB/darwin/USBProxyDevice-darwin.cpp (modified) (2 diffs)
-
USB/testcase/tstOhciRegisterAccess.cpp (modified) (3 diffs)
-
VMMDev/VMMDev.cpp (modified) (1 diff)
-
VMMDev/VMMDevHGCM.cpp (modified) (9 diffs)
-
VirtIO/Virtio.cpp (modified) (1 diff)
-
VirtIO/VirtioCore.cpp (modified) (1 diff)
-
testcase/tstDeviceR0.cpp (modified) (3 diffs)
-
testcase/tstDeviceStructSizeRC.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/.scm-settings
r93115 r93944 18 18 /*.h: --guard-relative-to-dir . 19 19 /Graphics/vmsvga_glext/*.h|/Graphics/vmsvga/*.h: --guard-relative-to-dir '' 20 /*.h: --only-guest-host-page 20 21 22 # Same as for the VMM, careful with page stuff. 23 /*.h: --only-guest-host-page --no-ASMMemPage-use 24 /*.cpp: --only-guest-host-page --no-ASMMemPage-use 25 /*.m: --only-guest-host-page --no-ASMMemPage-use 26 27 # This defines it's own PAGE_XXX macros. 28 /PC/ipxe/src/include/ipxe/virtio-ring.h: --no-page-restrictions -
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r93115 r93944 159 159 /* DrvAudioHlpClearBuf: */ 160 160 uint8_t *pbPage; 161 int rc = RTTestGuardedAlloc(hTest, PAGE_SIZE, 0, false /*fHead*/, (void **)&pbPage);161 int rc = RTTestGuardedAlloc(hTest, HOST_PAGE_SIZE, 0, false /*fHead*/, (void **)&pbPage); 162 162 RTTESTI_CHECK_RC_OK_RETV(rc); 163 163 164 memset(pbPage, 0x42, PAGE_SIZE);165 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, PAGE_SIZE,PAGE_SIZE / 4);166 RTTESTI_CHECK(ASMMemIsZero(pbPage, PAGE_SIZE));167 168 memset(pbPage, 0x42, PAGE_SIZE);169 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, PAGE_SIZE,PAGE_SIZE / 4);170 for (uint32_t off = 0; off < PAGE_SIZE; off += 2)164 memset(pbPage, 0x42, HOST_PAGE_SIZE); 165 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 4); 166 RTTESTI_CHECK(ASMMemIsZero(pbPage, HOST_PAGE_SIZE)); 167 168 memset(pbPage, 0x42, HOST_PAGE_SIZE); 169 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 4); 170 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 2) 171 171 RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1])); 172 172 173 memset(pbPage, 0x42, PAGE_SIZE);174 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, PAGE_SIZE,PAGE_SIZE / 8);175 for (uint32_t off = 0; off < PAGE_SIZE; off += 4)173 memset(pbPage, 0x42, HOST_PAGE_SIZE); 174 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 8); 175 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 4) 176 176 RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80); 177 177 178 178 179 179 RTTestDisableAssertions(hTest); 180 memset(pbPage, 0x42, PAGE_SIZE);181 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, PAGE_SIZE,PAGE_SIZE); /* should adjust down the frame count. */182 RTTESTI_CHECK(ASMMemIsZero(pbPage, PAGE_SIZE));183 184 memset(pbPage, 0x42, PAGE_SIZE);185 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, PAGE_SIZE,PAGE_SIZE); /* should adjust down the frame count. */186 for (uint32_t off = 0; off < PAGE_SIZE; off += 2)180 memset(pbPage, 0x42, HOST_PAGE_SIZE); 181 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */ 182 RTTESTI_CHECK(ASMMemIsZero(pbPage, HOST_PAGE_SIZE)); 183 184 memset(pbPage, 0x42, HOST_PAGE_SIZE); 185 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */ 186 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 2) 187 187 RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1])); 188 188 189 memset(pbPage, 0x42, PAGE_SIZE);190 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, PAGE_SIZE,PAGE_SIZE); /* should adjust down the frame count. */191 for (uint32_t off = 0; off < PAGE_SIZE; off += 4)189 memset(pbPage, 0x42, HOST_PAGE_SIZE); 190 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */ 191 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 4) 192 192 RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80); 193 193 RTTestRestoreAssertions(hTest); -
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r93115 r93944 956 956 * Re-shadow the Firmware Volume and make it RAM/RAM. 957 957 */ 958 uint32_t cPages = RT_ALIGN_64(pThisCC->cbEfiRom, PAGE_SIZE) >>PAGE_SHIFT;958 uint32_t cPages = RT_ALIGN_64(pThisCC->cbEfiRom, GUEST_PAGE_SIZE) >> GUEST_PAGE_SHIFT; 959 959 RTGCPHYS GCPhys = pThisCC->GCLoadAddress; 960 960 while (cPages > 0) 961 961 { 962 uint8_t abPage[ PAGE_SIZE];962 uint8_t abPage[GUEST_PAGE_SIZE]; 963 963 964 964 /* Read the (original) ROM page and write it back to the RAM page. */ 965 int rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM);965 int rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM); 966 966 AssertLogRelRC(rc); 967 967 968 rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, PAGE_SIZE);968 rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE); 969 969 AssertLogRelRC(rc); 970 970 if (RT_FAILURE(rc)) 971 971 memset(abPage, 0xcc, sizeof(abPage)); 972 972 973 rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, PAGE_SIZE);973 rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE); 974 974 AssertLogRelRC(rc); 975 975 976 976 /* Switch to the RAM/RAM mode. */ 977 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM);977 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM); 978 978 AssertLogRelRC(rc); 979 979 980 980 /* Advance */ 981 GCPhys += PAGE_SIZE;981 GCPhys += GUEST_PAGE_SIZE; 982 982 cPages--; 983 983 } … … 1153 1153 VERR_INVALID_PARAMETER); 1154 1154 1155 AssertLogRelMsgReturn(!(pThisCC->cbEfiRom & PAGE_OFFSET_MASK), ("%RX64\n", pThisCC->cbEfiRom), VERR_INVALID_PARAMETER);1155 AssertLogRelMsgReturn(!(pThisCC->cbEfiRom & GUEST_PAGE_OFFSET_MASK), ("%RX64\n", pThisCC->cbEfiRom), VERR_INVALID_PARAMETER); 1156 1156 1157 1157 LogRel(("Found EFI FW Volume, %u bytes (%u %u-byte blocks)\n", pFwVolHdr->FvLength, pFwVolHdr->BlockMap[0].NumBlocks, pFwVolHdr->BlockMap[0].Length)); … … 1165 1165 pThisCC->offEfiRom = pFwVolHdr->FvLength; 1166 1166 pThisCC->cbNvram = pFwVolHdr->FvLength; 1167 pThisCC->GCPhysNvram = UINT32_C(0xfffff000) - pThisCC->cbEfiRom + PAGE_SIZE;1167 pThisCC->GCPhysNvram = UINT32_C(0xfffff000) - pThisCC->cbEfiRom + GUEST_PAGE_SIZE; 1168 1168 pThisCC->cbEfiRom -= pThisCC->cbNvram; 1169 1169 … … 1284 1284 1285 1285 uint32_t const cbChunk = pThisCC->cbNvram + pThisCC->cbEfiRom >= _2M ? _512K 1286 : (uint32_t)RT_ALIGN_64((pThisCC->cbNvram + pThisCC->cbEfiRom) / 4, PAGE_SIZE);1286 : (uint32_t)RT_ALIGN_64((pThisCC->cbNvram + pThisCC->cbEfiRom) / 4, GUEST_PAGE_SIZE); 1287 1287 uint32_t cbLeft = pThisCC->cbEfiRom; /* ASSUMES NVRAM comes first! */ 1288 1288 uint32_t off = pThisCC->offEfiRom + cbLeft; /* ASSUMES NVRAM comes first! */ … … 1328 1328 1329 1329 #else 1330 RTGCPHYS cbQuart = RT_ALIGN_64(pThisCC->cbEfiRom / 4, PAGE_SIZE);1330 RTGCPHYS cbQuart = RT_ALIGN_64(pThisCC->cbEfiRom / 4, GUEST_PAGE_SIZE); 1331 1331 rc = PDMDevHlpROMRegister(pDevIns, 1332 1332 pThisCC->GCLoadAddress, -
trunk/src/VBox/Devices/EFI/DevSmc.cpp
r93115 r93944 36 36 # include <iprt/once.h> 37 37 #endif 38 #if defined(RT_OS_DARWIN) && defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE) /* drags in bad PAGE_SIZE*/38 #if defined(RT_OS_DARWIN) && defined(IN_RING3) && !defined(VBOX_DEVICE_STRUCT_TESTCASE) /* drags in bad page size define */ 39 39 # include "IOKit/IOKitLib.h" 40 40 #endif -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA-cmd.cpp
r93636 r93944 393 393 { 394 394 if ( GCPhys >= pGbo->paDescriptors[j].GCPhys 395 && GCPhys < pGbo->paDescriptors[j].GCPhys + pGbo->paDescriptors[j].cPages * PAGE_SIZE)395 && GCPhys < pGbo->paDescriptors[j].GCPhys + pGbo->paDescriptors[j].cPages * GUEST_PAGE_SIZE) 396 396 { 397 397 switch (i) … … 595 595 for (uint32_t i = 0; i < pGbo->cDescriptors; ++i) 596 596 { 597 rc = PDMDevHlpPGMHandlerPhysicalRegister(pSvgaR3State->pDevIns, pGbo->paDescriptors[i].GCPhys, 598 pGbo->paDescriptors[i].GCPhys + pGbo->paDescriptors[i].cPages * PAGE_SIZE - 1, 597 rc = PDMDevHlpPGMHandlerPhysicalRegister(pSvgaR3State->pDevIns, 598 pGbo->paDescriptors[i].GCPhys, 599 pGbo->paDescriptors[i].GCPhys 600 + pGbo->paDescriptors[i].cPages * GUEST_PAGE_SIZE - 1, 599 601 pSvgaR3State->hGboAccessHandlerType, "VMSVGA GBO"); 600 602 AssertRC(rc); … … 6948 6950 GCPhys = (paPages64[0] << X86_PAGE_SHIFT) & UINT64_C(0x00000FFFFFFFFFFF); /* Seeing rubbish in the top bits with certain linux guests. */ 6949 6951 else 6950 GCPhys = (RTGCPHYS)paPages32[0] << PAGE_SHIFT;6952 GCPhys = (RTGCPHYS)paPages32[0] << GUEST_PAGE_SHIFT; 6951 6953 paDescs[0].GCPhys = GCPhys; 6952 6954 paDescs[0].numPages = 1; … … 7218 7220 7219 7221 /* Find the right descriptor */ 7220 while (offDesc + paDesc[iDesc].numPages * PAGE_SIZE <= offGmrCurrent)7222 while (offDesc + paDesc[iDesc].numPages * GUEST_PAGE_SIZE <= offGmrCurrent) 7221 7223 { 7222 offDesc += paDesc[iDesc].numPages * PAGE_SIZE;7224 offDesc += paDesc[iDesc].numPages * GUEST_PAGE_SIZE; 7223 7225 AssertReturn(offDesc < pGMR->cbTotal, VERR_INTERNAL_ERROR); /* overflow protection */ 7224 7226 ++iDesc; … … 7230 7232 uint32_t cbToCopy; 7231 7233 7232 if (offGmrCurrent + cbCurrentWidth <= offDesc + paDesc[iDesc].numPages * PAGE_SIZE) 7233 { 7234 if (offGmrCurrent + cbCurrentWidth <= offDesc + paDesc[iDesc].numPages * GUEST_PAGE_SIZE) 7234 7235 cbToCopy = cbCurrentWidth; 7235 }7236 7236 else 7237 7237 { 7238 cbToCopy = (offDesc + paDesc[iDesc].numPages * PAGE_SIZE - offGmrCurrent);7238 cbToCopy = (offDesc + paDesc[iDesc].numPages * GUEST_PAGE_SIZE - offGmrCurrent); 7239 7239 AssertReturn(cbToCopy <= cbCurrentWidth, VERR_INVALID_PARAMETER); 7240 7240 } … … 7262 7262 if (cbCurrentWidth) 7263 7263 { 7264 offDesc += paDesc[iDesc].numPages * PAGE_SIZE;7264 offDesc += paDesc[iDesc].numPages * GUEST_PAGE_SIZE; 7265 7265 AssertReturn(offDesc < pGMR->cbTotal, VERR_INTERNAL_ERROR); 7266 7266 ++iDesc; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r93650 r93944 2102 2102 2103 2103 /* Just undefine the GMR? */ 2104 RTGCPHYS GCPhys = (RTGCPHYS)u32 << PAGE_SHIFT;2104 RTGCPHYS GCPhys = (RTGCPHYS)u32 << GUEST_PAGE_SHIFT; 2105 2105 if (GCPhys == 0) 2106 2106 { … … 2117 2117 uint32_t cLoops = 0; 2118 2118 RTGCPHYS GCPhysBase = GCPhys; 2119 while ( PHYS_PAGE_ADDRESS(GCPhys) == PHYS_PAGE_ADDRESS(GCPhysBase))2119 while ((GCPhys >> GUEST_PAGE_SHIFT) == (GCPhysBase >> GUEST_PAGE_SHIFT)) 2120 2120 { 2121 2121 /* Read descriptor. */ … … 2137 2137 } 2138 2138 2139 paDescs[iDesc].GCPhys = (RTGCPHYS)desc.ppn << PAGE_SHIFT;2139 paDescs[iDesc].GCPhys = (RTGCPHYS)desc.ppn << GUEST_PAGE_SHIFT; 2140 2140 paDescs[iDesc++].numPages = desc.numPages; 2141 2141 … … 2146 2146 break; /* terminator */ 2147 2147 else /* Pointer to the next physical page of descriptors. */ 2148 GCPhys = GCPhysBase = (RTGCPHYS)desc.ppn << PAGE_SHIFT;2148 GCPhys = GCPhysBase = (RTGCPHYS)desc.ppn << GUEST_PAGE_SHIFT; 2149 2149 2150 2150 cLoops++; … … 2159 2159 pSVGAState->paGMR[idGMR].numDescriptors = iDesc; 2160 2160 pSVGAState->paGMR[idGMR].cMaxPages = cPagesTotal; 2161 pSVGAState->paGMR[idGMR].cbTotal = cPagesTotal * PAGE_SIZE;2162 Assert((pSVGAState->paGMR[idGMR].cbTotal >> PAGE_SHIFT) == cPagesTotal);2161 pSVGAState->paGMR[idGMR].cbTotal = cPagesTotal * GUEST_PAGE_SIZE; 2162 Assert((pSVGAState->paGMR[idGMR].cbTotal >> GUEST_PAGE_SHIFT) == cPagesTotal); 2163 2163 Log(("Defined new gmr %x numDescriptors=%d cbTotal=%x (%#x pages)\n", 2164 2164 idGMR, iDesc, pSVGAState->paGMR[idGMR].cbTotal, cPagesTotal)); … … 2834 2834 { 2835 2835 if ( GCPhys >= pGMR->paDesc[j].GCPhys 2836 && GCPhys < pGMR->paDesc[j].GCPhys + pGMR->paDesc[j].numPages * PAGE_SIZE)2836 && GCPhys < pGMR->paDesc[j].GCPhys + pGMR->paDesc[j].numPages * GUEST_PAGE_SIZE) 2837 2837 { 2838 2838 /* … … 2861 2861 for (uint32_t i = 0; i < pGMR->numDescriptors; i++) 2862 2862 { 2863 rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns, 2864 pGMR->paDesc[i].GCPhys , pGMR->paDesc[i].GCPhys + pGMR->paDesc[i].numPages *PAGE_SIZE - 1,2863 rc = PDMDevHlpPGMHandlerPhysicalRegister(pDevIns, pGMR->paDesc[i].GCPhys, 2864 pGMR->paDesc[i].GCPhys + pGMR->paDesc[i].numPages * GUEST_PAGE_SIZE - 1, 2865 2865 pThis->svga.hGmrAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR, "VMSVGA GMR"); 2866 2866 AssertRC(rc); … … 5147 5147 /* Hardware enabled; return real framebuffer size .*/ 5148 5148 cbFrameBuffer = (uint32_t)pThis->svga.uHeight * pThis->svga.cbScanline; 5149 cbFrameBuffer = RT_ALIGN(cbFrameBuffer, PAGE_SIZE);5149 cbFrameBuffer = RT_ALIGN(cbFrameBuffer, GUEST_PAGE_SIZE); 5150 5150 } 5151 5151 … … 5200 5200 GCPhysAddress + (pThis->svga.cbFIFO - 1), 5201 5201 # else 5202 GCPhysAddress + PAGE_SIZE - 1,5202 GCPhysAddress + GUEST_PAGE_SIZE - 1, 5203 5203 # endif 5204 5204 pThis->svga.hFifoAccessHandlerType, pThis, NIL_RTR0PTR, NIL_RTRCPTR, -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r93840 r93944 309 309 { 310 310 AssertMsg(offVRAM < pThis->vram_size, ("offVRAM = %p, pThis->vram_size = %p\n", offVRAM, pThis->vram_size)); 311 ASMBitSet(&pThis->bmDirtyBitmap[0], offVRAM >> PAGE_SHIFT);311 ASMBitSet(&pThis->bmDirtyBitmap[0], offVRAM >> GUEST_PAGE_SHIFT); 312 312 pThis->fHasDirtyBits = true; 313 313 } … … 324 324 { 325 325 AssertMsg(offVRAM < pThis->vram_size, ("offVRAM = %p, pThis->vram_size = %p\n", offVRAM, pThis->vram_size)); 326 return ASMBitTest(&pThis->bmDirtyBitmap[0], offVRAM >> PAGE_SHIFT);326 return ASMBitTest(&pThis->bmDirtyBitmap[0], offVRAM >> GUEST_PAGE_SHIFT); 327 327 } 328 328 … … 341 341 Assert(offVRAMEnd <= pThis->vram_size); 342 342 Assert(offVRAMStart < offVRAMEnd); 343 ASMBitClearRange(&pThis->bmDirtyBitmap[0], offVRAMStart >> PAGE_SHIFT, offVRAMEnd >>PAGE_SHIFT);343 ASMBitClearRange(&pThis->bmDirtyBitmap[0], offVRAMStart >> GUEST_PAGE_SHIFT, offVRAMEnd >> GUEST_PAGE_SHIFT); 344 344 } 345 345 … … 350 350 static void vgaR3UpdateDirtyBitsAndResetMonitoring(PPDMDEVINS pDevIns, PVGASTATE pThis) 351 351 { 352 size_t const cbBitmap = RT_ALIGN_Z(RT_MIN(pThis->vram_size, VGA_VRAM_MAX), PAGE_SIZE * 64) /PAGE_SIZE / 8;352 size_t const cbBitmap = RT_ALIGN_Z(RT_MIN(pThis->vram_size, VGA_VRAM_MAX), GUEST_PAGE_SIZE * 64) / GUEST_PAGE_SIZE / 8; 353 353 354 354 /* … … 366 366 else 367 367 { 368 uint64_t bmDirtyPages[VGA_VRAM_MAX / PAGE_SIZE / 64]; /* (256 MB VRAM -> 8KB bitmap) */368 uint64_t bmDirtyPages[VGA_VRAM_MAX / GUEST_PAGE_SIZE / 64]; /* (256 MB VRAM -> 8KB bitmap) */ 369 369 int rc = PDMDevHlpMmio2QueryAndResetDirtyBitmap(pDevIns, pThis->hMmio2VRam, bmDirtyPages, cbBitmap); 370 370 if (RT_SUCCESS(rc)) … … 2287 2287 { 2288 2288 uint32_t offSrcLine = offSrcStart + y * cbScanline; 2289 uint32_t offPage0 = offSrcLine & ~ PAGE_OFFSET_MASK;2290 uint32_t offPage1 = (offSrcLine + cbScanline - 1) & ~ PAGE_OFFSET_MASK;2289 uint32_t offPage0 = offSrcLine & ~(uint32_t)GUEST_PAGE_OFFSET_MASK; 2290 uint32_t offPage1 = (offSrcLine + cbScanline - 1) & ~(uint32_t)GUEST_PAGE_OFFSET_MASK; 2291 2291 /** @todo r=klaus this assumes that a line is fully covered by 3 pages, 2292 2292 * irrespective of alignment. Not guaranteed for high res modes, i.e. … … 2294 2294 * between the first and last one. */ 2295 2295 bool fUpdate = fFullUpdate | vgaIsDirty(pThis, offPage0) | vgaIsDirty(pThis, offPage1); 2296 if (offPage1 - offPage0 > PAGE_SIZE)2296 if (offPage1 - offPage0 > GUEST_PAGE_SIZE) 2297 2297 /* if wide line, can use another page */ 2298 fUpdate |= vgaIsDirty(pThis, offPage0 + PAGE_SIZE);2298 fUpdate |= vgaIsDirty(pThis, offPage0 + GUEST_PAGE_SIZE); 2299 2299 /* explicit invalidation for the hardware cursor */ 2300 2300 fUpdate |= (pThis->invalidated_y_table[y >> 5] >> (y & 0x1f)) & 1; … … 2330 2330 /* reset modified pages */ 2331 2331 if (offPageMax != -1 && reset_dirty) 2332 vgaR3ResetDirty(pThis, offPageMin, offPageMax + PAGE_SIZE);2332 vgaR3ResetDirty(pThis, offPageMin, offPageMax + GUEST_PAGE_SIZE); 2333 2333 memset(pThis->invalidated_y_table, 0, ((cy + 31) >> 5) * 4); 2334 2334 … … 2486 2486 } 2487 2487 addr &= pThis->vga_addr_mask; 2488 page0 = addr & ~ PAGE_OFFSET_MASK;2489 page1 = (addr + bwidth - 1) & ~ PAGE_OFFSET_MASK;2488 page0 = addr & ~(uint32_t)GUEST_PAGE_OFFSET_MASK; 2489 page1 = (addr + bwidth - 1) & ~(uint32_t)GUEST_PAGE_OFFSET_MASK; 2490 2490 /** @todo r=klaus this assumes that a line is fully covered by 3 pages, 2491 2491 * irrespective of alignment. Not guaranteed for high res modes, i.e. … … 2493 2493 * between the first and last one. */ 2494 2494 bool update = full_update | vgaIsDirty(pThis, page0) | vgaIsDirty(pThis, page1); 2495 if (page1 - page0 > PAGE_SIZE) {2495 if (page1 - page0 > GUEST_PAGE_SIZE) { 2496 2496 /* if wide line, can use another page */ 2497 update |= vgaIsDirty(pThis, page0 + PAGE_SIZE);2497 update |= vgaIsDirty(pThis, page0 + GUEST_PAGE_SIZE); 2498 2498 } 2499 2499 /* explicit invalidation for the hardware cursor */ … … 2541 2541 /* reset modified pages */ 2542 2542 if (page_max != -1 && reset_dirty) { 2543 vgaR3ResetDirty(pThis, page_min, page_max + PAGE_SIZE);2543 vgaR3ResetDirty(pThis, page_min, page_max + GUEST_PAGE_SIZE); 2544 2544 } 2545 2545 memset(pThis->invalidated_y_table, 0, ((height + 31) >> 5) * 4); … … 2574 2574 if (reset_dirty && pThis->last_scr_height > 0) 2575 2575 { 2576 page_min = (pThis->start_addr * 4) & ~ PAGE_OFFSET_MASK;2577 /* round up page_max by one page, as otherwise this can be - PAGE_SIZE,2576 page_min = (pThis->start_addr * 4) & ~(uint32_t)GUEST_PAGE_OFFSET_MASK; 2577 /* round up page_max by one page, as otherwise this can be -GUEST_PAGE_SIZE, 2578 2578 * which causes assertion trouble in vgaR3ResetDirty. */ 2579 page_max = (pThis->start_addr * 4 + pThis->line_offset * pThis->last_scr_height - 1 + PAGE_SIZE) & ~PAGE_OFFSET_MASK; 2580 vgaR3ResetDirty(pThis, page_min, page_max + PAGE_SIZE); 2579 page_max = (pThis->start_addr * 4 + pThis->line_offset * pThis->last_scr_height - 1 + GUEST_PAGE_SIZE) 2580 & ~(uint32_t)GUEST_PAGE_OFFSET_MASK; 2581 vgaR3ResetDirty(pThis, page_min, page_max + GUEST_PAGE_SIZE); 2581 2582 } 2582 2583 if (pDrv->pbData == pThisCC->pbVRam) /* Do not clear the VRAM itself. */ … … 4210 4211 { 4211 4212 vgaR3MarkDirty(pThis, offDirty); 4212 offDirty += PAGE_SIZE;4213 offDirty += GUEST_PAGE_SIZE; 4213 4214 } 4214 4215 break; … … 6754 6755 6755 6756 AssertReleaseMsg(cbVgaBiosBinary <= _64K && cbVgaBiosBinary >= 32*_1K, ("cbVgaBiosBinary=%#x\n", cbVgaBiosBinary)); 6756 AssertReleaseMsg(RT_ALIGN_Z(cbVgaBiosBinary, PAGE_SIZE) == cbVgaBiosBinary, ("cbVgaBiosBinary=%#x\n", cbVgaBiosBinary));6757 AssertReleaseMsg(RT_ALIGN_Z(cbVgaBiosBinary, GUEST_PAGE_SIZE) == cbVgaBiosBinary, ("cbVgaBiosBinary=%#x\n", cbVgaBiosBinary)); 6757 6758 /* Note! Because of old saved states we'll always register at least 36KB of ROM. */ 6758 6759 rc = PDMDevHlpROMRegister(pDevIns, 0x000c0000, RT_MAX(cbVgaBiosBinary, 36*_1K), pbVgaBiosBinary, cbVgaBiosBinary, … … 7309 7310 */ 7310 7311 # if defined(VBOX_WITH_VMSVGA) && !defined(IN_RC) 7311 AssertCompile((RT_MAX(SVGA_FIFO_MIN, RT_MAX(SVGA_FIFO_PITCHLOCK, SVGA_FIFO_BUSY)) + 1) * sizeof(uint32_t) < PAGE_SIZE);7312 AssertCompile((RT_MAX(SVGA_FIFO_MIN, RT_MAX(SVGA_FIFO_PITCHLOCK, SVGA_FIFO_BUSY)) + 1) * sizeof(uint32_t) < GUEST_PAGE_SIZE); 7312 7313 if (pThis->fVMSVGAEnabled) 7313 7314 { 7314 rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VmSvgaFifo, 0 /* off */, PAGE_SIZE,7315 rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VmSvgaFifo, 0 /* off */, GUEST_PAGE_SIZE, 7315 7316 (void **)&pThisCC->svga.pau32FIFO); 7316 7317 AssertLogRelMsgRCReturn(rc, ("PDMDevHlpMapMMIO2IntoR0(%#x,) -> %Rrc\n", pThis->svga.cbFIFO, rc), rc); -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r93840 r93944 351 351 uint32_t cMilliesRefreshInterval; 352 352 /** Bitmap tracking dirty pages. */ 353 uint64_t bmDirtyBitmap[VGA_VRAM_MAX / PAGE_SIZE / 64];353 uint64_t bmDirtyBitmap[VGA_VRAM_MAX / GUEST_PAGE_SIZE / 64]; 354 354 355 355 /** Flag indicating that there are dirty bits. This is used to optimize the handler resetting. */ -
trunk/src/VBox/Devices/Misc/DevVirtualKD.cpp
r93115 r93944 78 78 } VIRTUALKD; 79 79 80 #define VIRTUALKB_CMDBODY_SIZE _256K /**< Size of buffer pointed to by VIRTUALKB::pbCmdBody */81 #define VIRTUALKB_CMDBODY_PRE_FENCE ( PAGE_SIZE * 4) /**< Size of the eletrict fence before the command body. */82 #define VIRTUALKB_CMDBODY_POST_FENCE ( PAGE_SIZE * 8) /**< Size of the eletrict fence after the command body. */80 #define VIRTUALKB_CMDBODY_SIZE _256K /**< Size of buffer pointed to by VIRTUALKB::pbCmdBody */ 81 #define VIRTUALKB_CMDBODY_PRE_FENCE (HOST_PAGE_SIZE * 4) /**< Size of the eletrict fence before the command body. */ 82 #define VIRTUALKB_CMDBODY_POST_FENCE (HOST_PAGE_SIZE * 8) /**< Size of the eletrict fence after the command body. */ 83 83 84 84 … … 193 193 { 194 194 if (pThis->fFencedCmdBody) 195 RTMemPageFree((uint8_t *)pThis->pbCmdBody - RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE),196 RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE)197 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, PAGE_SIZE)198 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, PAGE_SIZE));195 RTMemPageFree((uint8_t *)pThis->pbCmdBody - RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE), 196 RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE) 197 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, HOST_PAGE_SIZE) 198 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, HOST_PAGE_SIZE)); 199 199 else 200 200 RTMemFree(pThis->pbCmdBody); … … 246 246 { 247 247 /* We allocate a fenced buffer for reasons of paranoia. */ 248 uint8_t *pbCmdBody = (uint8_t *)RTMemPageAlloc( RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE)249 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, PAGE_SIZE)250 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, PAGE_SIZE));248 uint8_t *pbCmdBody = (uint8_t *)RTMemPageAlloc( RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE) 249 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, HOST_PAGE_SIZE) 250 + RT_ALIGN_Z(VIRTUALKB_CMDBODY_POST_FENCE, HOST_PAGE_SIZE)); 251 251 if (pbCmdBody) 252 252 { 253 rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE), RTMEM_PROT_NONE);254 pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE);253 rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE), RTMEM_PROT_NONE); 254 pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE); 255 255 256 256 pThis->fFencedCmdBody = true; 257 257 pThis->pbCmdBody = (char *)pbCmdBody; 258 rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, PAGE_SIZE), RTMEM_PROT_READ | RTMEM_PROT_WRITE); 258 rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, HOST_PAGE_SIZE), 259 RTMEM_PROT_READ | RTMEM_PROT_WRITE); 259 260 AssertLogRelRC(rc); 260 pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, PAGE_SIZE); 261 262 rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, PAGE_SIZE), RTMEM_PROT_NONE); 261 pbCmdBody += RT_ALIGN_Z(VIRTUALKB_CMDBODY_SIZE, HOST_PAGE_SIZE); 262 263 rc = RTMemProtect(pbCmdBody, RT_ALIGN_Z(VIRTUALKB_CMDBODY_PRE_FENCE, HOST_PAGE_SIZE), 264 RTMEM_PROT_NONE); 263 265 AssertLogRelRC(rc); 264 266 } -
trunk/src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h
r87289 r93944 46 46 #endif 47 47 #else /* VBOX */ 48 # include < iprt/param.h>48 # include <VBox/param.h> 49 49 # include "misc.h" 50 50 # include "ext.h" … … 76 76 /* 77 77 * Constants related to network buffer management. 78 * MCLBYTES must be no larger than PAGE_SIZE.78 * MCLBYTES must be no larger than HOST_PAGE_SIZE. 79 79 */ 80 80 # ifndef MSIZE … … 91 91 92 92 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 93 # define MJUMPAGESIZE PAGE_SIZE /* jumbo cluster 4k */93 # define MJUMPAGESIZE HOST_PAGE_SIZE /* jumbo cluster 4k */ 94 94 # else 95 95 # define MJUMPAGESIZE (4 * 1024) /* jumbo cluster 4k */ -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r93115 r93944 1092 1092 * the chipset support for this we do it here (and in the constructor). 1093 1093 */ 1094 uint32_t cPages = RT_ALIGN_64(pThis->cbLanBoot, PAGE_SIZE) >>PAGE_SHIFT;1094 uint32_t cPages = RT_ALIGN_64(pThis->cbLanBoot, GUEST_PAGE_SIZE) >> GUEST_PAGE_SHIFT; 1095 1095 RTGCPHYS GCPhys = VBOX_LANBOOT_SEG << 4; 1096 1096 while (cPages > 0) 1097 1097 { 1098 uint8_t abPage[ PAGE_SIZE];1098 uint8_t abPage[GUEST_PAGE_SIZE]; 1099 1099 int rc; 1100 1100 1101 1101 /* Read the (original) ROM page and write it back to the RAM page. */ 1102 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM);1102 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM); 1103 1103 AssertLogRelRC(rc); 1104 1104 1105 rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, PAGE_SIZE);1105 rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE); 1106 1106 AssertLogRelRC(rc); 1107 1107 if (RT_FAILURE(rc)) 1108 1108 memset(abPage, 0xcc, sizeof(abPage)); 1109 1109 1110 rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, PAGE_SIZE);1110 rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, GUEST_PAGE_SIZE); 1111 1111 AssertLogRelRC(rc); 1112 1112 1113 1113 /* Switch to the RAM/RAM mode. */ 1114 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM);1114 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, GUEST_PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM); 1115 1115 AssertLogRelRC(rc); 1116 1116 1117 1117 /* Advance */ 1118 GCPhys += PAGE_SIZE;1118 GCPhys += GUEST_PAGE_SIZE; 1119 1119 cPages--; 1120 1120 } -
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r93115 r93944 5921 5921 /* 5922 5922 * The non-fake PCI I/O regions: 5923 * Note! The 4352 byte MMIO region will be rounded up to PAGE_SIZE.5923 * Note! The 4352 byte MMIO region will be rounded up to GUEST_PAGE_SIZE. 5924 5924 */ 5925 5925 rc = PDMDevHlpPCIIORegionCreateIo(pDevIns, 4 /*iPciRegion*/, 0x10 /*cPorts*/, -
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r93914 r93944 243 243 RTGCPHYS GCPhysReadCacheAddr; 244 244 /** Copy of last read physical page. */ 245 uint8_t abPhysReadCache[ PAGE_SIZE];245 uint8_t abPhysReadCache[GUEST_PAGE_SIZE]; 246 246 } OHCIPAGECACHE; 247 247 typedef OHCIPAGECACHE *POHCIPAGECACHE; … … 1439 1439 static void ohciR3PhysReadCacheRead(PPDMDEVINS pDevIns, POHCIPAGECACHE pPageCache, RTGCPHYS GCPhys, void *pvBuf, size_t cbBuf) 1440 1440 { 1441 const RTGCPHYS PageAddr = PAGE_ADDRESS(GCPhys);1442 1443 if (PageAddr == PAGE_ADDRESS(GCPhys + cbBuf))1441 const RTGCPHYS PageAddr = GCPhys & ~(RTGCPHYS)GUEST_PAGE_OFFSET_MASK; 1442 1443 if (PageAddr == ((GCPhys + cbBuf) & ~(RTGCPHYS)GUEST_PAGE_OFFSET_MASK)) 1444 1444 { 1445 1445 if (PageAddr != pPageCache->GCPhysReadCacheAddr) … … 1452 1452 } 1453 1453 1454 memcpy(pvBuf, &pPageCache->abPhysReadCache[GCPhys & PAGE_OFFSET_MASK], cbBuf);1454 memcpy(pvBuf, &pPageCache->abPhysReadCache[GCPhys & GUEST_PAGE_OFFSET_MASK], cbBuf); 1455 1455 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1456 1456 ++g_PhysReadState.cCacheReads; … … 1479 1479 static void ohciR3PhysCacheUpdate(POHCIPAGECACHE pPageCache, RTGCPHYS GCPhys, const void *pvBuf, size_t cbBuf) 1480 1480 { 1481 const RTGCPHYS GCPhysPage = PAGE_ADDRESS(GCPhys);1481 const RTGCPHYS GCPhysPage = GCPhys & ~(RTGCPHYS)GUEST_PAGE_OFFSET_MASK; 1482 1482 1483 1483 if (GCPhysPage == pPageCache->GCPhysReadCacheAddr) 1484 1484 { 1485 uint32_t offPage = GCPhys & PAGE_OFFSET_MASK;1486 memcpy(&pPageCache->abPhysReadCache[offPage], pvBuf, RT_MIN( PAGE_SIZE - offPage, cbBuf));1485 uint32_t offPage = GCPhys & GUEST_PAGE_OFFSET_MASK; 1486 memcpy(&pPageCache->abPhysReadCache[offPage], pvBuf, RT_MIN(GUEST_PAGE_SIZE - offPage, cbBuf)); 1487 1487 } 1488 1488 } -
trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp
r93217 r93944 99 99 /** The buffers. 100 100 * The number of buffers here is decided by pvFrame begin allocated in 101 * PAGE_SIZE chunks. The size of IOUSBLowLatencyIsocFrame is 16 bytes102 * and we require 8 of those per buffer. PAGE_SIZE / (16 * 8) = 32.101 * GUEST_PAGE_SIZE chunks. The size of IOUSBLowLatencyIsocFrame is 16 bytes 102 * and we require 8 of those per buffer. GUEST_PAGE_SIZE / (16 * 8) = 32. 103 103 * @remarks Don't allocate too many as it may temporarily halt the system if 104 104 * some pool is low / exhausted. (Contiguous memory woes on mach.) … … 457 457 if (irc == kIOReturnSuccess) 458 458 { 459 irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvFrames, PAGE_SIZE, kUSBLowLatencyFrameListBuffer); 459 /** @todo GUEST_PAGE_SIZE or HOST_PAGE_SIZE or just 4K? */ 460 irc = (*pIf->ppIfI)->LowLatencyCreateBuffer(pIf->ppIfI, &pNew->pvFrames, GUEST_PAGE_SIZE, kUSBLowLatencyFrameListBuffer); 460 461 if ((irc == kIOReturnSuccess) != RT_VALID_PTR(pNew->pvFrames)) 461 462 { -
trunk/src/VBox/Devices/USB/testcase/tstOhciRegisterAccess.cpp
r93115 r93944 454 454 if (fDone) 455 455 { 456 for (int iWord = ( (uintptr_t)uPtr.pv &PAGE_OFFSET_MASK) == 0; iWord < 3; iWord++)456 for (int iWord = (uPtr.u & HOST_PAGE_OFFSET_MASK) == 0; iWord < 3; iWord++) 457 457 { 458 458 u32A = *uPtr.pu32; … … 483 483 if (fDone) 484 484 { 485 for (int iByte = ( (uintptr_t)uPtr.pv &PAGE_OFFSET_MASK) == 0 ? 0 : -3; iByte < 4; iByte++)485 for (int iByte = (uPtr.u & HOST_PAGE_OFFSET_MASK) == 0 ? 0 : -3; iByte < 4; iByte++) 486 486 { 487 487 u32A = *uPtr.pu32; … … 549 549 */ 550 550 RTR0MEMOBJ hMemObj; 551 int rc = RTR0MemObjEnterPhys(&hMemObj, HCPhysOHCI, PAGE_SIZE, RTMEM_CACHE_POLICY_MMIO);551 int rc = RTR0MemObjEnterPhys(&hMemObj, HCPhysOHCI, HOST_PAGE_SIZE, RTMEM_CACHE_POLICY_MMIO); 552 552 if (RT_FAILURE(rc)) 553 553 { -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r93115 r93944 4984 4984 * can handle interrupt acknowledge requests more timely (vmmdevFastRequestIrqAck). 4985 4985 */ 4986 rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VMMDevRAM, 0, PAGE_SIZE, (void **)&pThisCC->CTX_SUFF(pVMMDevRAM));4986 rc = PDMDevHlpMmio2SetUpContext(pDevIns, pThis->hMmio2VMMDevRAM, 0, GUEST_PAGE_SIZE, (void **)&pThisCC->CTX_SUFF(pVMMDevRAM)); 4987 4987 AssertRCReturn(rc, rc); 4988 4988 -
trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
r93931 r93944 681 681 if (pPtr->cPages == 1) 682 682 return true; 683 RTGCPHYS64 Phys = pPtr->paPages[0] + PAGE_SIZE;683 RTGCPHYS64 Phys = pPtr->paPages[0] + GUEST_PAGE_SIZE; 684 684 if (Phys != pPtr->paPages[1]) 685 685 return false; … … 689 689 do 690 690 { 691 Phys += PAGE_SIZE;691 Phys += GUEST_PAGE_SIZE; 692 692 if (Phys != pPtr->paPages[iPage]) 693 693 return false; … … 724 724 for (uint32_t iPage = 0; iPage < pPtr->cPages && cbRemaining > 0; ++iPage) 725 725 { 726 uint32_t cbToRead = PAGE_SIZE - offPage;726 uint32_t cbToRead = GUEST_PAGE_SIZE - offPage; 727 727 if (cbToRead > cbRemaining) 728 728 cbToRead = cbRemaining; … … 763 763 for (iPage = 0; iPage < pPtr->cPages && cbRemaining > 0; ++iPage) 764 764 { 765 uint32_t cbToWrite = PAGE_SIZE - offPage;765 uint32_t cbToWrite = GUEST_PAGE_SIZE - offPage; 766 766 if (cbToWrite > cbRemaining) 767 767 cbToWrite = cbRemaining; … … 1088 1088 ASSERT_GUEST_RETURN(cbData <= VMMDEV_MAX_HGCM_DATA_SIZE, VERR_INVALID_PARAMETER); 1089 1089 1090 const uint32_t offFirstPage = cbData > 0 ? GCPtr & PAGE_OFFSET_MASK : 0;1091 const uint32_t cPages = cbData > 0 ? (offFirstPage + cbData + PAGE_SIZE - 1) /PAGE_SIZE : 0;1090 const uint32_t offFirstPage = cbData > 0 ? GCPtr & GUEST_PAGE_OFFSET_MASK : 0; 1091 const uint32_t cPages = cbData > 0 ? (offFirstPage + cbData + GUEST_PAGE_SIZE - 1) / GUEST_PAGE_SIZE : 0; 1092 1092 1093 1093 pGuestParm->u.ptr.cbData = cbData; … … 1124 1124 1125 1125 pGuestParm->u.ptr.paPages[iPage] = GCPhys; 1126 GCPtr += PAGE_SIZE;1126 GCPtr += GUEST_PAGE_SIZE; 1127 1127 } 1128 1128 } … … 1169 1169 ("%#x\n", pPageListInfo->flags), VERR_INVALID_FLAGS); 1170 1170 /* First page offset. */ 1171 ASSERT_GUEST_MSG_RETURN(pPageListInfo->offFirstPage < PAGE_SIZE,1171 ASSERT_GUEST_MSG_RETURN(pPageListInfo->offFirstPage < GUEST_PAGE_SIZE, 1172 1172 ("%#x\n", pPageListInfo->offFirstPage), VERR_INVALID_PARAMETER); 1173 1173 … … 1177 1177 ASSERT_GUEST_MSG_RETURN( pPageListInfo->cPages 1178 1178 == (pGuestParm->enmType == VMMDevHGCMParmType_ContiguousPageList ? 1 1179 : RT_ALIGN_32(pPageListInfo->offFirstPage + cbData, PAGE_SIZE) >> PAGE_SHIFT) 1179 : RT_ALIGN_32(pPageListInfo->offFirstPage + cbData, GUEST_PAGE_SIZE) 1180 >> GUEST_PAGE_SHIFT) 1180 1181 || pGuestParm->enmType == VMMDevHGCMParmType_PageList, 1181 1182 ("offFirstPage=%#x cbData=%#x cPages=%#x enmType=%d\n", … … 1192 1193 { 1193 1194 /* Validate page offsets */ 1194 ASSERT_GUEST_MSG_RETURN( !(pPageListInfo->aPages[0] & PAGE_OFFSET_MASK)1195 || (pPageListInfo->aPages[0] & PAGE_OFFSET_MASK) == pPageListInfo->offFirstPage,1195 ASSERT_GUEST_MSG_RETURN( !(pPageListInfo->aPages[0] & GUEST_PAGE_OFFSET_MASK) 1196 || (pPageListInfo->aPages[0] & GUEST_PAGE_OFFSET_MASK) == pPageListInfo->offFirstPage, 1196 1197 ("%#RX64 offFirstPage=%#x\n", pPageListInfo->aPages[0], pPageListInfo->offFirstPage), 1197 1198 VERR_INVALID_POINTER); 1198 1199 uint32_t const cPages = pPageListInfo->cPages; 1199 1200 for (uint32_t iPage = 1; iPage < cPages; iPage++) 1200 ASSERT_GUEST_MSG_RETURN(!(pPageListInfo->aPages[iPage] & PAGE_OFFSET_MASK),1201 ASSERT_GUEST_MSG_RETURN(!(pPageListInfo->aPages[iPage] & GUEST_PAGE_OFFSET_MASK), 1201 1202 ("[%#zx]=%#RX64\n", iPage, pPageListInfo->aPages[iPage]), VERR_INVALID_POINTER); 1202 1203 RT_UNTRUSTED_VALIDATED_FENCE(); -
trunk/src/VBox/Devices/VirtIO/Virtio.cpp
r93115 r93944 47 47 static void vqueueInit(PVQUEUE pQueue, uint32_t uPageNumber) 48 48 { 49 pQueue->VRing.addrDescriptors = (uint64_t)uPageNumber << PAGE_SHIFT;49 pQueue->VRing.addrDescriptors = (uint64_t)uPageNumber << GUEST_PAGE_SHIFT; 50 50 pQueue->VRing.addrAvail = pQueue->VRing.addrDescriptors + sizeof(VRINGDESC) * pQueue->VRing.uSize; 51 51 pQueue->VRing.addrUsed = RT_ALIGN(pQueue->VRing.addrAvail + RT_UOFFSETOF_DYN(VRINGAVAIL, auRing[pQueue->VRing.uSize]), 52 PAGE_SIZE); /* The used ring must start from the next page. */52 GUEST_PAGE_SIZE); /* The used ring must start from the next page. */ 53 53 pQueue->uNextAvailIndex = 0; 54 54 pQueue->uNextUsedIndex = 0; -
trunk/src/VBox/Devices/VirtIO/VirtioCore.cpp
r93115 r93944 1597 1597 { 1598 1598 PVIRTQUEUE pVirtQueue = &pVirtio->aVirtqueues[uVirtq]; 1599 *pu32 = pVirtQueue->GCPhysVirtqDesc >> PAGE_SHIFT;1599 *pu32 = pVirtQueue->GCPhysVirtqDesc >> GUEST_PAGE_SHIFT; 1600 1600 Log(("%-23s: Guest read uVirtqPfn .................... %#x\n", __FUNCTION__, *pu32)); 1601 1601 } -
trunk/src/VBox/Devices/testcase/tstDeviceR0.cpp
r93115 r93944 48 48 49 49 50 /*********************************************************************************************************************************51 * Defined Constants And Macros *52 *********************************************************************************************************************************/53 54 55 /*********************************************************************************************************************************56 * Structures and Typedefs *57 *********************************************************************************************************************************/58 59 60 /*********************************************************************************************************************************61 * Global Variables *62 *********************************************************************************************************************************/63 64 65 /*********************************************************************************************************************************66 * Internal Functions *67 *********************************************************************************************************************************/68 50 69 51 /** … … 82 64 if (RT_LIKELY(pPdmDev)) 83 65 { 84 uint32_t const cbRing0 = RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSR0, achInstanceData) + pPdmDevR0->cbInstanceCC, PAGE_SIZE); 66 uint32_t const cbRing0 = RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSR0, achInstanceData) + pPdmDevR0->cbInstanceCC, 67 HOST_PAGE_SIZE); 85 68 uint32_t const cbRing3 = RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSR3, achInstanceData) + pPdmDev->pReg->cbInstanceCC, 86 fRCEnabled ? PAGE_SIZE : 64);69 fRCEnabled ? HOST_PAGE_SIZE : 64); 87 70 uint32_t const cbRC = fRCEnabled ? 0 88 71 : RT_ALIGN_32(RT_UOFFSETOF(PDMDEVINSRC, achInstanceData) + pPdmDevR0->cbInstanceRC, 64); … … 93 76 uint32_t const cPciDevs = RT_MIN(pPdmDev->pReg->cMaxPciDevices, 8); 94 77 uint32_t const cbPciDevs = cbPciDev * cPciDevs; 95 uint32_t const cbTotal = RT_ALIGN_32(cbRing0 + cbRing3 + cbRC + cbShared + cbCritSect + cbPciDevs, PAGE_SIZE);78 uint32_t const cbTotal = RT_ALIGN_32(cbRing0 + cbRing3 + cbRC + cbShared + cbCritSect + cbPciDevs, HOST_PAGE_SIZE); 96 79 AssertLogRelMsgReturn(cbTotal <= PDM_MAX_DEVICE_INSTANCE_SIZE, 97 80 ("Instance of '%s' is too big: cbTotal=%u, max %u\n", -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r93115 r93944 396 396 GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap); 397 397 GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[1]); 398 GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[(VGA_VRAM_MAX / PAGE_SIZE / 32) - 1]);398 GEN_CHECK_OFF(VGASTATE, au32DirtyBitmap[(VGA_VRAM_MAX / GUEST_PAGE_SIZE / 32) - 1]); 399 399 GEN_CHECK_OFF(VGASTATE, fHasDirtyBits); 400 400 GEN_CHECK_OFF(VGASTATE, fLFBUpdated);
Note:
See TracChangeset
for help on using the changeset viewer.

