VirtualBox

Ignore:
Timestamp:
Feb 24, 2022 9:15:14 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150173
Message:

Devices: Must not use PAGE_SIZE, PAGE_SHIFT, PAGE_OFFSET_MASK, PAGE_ADDRESS or PHYS_PAGE_ADDRESS here either. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp

    r93115 r93944  
    159159    /* DrvAudioHlpClearBuf: */
    160160    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);
    162162    RTTESTI_CHECK_RC_OK_RETV(rc);
    163163
    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)
    171171        RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1]));
    172172
    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)
    176176        RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80);
    177177
    178178
    179179    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)
    187187        RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1]));
    188188
    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)
    192192        RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80);
    193193    RTTestRestoreAssertions(hTest);
Note: See TracChangeset for help on using the changeset viewer.

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