VirtualBox

Changeset 41680 in vbox


Ignore:
Timestamp:
Jun 13, 2012 11:19:56 AM (13 years ago)
Author:
vboxsync
Message:

Runtime/r0drv/solaris: cleanup.

File:
1 edited

Legend:

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

    r41652 r41680  
    135135 * @param virtAddr       The virtual address to which this page maybe mapped in
    136136 *                       the future.
    137  * @param cbPage         The size of the page.
    138137 *
    139138 * @returns Pointer to the allocated page, NULL on failure.
    140139 */
    141 static page_t *rtR0MemObjSolPageAlloc(caddr_t virtAddr, size_t cbPage)
    142 {
    143     Assert(cbPage == PAGE_SIZE);
    144 
    145     u_offset_t offPage;
    146     seg_t      KernelSeg;
     140static page_t *rtR0MemObjSolPageAlloc(caddr_t virtAddr)
     141{
     142    u_offset_t      offPage;
     143    seg_t           KernelSeg;
    147144
    148145    mutex_enter(&g_OffsetMtx);
    149146    AssertCompileSize(u_offset_t, sizeof(uint64_t)); NOREF(RTASSERTVAR);
    150     g_offPage = RT_ALIGN_64(g_offPage, cbPage) + cbPage;
     147    g_offPage = RT_ALIGN_64(g_offPage, PAGE_SIZE) + PAGE_SIZE;
    151148    offPage   = g_offPage;
    152149    mutex_exit(&g_OffsetMtx);
    153150
    154151    KernelSeg.s_as = &kas;
    155     page_t *pPage = page_create_va(&g_PageVnode, offPage, cbPage, PG_WAIT | PG_NORELOC, &KernelSeg, virtAddr);
     152    page_t *pPage = page_create_va(&g_PageVnode, offPage, PAGE_SIZE, PG_WAIT | PG_NORELOC, &KernelSeg, virtAddr);
    156153    if (RT_LIKELY(pPage))
    157154    {
    158155        /*
    159          * Lock this page into memory "long term" to prevent paging out of this page
     156         * Lock this page into memory "long term" to prevent this page from being paged out
    160157         * when we drop the page lock temporarily (during free).
    161158         */
     
    214211                 * from being relocated.
    215212                 */
    216                 page_t *pPage = rtR0MemObjSolPageAlloc(virtAddr, PAGE_SIZE);
     213                page_t *pPage = rtR0MemObjSolPageAlloc(virtAddr);
    217214                if (RT_UNLIKELY(!pPage))
    218215                {
    219216                    /*
    220                      * No pages found or found pages didn't meet requirements, release what was grabbed so far.
     217                     * No page found, release whatever pages we grabbed so far.
    221218                     */
    222219                    for (size_t k = 0; k < i; k++)
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