Changeset 30072 in vbox for trunk/src/VBox/VMM/VMM.cpp
- Timestamp:
- Jun 7, 2010 1:54:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMM.cpp
r29902 r30072 1779 1779 * @param pVM Pointer to the shared VM structure. 1780 1780 * @param idCpu The ID of the source CPU context (for the address). 1781 * @param pAddressWhere to start reading.1781 * @param R0Addr Where to start reading. 1782 1782 * @param pvBuf Where to store the data we've read. 1783 1783 * @param cbRead The number of bytes to read. 1784 1784 */ 1785 VMMR3DECL(int) VMMR3ReadR0Stack(PVM pVM, VMCPUID idCpu, RTHCUINTPTR pAddress, void *pvBuf, size_t cbRead)1786 { 1787 PVMCPU pVCpu= VMMGetCpuById(pVM, idCpu);1785 VMMR3DECL(int) VMMR3ReadR0Stack(PVM pVM, VMCPUID idCpu, RTHCUINTPTR R0Addr, void *pvBuf, size_t cbRead) 1786 { 1787 PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu); 1788 1788 AssertReturn(pVCpu, VERR_INVALID_PARAMETER); 1789 1789 1790 RTHCUINTPTR offset = pVCpu->vmm.s.CallRing3JmpBufR0.SpCheck - pAddress; 1791 if (offset >= pVCpu->vmm.s.CallRing3JmpBufR0.cbSavedStack) 1790 #ifdef VMM_R0_SWITCH_STACK 1791 RTHCUINTPTR off = R0Addr - MMHyperCCToR0(pVM, pVCpu->vmm.s.pbEMTStackR3); 1792 #else 1793 RTHCUINTPTR off = pVCpu->vmm.s.CallRing3JmpBufR0.cbSavedStack - (pVCpu->vmm.s.CallRing3JmpBufR0.SpCheck - R0Addr); 1794 #endif 1795 if ( off > VMM_STACK_SIZE 1796 || off + cbRead >= VMM_STACK_SIZE) 1792 1797 return VERR_INVALID_POINTER; 1793 1798 1794 memcpy(pvBuf, pVCpu->vmm.s.pbEMTStackR3 + pVCpu->vmm.s.CallRing3JmpBufR0.cbSavedStack - offset, cbRead);1799 memcpy(pvBuf, &pVCpu->vmm.s.pbEMTStackR3[off], cbRead); 1795 1800 return VINF_SUCCESS; 1796 1801 } … … 2127 2132 #else 2128 2133 pVCpu->vmm.s.CallRing3JmpBufR0.rip = 0; 2134 #endif 2135 #ifdef VMM_R0_SWITCH_STACK 2136 *(uint64_t *)pVCpu->vmm.s.pbEMTStackR3 = 0; /* clear marker */ 2129 2137 #endif 2130 2138 LogRel((pVM->vmm.s.szRing0AssertMsg1));
Note:
See TracChangeset
for help on using the changeset viewer.