VirtualBox

Ignore:
Timestamp:
Nov 22, 2016 9:14:13 AM (8 years ago)
Author:
vboxsync
Message:

bs3-cpu-basic-2-pf: updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-pf.c32

    r64704 r64735  
    3030*********************************************************************************************************************************/
    3131#include <bs3kit.h>
    32 #include <iprt/asm-amd64-x86.h>
    3332
    3433
     
    3938
    4039
     40/**
     41 * Worker for bs3CpuBasic2_RaiseXcpt0e_c32 that does the actual testing.
     42 *
     43 * Caller does all the cleaning up.
     44 *
     45 * @returns Error count.
     46 * @param   bMode               The mode to test.
     47 * @param   pbTestOrg           Pointer to the actual memory allocation (low
     48 *                              memory) where it is identity mapped (virtual
     49 *                              address == physical address).  This function
     50 *                              will not touch paging structures here.
     51 * @param   pbTest              Pointer to the aliased allocation in high
     52 *                              memory.  This is aligned on a gigabyte boundrary
     53 *                              so that 1GB pages can be tested (later).
     54 * @param   cbTest              The size of the memory allocated for testing.
     55 * @param   pPgInfo             The paging info for @a pbTest.
     56 */
     57static uint8_t bs3CpuBasic2_RaiseXcpt0eWorker(uint8_t bMode, uint8_t *pbTestOrg, uint8_t *pbTest, uint32_t cbTest,
     58                                              PBS3PAGINGINFO4ADDR pPgInfo)
     59{
     60
     61
     62    return 0;
     63}
    4164
    4265
     
    4871    uint8_t    *pbTest;
    4972    uint8_t    *pbAlias;
     73    uint8_t     bRet = 1;
    5074    int         rc;
    5175
     
    5882    {
    5983        cbTestUnaligned >>= 1;
    60         if (cbTestUnaligned < _8K)
     84        if (cbTestUnaligned <= _8K)
    6185        {
    6286            Bs3TestFailed("Failed to allocate memory to play around with\n");
     
    79103     * Alias this memory far away from where our code and data lives.
    80104     */
    81     pbAlias = (uint8_t *)UINT32_C(0xa0000000);
     105    pbAlias = (uint8_t *)UINT32_C(0x80000000);
    82106    rc = Bs3PagingAlias((uintptr_t)pbAlias, (uintptr_t)pbTest, cbTest, X86_PTE_P | X86_PTE_RW | X86_PTE_US);
    83107    if (RT_SUCCESS(rc))
    84108    {
    85         void *pvPte = Bs3PagingGetPte((uintptr_t)pbAlias, NULL);
    86         if (pvPte)
     109        BS3PAGINGINFO4ADDR PgInfo;
     110        rc = Bs3PagingQueryAddressInfo((uintptr_t)pbTest, &PgInfo);
     111        if (RT_SUCCESS(rc))
    87112        {
    88             Bs3TestPrintf("RaiseXcpt0e_c32:  bMode=%#x/%#x cbTest=%#x pbTest=%p pbAlias=%p pvPte=%p\n",
    89                           bMode, g_bBs3CurrentMode, cbTest, pbTest, pbAlias, pvPte);
     113            /*
     114             * Setup a 16-bit selector for accessing the alias.
     115             */
     116            // ==> office //
     117
     118            Bs3TestPrintf("RaiseXcpt0e_c32:  bMode=%#x/%#x cbTest=%#x pbTest=%p pbAlias=%p\n",
     119                          bMode, g_bBs3CurrentMode, cbTest, pbTest, pbAlias);
     120            bRet = bs3CpuBasic2_RaiseXcpt0eWorker(bMode, pbTest, pbAlias, cbTest, &PgInfo);
    90121
    91122        }
    92123        else
    93             Bs3TestFailed("Bs3PagingGetPte failed!\n");
     124            Bs3TestFailedF("Bs3PagingQueryAddressInfo failed: %d\n", rc);
    94125        Bs3PagingUnalias((uintptr_t)pbAlias, cbTest);
    95126    }
     
    97128        Bs3TestFailedF("Bs3PagingAlias failed! rc=%d\n", rc);
    98129    Bs3MemFree(pvTestUnaligned, cbTestUnaligned);
    99     return 0;
     130    return bRet;
    100131}
    101132
    102 
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