Changeset 68009 in vbox
- Timestamp:
- Jul 17, 2017 5:17:59 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/gvmm.h
r68001 r68009 168 168 GVMMR0DECL(PGVM) GVMMR0ByHandle(uint32_t hGVM); 169 169 GVMMR0DECL(int) GVMMR0ByVM(PVM pVM, PGVM *ppGVM); 170 GVMMR0DECL(int) GVMMR0ByVMAndEMT(PVM pVM, VMCPUID idCpu, PGVM *ppGVM);171 170 GVMMR0DECL(int) GVMMR0ValidateGVMandVM(PGVM pGVM, PVM pVM); 172 171 GVMMR0DECL(int) GVMMR0ValidateGVMandVMandEMT(PGVM pGVM, PVM pVM, VMCPUID idCpu); 173 GVMMR0DECL(PVM) GVMMR0GetVMByHandle(uint32_t hGVM);174 172 GVMMR0DECL(PVM) GVMMR0GetVMByEMT(RTNATIVETHREAD hEMT); 175 173 GVMMR0DECL(int) GVMMR0SchedHalt(PGVM pGVM, PVM pVM, VMCPUID idCpu, uint64_t u64ExpireGipTime); -
trunk/include/VBox/vmm/pdmapi.h
r64663 r68009 208 208 typedef PDMDRIVERCALLREQHANDLERREQ *PPDMDRIVERCALLREQHANDLERREQ; 209 209 210 VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(P VM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq);210 VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PGVM pGVM, PVM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq); 211 211 212 212 /** … … 233 233 typedef PDMDEVICECALLREQHANDLERREQ *PPDMDEVICECALLREQHANDLERREQ; 234 234 235 VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(P VM pVM, PPDMDEVICECALLREQHANDLERREQ pReq);235 VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(PGVM pGVM, PVM pVM, PPDMDEVICECALLREQHANDLERREQ pReq); 236 236 237 237 /** @} */ -
trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp
r68007 r68009 1914 1914 1915 1915 /** 1916 * Lookup a GVM structure by the shared VM structure1917 * and ensuring that the caller is the EMT thread.1918 *1919 * @returns VBox status code.1920 * @param pVM The cross context VM structure.1921 * @param idCpu The Virtual CPU ID of the calling EMT.1922 * @param ppGVM Where to store the GVM pointer.1923 * @thread EMT(idCpu)1924 */1925 GVMMR0DECL(int) GVMMR0ByVMAndEMT(PVM pVM, VMCPUID idCpu, PGVM *ppGVM)1926 {1927 AssertPtrReturn(ppGVM, VERR_INVALID_POINTER);1928 PGVMM pGVMM;1929 return gvmmR0ByVMAndEMT(pVM, idCpu, ppGVM, &pGVMM);1930 }1931 1932 1933 /**1934 * Lookup a VM by its global handle.1935 *1936 * @returns Pointer to the VM on success, NULL on failure.1937 * @param hGVM The global VM handle. Asserts on bad handle.1938 */1939 GVMMR0DECL(PVM) GVMMR0GetVMByHandle(uint32_t hGVM)1940 {1941 PGVM pGVM = GVMMR0ByHandle(hGVM);1942 return pGVM ? pGVM->pVM : NULL;1943 }1944 1945 1946 /**1947 1916 * Looks up the VM belonging to the specified EMT thread. 1948 1917 * -
trunk/src/VBox/VMM/VMMR0/PDMR0Device.cpp
r65338 r68009 821 821 * 822 822 * @returns See PFNPDMDEVREQHANDLERR0. 823 * @param pGVM The global (ring-0) VM structure. (For validation.) 823 824 * @param pVM The cross context VM structure. (For validation.) 824 825 * @param pReq Pointer to the request buffer. 825 826 */ 826 VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(P VM pVM, PPDMDEVICECALLREQHANDLERREQ pReq)827 VMMR0_INT_DECL(int) PDMR0DeviceCallReqHandler(PGVM pGVM, PVM pVM, PPDMDEVICECALLREQHANDLERREQ pReq) 827 828 { 828 829 /* 829 830 * Validate input and make the call. 830 831 */ 831 AssertPtrReturn(pVM, VERR_INVALID_POINTER); 832 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 833 AssertMsgReturn(pReq->Hdr.cbReq == sizeof(*pReq), ("%#x != %#x\n", pReq->Hdr.cbReq, sizeof(*pReq)), VERR_INVALID_PARAMETER); 834 835 PPDMDEVINS pDevIns = pReq->pDevInsR0; 836 AssertPtrReturn(pDevIns, VERR_INVALID_POINTER); 837 AssertReturn(pDevIns->Internal.s.pVMR0 == pVM, VERR_INVALID_PARAMETER); 838 839 PFNPDMDEVREQHANDLERR0 pfnReqHandlerR0 = pReq->pfnReqHandlerR0; 840 AssertPtrReturn(pfnReqHandlerR0, VERR_INVALID_POINTER); 841 842 return pfnReqHandlerR0(pDevIns, pReq->uOperation, pReq->u64Arg); 843 } 844 832 int rc = GVMMR0ValidateGVMandVM(pGVM, pVM); 833 if (RT_SUCCESS(rc)) 834 { 835 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 836 AssertMsgReturn(pReq->Hdr.cbReq == sizeof(*pReq), ("%#x != %#x\n", pReq->Hdr.cbReq, sizeof(*pReq)), VERR_INVALID_PARAMETER); 837 838 PPDMDEVINS pDevIns = pReq->pDevInsR0; 839 AssertPtrReturn(pDevIns, VERR_INVALID_POINTER); 840 AssertReturn(pDevIns->Internal.s.pVMR0 == pVM, VERR_INVALID_PARAMETER); 841 842 PFNPDMDEVREQHANDLERR0 pfnReqHandlerR0 = pReq->pfnReqHandlerR0; 843 AssertPtrReturn(pfnReqHandlerR0, VERR_INVALID_POINTER); 844 845 rc = pfnReqHandlerR0(pDevIns, pReq->uOperation, pReq->u64Arg); 846 } 847 return rc; 848 } 849 -
trunk/src/VBox/VMM/VMMR0/PDMR0Driver.cpp
r62478 r68009 24 24 #include <VBox/vmm/pdm.h> 25 25 #include <VBox/vmm/vm.h> 26 #include <VBox/vmm/gvmm.h> 26 27 27 28 #include <VBox/log.h> … … 35 36 * 36 37 * @returns See PFNPDMDRVREQHANDLERR0. 38 * @param pGVM The global (ring-0) VM structure. (For validation.) 37 39 * @param pVM The cross context VM structure. (For validation.) 38 40 * @param pReq Pointer to the request buffer. 39 41 */ 40 VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(P VM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq)42 VMMR0_INT_DECL(int) PDMR0DriverCallReqHandler(PGVM pGVM, PVM pVM, PPDMDRIVERCALLREQHANDLERREQ pReq) 41 43 { 42 44 /* 43 45 * Validate input and make the call. 44 46 */ 45 AssertPtrReturn(pVM, VERR_INVALID_POINTER); 46 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 47 AssertMsgReturn(pReq->Hdr.cbReq == sizeof(*pReq), ("%#x != %#x\n", pReq->Hdr.cbReq, sizeof(*pReq)), VERR_INVALID_PARAMETER); 47 int rc = GVMMR0ValidateGVMandVM(pGVM, pVM); 48 if (RT_SUCCESS(rc)) 49 { 50 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 51 AssertMsgReturn(pReq->Hdr.cbReq == sizeof(*pReq), ("%#x != %#x\n", pReq->Hdr.cbReq, sizeof(*pReq)), VERR_INVALID_PARAMETER); 48 52 49 PPDMDRVINS pDrvIns = pReq->pDrvInsR0;50 AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);51 AssertReturn(pDrvIns->Internal.s.pVMR0 == pVM, VERR_INVALID_PARAMETER);53 PPDMDRVINS pDrvIns = pReq->pDrvInsR0; 54 AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER); 55 AssertReturn(pDrvIns->Internal.s.pVMR0 == pVM, VERR_INVALID_PARAMETER); 52 56 53 PFNPDMDRVREQHANDLERR0 pfnReqHandlerR0 = pDrvIns->Internal.s.pfnReqHandlerR0;54 AssertPtrReturn(pfnReqHandlerR0, VERR_INVALID_POINTER);57 PFNPDMDRVREQHANDLERR0 pfnReqHandlerR0 = pDrvIns->Internal.s.pfnReqHandlerR0; 58 AssertPtrReturn(pfnReqHandlerR0, VERR_INVALID_POINTER); 55 59 56 return pfnReqHandlerR0(pDrvIns, pReq->uOperation, pReq->u64Arg); 60 rc = pfnReqHandlerR0(pDrvIns, pReq->uOperation, pReq->u64Arg); 61 } 62 return rc; 57 63 } 58 64 -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r68007 r68009 1806 1806 case VMMR0_DO_GCFGM_QUERY_VALUE: 1807 1807 { 1808 if (p VM || !pReqHdr || u64Arg || idCpu != NIL_VMCPUID)1808 if (pGVM || pVM || !pReqHdr || u64Arg || idCpu != NIL_VMCPUID) 1809 1809 return VERR_INVALID_PARAMETER; 1810 1810 PGCFGMVALUEREQ pReq = (PGCFGMVALUEREQ)pReqHdr; … … 1832 1832 case VMMR0_DO_PDM_DRIVER_CALL_REQ_HANDLER: 1833 1833 { 1834 if (!p VM || !pReqHdr || u64Arg || idCpu != NIL_VMCPUID)1835 return VERR_INVALID_PARAMETER; 1836 rc = PDMR0DriverCallReqHandler(p VM, (PPDMDRIVERCALLREQHANDLERREQ)pReqHdr);1834 if (!pReqHdr || u64Arg || idCpu != NIL_VMCPUID) 1835 return VERR_INVALID_PARAMETER; 1836 rc = PDMR0DriverCallReqHandler(pGVM, pVM, (PPDMDRIVERCALLREQHANDLERREQ)pReqHdr); 1837 1837 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1838 1838 break; … … 1841 1841 case VMMR0_DO_PDM_DEVICE_CALL_REQ_HANDLER: 1842 1842 { 1843 if (!p VM || !pReqHdr || u64Arg || idCpu != NIL_VMCPUID)1844 return VERR_INVALID_PARAMETER; 1845 rc = PDMR0DeviceCallReqHandler(p VM, (PPDMDEVICECALLREQHANDLERREQ)pReqHdr);1843 if (!pReqHdr || u64Arg || idCpu != NIL_VMCPUID) 1844 return VERR_INVALID_PARAMETER; 1845 rc = PDMR0DeviceCallReqHandler(pGVM, pVM, (PPDMDEVICECALLREQHANDLERREQ)pReqHdr); 1846 1846 VMM_CHECK_SMAP_CHECK2(pVM, RT_NOTHING); 1847 1847 break;
Note:
See TracChangeset
for help on using the changeset viewer.