VirtualBox

Changeset 46217 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 22, 2013 1:02:37 PM (12 years ago)
Author:
vboxsync
Message:

Fixed the 'r', 'rg' and 'rg32' commands in 64-bit guest code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp

    r44529 r46217  
    7171
    7272/**
     73 * Wrapper around CPUMIsGuestIn64BitCode.
     74 *
     75 * @returns VINF_SUCCESS.
     76 * @param   pVM             Pointer to the VM.
     77 * @param   idCpu           The current CPU ID.
     78 * @param   pfIn64BitCode   Where to return the result.
     79 */
     80static DECLCALLBACK(int) dbgfR3CpuIn64BitCode(PVM pVM, VMCPUID idCpu, bool *pfIn64BitCode)
     81{
     82    Assert(idCpu == VMMGetCpuId(pVM));
     83    PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
     84    *pfIn64BitCode = CPUMIsGuestIn64BitCode(pVCpu);
     85    return VINF_SUCCESS;
     86}
     87
     88
     89/**
     90 * Checks if the given CPU is executing 64-bit code or not.
     91 *
     92 * @returns true / false accordingly.
     93 * @param   pUVM        The user mode VM handle.
     94 * @param   idCpu       The target CPU ID.
     95 */
     96VMMR3DECL(bool) DBGFR3CpuIsIn64BitCode(PUVM pUVM, VMCPUID idCpu)
     97{
     98    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     99    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, false);
     100    AssertReturn(idCpu < pUVM->pVM->cCpus, false);
     101
     102    CPUMMODE fIn64BitCode;
     103    int rc = VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3CpuIn64BitCode, 3, pUVM->pVM, idCpu, &fIn64BitCode);
     104    if (RT_FAILURE(rc))
     105        return false;
     106    return fIn64BitCode;
     107}
     108
     109
     110/**
    73111 * Get the number of CPUs (or threads if you insist).
    74112 *
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