VirtualBox

Changeset 100310 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Jun 28, 2023 10:26:46 AM (20 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158025
Message:

Runtime/r3/posix: Replace occurences of PAGE_SIZE/PAGE_OFFSET_MASK with RTSystemGetPageSize()/RTSystemGetPageOffsetMask() in code which is used by the linux.arm64 guest additions, bugref:10476

Location:
trunk/src/VBox/Runtime/r3/posix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/RTMemProtect-posix.cpp

    r98103 r100310  
    4444#include <iprt/errcore.h>
    4545#include <iprt/string.h>
     46#include <iprt/system.h>
    4647
    4748#include <errno.h>
     
    9394     * Align the request.
    9495     */
    95     cb += (uintptr_t)pv & PAGE_OFFSET_MASK;
    96     pv = (void *)((uintptr_t)pv & ~PAGE_OFFSET_MASK);
     96    cb += (uintptr_t)pv & RTSystemGetPageOffsetMask();
     97    pv = (void *)((uintptr_t)pv & ~RTSystemGetPageOffsetMask());
    9798
    9899    /*
  • trunk/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-posix.cpp

    r98103 r100310  
    4747#include <iprt/param.h>
    4848#include <iprt/string.h>
     49#include <iprt/system.h>
    4950
    5051#include <stdlib.h>
     
    106107    Assert(cb > 0);
    107108    NOREF(pszTag);
    108     cb = RT_ALIGN_Z(cb, PAGE_SIZE);
     109    cb = RTSystemPageAlignSize(cb);
    109110
    110111    /*
     
    143144    AssertPtr(pv);
    144145    Assert(cb > 0);
    145     Assert(!((uintptr_t)pv & PAGE_OFFSET_MASK));
    146     cb = RT_ALIGN_Z(cb, PAGE_SIZE);
     146    Assert(!((uintptr_t)pv & RTSystemGetPageOffsetMask()));
     147    cb = RTSystemPageAlignSize(cb);
    147148
    148149    /*
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