VirtualBox

Changeset 847 in vbox for trunk/src/VBox/VMM/VMMGC/VMMGC.cpp


Ignore:
Timestamp:
Feb 12, 2007 1:46:39 PM (18 years ago)
Author:
vboxsync
Message:

Interrupt masking testcase. (attempt at debugging amd64 issue)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMGC/VMMGC.cpp

    r421 r847  
    2828#include "VMMInternal.h"
    2929#include <VBox/vm.h>
     30#include <VBox/sup.h>
    3031#include <VBox/err.h>
    3132#include <VBox/log.h>
     
    9495
    9596        /*
     97         * Delay for ~100us.
     98         */
     99        case VMMGC_DO_TESTCASE_INTERRUPT_MASKING:
     100        {
     101            uint64_t u64MaxTicks = (g_pSUPGlobalInfoPage ? g_pSUPGlobalInfoPage->u64CpuHz : _2G) / 10000;
     102            uint64_t u64StartTSC = ASMReadTSC();
     103            uint64_t u64TicksNow;
     104            uint32_t volatile i = 0;
     105
     106            do
     107            {
     108                /* waste some time and protect against getting stuck. */
     109                for (uint32_t volatile j = 0; j < 1000; j++, i++)
     110                    if (i > _2G32)
     111                        return VERR_GENERAL_FAILURE;
     112
     113                /* check if we're done.*/
     114                u64TicksNow = ASMReadTSC() - u64StartTSC;
     115            } while (u64TicksNow < u64MaxTicks);
     116
     117            return VINF_SUCCESS;
     118        }
     119
     120        /*
    96121         * Trap testcases and unknown operations.
    97122         */
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