VirtualBox

Ignore:
Timestamp:
Jun 5, 2024 9:38:20 AM (8 months ago)
Author:
vboxsync
Message:

VMM/PGM,SUPDrv,IPRT: Added a RTR0MemObjZeroInitialize function to IPRT/SUPDrv for helping zero initializing MMIO2 backing memory. bugref:10687

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c

    r100359 r104848  
    5050#include <iprt/param.h>
    5151#include <iprt/process.h>
     52#include <iprt/string.h>
    5253#include "internal/memobj.h"
    5354#include "memobj-r0drv-solaris.h"
     
    12131214}
    12141215
     1216
     1217DECLHIDDEN(int) rtR0MemObjNativeZeroInitWithoutMapping(PRTR0MEMOBJINTERNAL pMem)
     1218{
     1219    PRTR0MEMOBJSOL const pMemSolaris = (PRTR0MEMOBJSOL)pMem;
     1220    size_t const         cPages      = pMemSolaris->Core.cb >> PAGE_SHIFT;
     1221    size_t               iPage;
     1222    for (iPage = 0; iPage < cPages; iPage++)
     1223    {
     1224        void          *pvPage;
     1225
     1226        /* Get the physical address of the page. */
     1227        RTHCPHYS const HCPhys = rtR0MemObjNativeGetPagePhysAddr(&pMemSolaris->Core, iPage);
     1228        AssertReturn(HCPhys != NIL_RTHCPHYS, VERR_INTERNAL_ERROR_3);
     1229        Assert(!(HCPhys & PAGE_OFFSET_MASK));
     1230
     1231        /* Map it. */
     1232        HCPhys >>= PAGE_SHIFT;
     1233        AssertReturn(HCPhys <= physmax, VERR_INTERNAL_ERROR_3);
     1234        pvPage = hat_kpm_pfn2va(HCPhys);
     1235        AssertPtrReturn(pvPage, VERR_INTERNAL_ERROR_3);
     1236
     1237        /* Zero it. */
     1238        RT_BZERO(pvPage, PAGE_SIZE);
     1239    }
     1240    return VINF_SUCCESS;
     1241}
     1242
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette