Changeset 91887 in vbox
- Timestamp:
- Oct 20, 2021 12:02:36 PM (3 years ago)
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r91548 r91887 3957 3957 { 3958 3958 RT_NOREF(uPass); 3959 PVMMDEV pThis = PDMDEVINS_2_DATA(pDevIns, PVMMDEV); 3960 3961 SSMR3PutBool(pSSM, pThis->fGetHostTimeDisabled); 3962 SSMR3PutBool(pSSM, pThis->fBackdoorLogDisabled); 3963 SSMR3PutBool(pSSM, pThis->fKeepCredentials); 3964 SSMR3PutBool(pSSM, pThis->fHeapEnabled); 3959 PVMMDEV pThis = PDMDEVINS_2_DATA(pDevIns, PVMMDEV); 3960 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 3961 3962 pHlp->pfnSSMPutBool(pSSM, pThis->fGetHostTimeDisabled); 3963 pHlp->pfnSSMPutBool(pSSM, pThis->fBackdoorLogDisabled); 3964 pHlp->pfnSSMPutBool(pSSM, pThis->fKeepCredentials); 3965 pHlp->pfnSSMPutBool(pSSM, pThis->fHeapEnabled); 3965 3966 3966 3967 return VINF_SSM_DONT_CALL_AGAIN; -
trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
r90447 r91887 1945 1945 int vmmdevR3HgcmSaveState(PVMMDEVCC pThisCC, PSSMHANDLE pSSM) 1946 1946 { 1947 PCPDMDEVHLPR3 pHlp = pThisCC->pDevIns->pHlpR3; 1948 1947 1949 LogFlowFunc(("\n")); 1948 1950 … … 1958 1960 1959 1961 /* Save number of commands. */ 1960 int rc = SSMR3PutU32(pSSM, cCmds);1962 int rc = pHlp->pfnSSMPutU32(pSSM, cCmds); 1961 1963 AssertRCReturn(rc, rc); 1962 1964 … … 1969 1971 /** @todo Don't save cancelled requests! It serves no purpose. See restore and 1970 1972 * @bugref{4032#c4} for details. */ 1971 SSMR3PutU32 (pSSM, (uint32_t)pCmd->enmCmdType);1972 SSMR3PutBool (pSSM, pCmd->fCancelled);1973 SSMR3PutGCPhys (pSSM, pCmd->GCPhys);1974 SSMR3PutU32 (pSSM, pCmd->cbRequest);1975 SSMR3PutU32 (pSSM, (uint32_t)pCmd->enmRequestType);1973 pHlp->pfnSSMPutU32 (pSSM, (uint32_t)pCmd->enmCmdType); 1974 pHlp->pfnSSMPutBool (pSSM, pCmd->fCancelled); 1975 pHlp->pfnSSMPutGCPhys (pSSM, pCmd->GCPhys); 1976 pHlp->pfnSSMPutU32 (pSSM, pCmd->cbRequest); 1977 pHlp->pfnSSMPutU32 (pSSM, (uint32_t)pCmd->enmRequestType); 1976 1978 const uint32_t cParms = pCmd->enmCmdType == VBOXHGCMCMDTYPE_CALL ? pCmd->u.call.cParms : 0; 1977 rc = SSMR3PutU32(pSSM, cParms);1979 rc = pHlp->pfnSSMPutU32(pSSM, cParms); 1978 1980 AssertRCReturn(rc, rc); 1979 1981 1980 1982 if (pCmd->enmCmdType == VBOXHGCMCMDTYPE_CALL) 1981 1983 { 1982 SSMR3PutU32 (pSSM, pCmd->u.call.u32ClientID);1983 rc = SSMR3PutU32(pSSM, pCmd->u.call.u32Function);1984 pHlp->pfnSSMPutU32 (pSSM, pCmd->u.call.u32ClientID); 1985 rc = pHlp->pfnSSMPutU32(pSSM, pCmd->u.call.u32Function); 1984 1986 AssertRCReturn(rc, rc); 1985 1987 … … 1990 1992 VBOXHGCMGUESTPARM * const pGuestParm = &pCmd->u.call.paGuestParms[i]; 1991 1993 1992 rc = SSMR3PutU32(pSSM, (uint32_t)pGuestParm->enmType);1994 rc = pHlp->pfnSSMPutU32(pSSM, (uint32_t)pGuestParm->enmType); 1993 1995 AssertRCReturn(rc, rc); 1994 1996 … … 1997 1999 { 1998 2000 const VBOXHGCMPARMVAL * const pVal = &pGuestParm->u.val; 1999 SSMR3PutU64 (pSSM, pVal->u64Value);2000 SSMR3PutU32 (pSSM, pVal->offValue);2001 rc = SSMR3PutU32(pSSM, pVal->cbValue);2001 pHlp->pfnSSMPutU64 (pSSM, pVal->u64Value); 2002 pHlp->pfnSSMPutU32 (pSSM, pVal->offValue); 2003 rc = pHlp->pfnSSMPutU32(pSSM, pVal->cbValue); 2002 2004 } 2003 2005 else if ( pGuestParm->enmType == VMMDevHGCMParmType_LinAddr_In … … 2009 2011 { 2010 2012 const VBOXHGCMPARMPTR * const pPtr = &pGuestParm->u.ptr; 2011 SSMR3PutU32 (pSSM, pPtr->cbData);2012 SSMR3PutU32 (pSSM, pPtr->offFirstPage);2013 SSMR3PutU32 (pSSM, pPtr->cPages);2014 rc = SSMR3PutU32(pSSM, pPtr->fu32Direction);2013 pHlp->pfnSSMPutU32 (pSSM, pPtr->cbData); 2014 pHlp->pfnSSMPutU32 (pSSM, pPtr->offFirstPage); 2015 pHlp->pfnSSMPutU32 (pSSM, pPtr->cPages); 2016 rc = pHlp->pfnSSMPutU32(pSSM, pPtr->fu32Direction); 2015 2017 2016 2018 uint32_t iPage; 2017 2019 for (iPage = 0; RT_SUCCESS(rc) && iPage < pPtr->cPages; ++iPage) 2018 rc = SSMR3PutGCPhys(pSSM, pPtr->paPages[iPage]);2020 rc = pHlp->pfnSSMPutGCPhys(pSSM, pPtr->paPages[iPage]); 2019 2021 } 2020 2022 else if (pGuestParm->enmType == VMMDevHGCMParmType_NoBouncePageList) … … 2033 2035 else if (pCmd->enmCmdType == VBOXHGCMCMDTYPE_CONNECT) 2034 2036 { 2035 SSMR3PutU32(pSSM, pCmd->u.connect.u32ClientID);2036 SSMR3PutMem(pSSM, pCmd->u.connect.pLoc, sizeof(*pCmd->u.connect.pLoc));2037 pHlp->pfnSSMPutU32(pSSM, pCmd->u.connect.u32ClientID); 2038 pHlp->pfnSSMPutMem(pSSM, pCmd->u.connect.pLoc, sizeof(*pCmd->u.connect.pLoc)); 2037 2039 } 2038 2040 else if (pCmd->enmCmdType == VBOXHGCMCMDTYPE_DISCONNECT) 2039 2041 { 2040 SSMR3PutU32(pSSM, pCmd->u.disconnect.u32ClientID);2042 pHlp->pfnSSMPutU32(pSSM, pCmd->u.disconnect.u32ClientID); 2041 2043 } 2042 2044 else … … 2046 2048 2047 2049 /* A reserved field, will allow to extend saved data for a command. */ 2048 rc = SSMR3PutU32(pSSM, 0);2050 rc = pHlp->pfnSSMPutU32(pSSM, 0); 2049 2051 AssertRCReturn(rc, rc); 2050 2052 } … … 2052 2054 2053 2055 /* A reserved field, will allow to extend saved data for VMMDevHGCM. */ 2054 rc = SSMR3PutU32(pSSM, 0);2056 rc = pHlp->pfnSSMPutU32(pSSM, 0); 2055 2057 AssertRCReturn(rc, rc); 2056 2058 … … 2075 2077 int vmmdevR3HgcmLoadState(PPDMDEVINS pDevIns, PVMMDEV pThis, PVMMDEVCC pThisCC, PSSMHANDLE pSSM, uint32_t uVersion) 2076 2078 { 2079 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 2080 2077 2081 LogFlowFunc(("\n")); 2078 2082 … … 2081 2085 /* Read how many commands were pending. */ 2082 2086 uint32_t cCmds = 0; 2083 int rc = SSMR3GetU32(pSSM, &cCmds);2087 int rc = pHlp->pfnSSMGetU32(pSSM, &cCmds); 2084 2088 AssertRCReturn(rc, rc); 2085 2089 … … 2102 2106 uint32_t cParms; 2103 2107 2104 SSMR3GetU32 (pSSM, &u32);2108 pHlp->pfnSSMGetU32 (pSSM, &u32); 2105 2109 enmCmdType = (VBOXHGCMCMDTYPE)u32; 2106 SSMR3GetBool (pSSM, &fCancelled);2107 SSMR3GetGCPhys (pSSM, &GCPhys);2108 SSMR3GetU32 (pSSM, &cbRequest);2109 SSMR3GetU32 (pSSM, &u32);2110 pHlp->pfnSSMGetBool (pSSM, &fCancelled); 2111 pHlp->pfnSSMGetGCPhys (pSSM, &GCPhys); 2112 pHlp->pfnSSMGetU32 (pSSM, &cbRequest); 2113 pHlp->pfnSSMGetU32 (pSSM, &u32); 2110 2114 enmRequestType = (VMMDevRequestType)u32; 2111 rc = SSMR3GetU32(pSSM, &cParms);2115 rc = pHlp->pfnSSMGetU32(pSSM, &cParms); 2112 2116 AssertRCReturn(rc, rc); 2113 2117 … … 2122 2126 if (enmCmdType == VBOXHGCMCMDTYPE_CALL) 2123 2127 { 2124 SSMR3GetU32 (pSSM, &pCmd->u.call.u32ClientID);2125 rc = SSMR3GetU32(pSSM, &pCmd->u.call.u32Function);2128 pHlp->pfnSSMGetU32 (pSSM, &pCmd->u.call.u32ClientID); 2129 rc = pHlp->pfnSSMGetU32(pSSM, &pCmd->u.call.u32Function); 2126 2130 AssertRCReturn(rc, rc); 2127 2131 … … 2132 2136 VBOXHGCMGUESTPARM * const pGuestParm = &pCmd->u.call.paGuestParms[i]; 2133 2137 2134 rc = SSMR3GetU32(pSSM, &u32);2138 rc = pHlp->pfnSSMGetU32(pSSM, &u32); 2135 2139 AssertRCReturn(rc, rc); 2136 2140 pGuestParm->enmType = (HGCMFunctionParameterType)u32; … … 2140 2144 { 2141 2145 VBOXHGCMPARMVAL * const pVal = &pGuestParm->u.val; 2142 SSMR3GetU64 (pSSM, &pVal->u64Value);2143 SSMR3GetU32 (pSSM, &pVal->offValue);2144 rc = SSMR3GetU32(pSSM, &pVal->cbValue);2146 pHlp->pfnSSMGetU64 (pSSM, &pVal->u64Value); 2147 pHlp->pfnSSMGetU32 (pSSM, &pVal->offValue); 2148 rc = pHlp->pfnSSMGetU32(pSSM, &pVal->cbValue); 2145 2149 } 2146 2150 else if ( pGuestParm->enmType == VMMDevHGCMParmType_LinAddr_In … … 2152 2156 { 2153 2157 VBOXHGCMPARMPTR * const pPtr = &pGuestParm->u.ptr; 2154 SSMR3GetU32 (pSSM, &pPtr->cbData);2155 SSMR3GetU32 (pSSM, &pPtr->offFirstPage);2156 SSMR3GetU32 (pSSM, &pPtr->cPages);2157 rc = SSMR3GetU32(pSSM, &pPtr->fu32Direction);2158 pHlp->pfnSSMGetU32 (pSSM, &pPtr->cbData); 2159 pHlp->pfnSSMGetU32 (pSSM, &pPtr->offFirstPage); 2160 pHlp->pfnSSMGetU32 (pSSM, &pPtr->cPages); 2161 rc = pHlp->pfnSSMGetU32(pSSM, &pPtr->fu32Direction); 2158 2162 if (RT_SUCCESS(rc)) 2159 2163 { … … 2173 2177 uint32_t iPage; 2174 2178 for (iPage = 0; iPage < pPtr->cPages; ++iPage) 2175 rc = SSMR3GetGCPhys(pSSM, &pPtr->paPages[iPage]);2179 rc = pHlp->pfnSSMGetGCPhys(pSSM, &pPtr->paPages[iPage]); 2176 2180 } 2177 2181 } … … 2191 2195 else if (enmCmdType == VBOXHGCMCMDTYPE_CONNECT) 2192 2196 { 2193 SSMR3GetU32(pSSM, &pCmd->u.connect.u32ClientID);2194 rc = SSMR3GetMem(pSSM, pCmd->u.connect.pLoc, sizeof(*pCmd->u.connect.pLoc));2197 pHlp->pfnSSMGetU32(pSSM, &pCmd->u.connect.u32ClientID); 2198 rc = pHlp->pfnSSMGetMem(pSSM, pCmd->u.connect.pLoc, sizeof(*pCmd->u.connect.pLoc)); 2195 2199 AssertRCReturn(rc, rc); 2196 2200 } 2197 2201 else if (enmCmdType == VBOXHGCMCMDTYPE_DISCONNECT) 2198 2202 { 2199 rc = SSMR3GetU32(pSSM, &pCmd->u.disconnect.u32ClientID);2203 rc = pHlp->pfnSSMGetU32(pSSM, &pCmd->u.disconnect.u32ClientID); 2200 2204 AssertRCReturn(rc, rc); 2201 2205 } … … 2206 2210 2207 2211 /* A reserved field, will allow to extend saved data for a command. */ 2208 rc = SSMR3GetU32(pSSM, &u32);2212 rc = pHlp->pfnSSMGetU32(pSSM, &u32); 2209 2213 AssertRCReturn(rc, rc); 2210 2214 … … 2230 2234 2231 2235 /* A reserved field, will allow to extend saved data for VMMDevHGCM. */ 2232 rc = SSMR3GetU32(pSSM, &u32);2236 rc = pHlp->pfnSSMGetU32(pSSM, &u32); 2233 2237 AssertRCReturn(rc, rc); 2234 2238 } … … 2247 2251 uint32_t cLinAddrs; 2248 2252 2249 SSMR3GetGCPhys (pSSM, &GCPhys);2250 rc = SSMR3GetU32(pSSM, &cbRequest);2253 pHlp->pfnSSMGetGCPhys (pSSM, &GCPhys); 2254 rc = pHlp->pfnSSMGetU32(pSSM, &cbRequest); 2251 2255 AssertRCReturn(rc, rc); 2252 2256 … … 2257 2261 */ 2258 2262 if (uVersion <= 12) 2259 SSMR3Skip(pSSM, sizeof (uint32_t));2260 2261 SSMR3GetU32 (pSSM, &u32);2263 pHlp->pfnSSMSkip(pSSM, sizeof (uint32_t)); 2264 2265 pHlp->pfnSSMGetU32 (pSSM, &u32); 2262 2266 enmCmdType = (VBOXHGCMCMDTYPE)u32; 2263 SSMR3GetBool (pSSM, &fCancelled);2267 pHlp->pfnSSMGetBool (pSSM, &fCancelled); 2264 2268 /* How many linear pointers. Always 0 if not a call command. */ 2265 rc = SSMR3GetU32(pSSM, &cLinAddrs);2269 rc = pHlp->pfnSSMGetU32(pSSM, &cLinAddrs); 2266 2270 AssertRCReturn(rc, rc); 2267 2271 … … 2276 2280 { 2277 2281 /* Skip number of pages for all LinAddrs in this command. */ 2278 SSMR3Skip(pSSM, sizeof(uint32_t));2282 pHlp->pfnSSMSkip(pSSM, sizeof(uint32_t)); 2279 2283 2280 2284 uint32_t i; … … 2284 2288 2285 2289 /* Index of the parameter. Use cbData field to store the index. */ 2286 SSMR3GetU32 (pSSM, &pPtr->cbData);2287 SSMR3GetU32 (pSSM, &pPtr->offFirstPage);2288 rc = SSMR3GetU32(pSSM, &pPtr->cPages);2290 pHlp->pfnSSMGetU32 (pSSM, &pPtr->cbData); 2291 pHlp->pfnSSMGetU32 (pSSM, &pPtr->offFirstPage); 2292 rc = pHlp->pfnSSMGetU32(pSSM, &pPtr->cPages); 2289 2293 AssertRCReturn(rc, rc); 2290 2294 … … 2294 2298 uint32_t iPage; 2295 2299 for (iPage = 0; iPage < pPtr->cPages; ++iPage) 2296 rc = SSMR3GetGCPhys(pSSM, &pPtr->paPages[iPage]);2300 rc = pHlp->pfnSSMGetGCPhys(pSSM, &pPtr->paPages[iPage]); 2297 2301 } 2298 2302 } 2299 2303 2300 2304 /* A reserved field, will allow to extend saved data for a command. */ 2301 rc = SSMR3GetU32(pSSM, &u32);2305 rc = pHlp->pfnSSMGetU32(pSSM, &u32); 2302 2306 AssertRCReturn(rc, rc); 2303 2307 … … 2314 2318 2315 2319 /* A reserved field, will allow to extend saved data for VMMDevHGCM. */ 2316 rc = SSMR3GetU32(pSSM, &u32);2320 rc = pHlp->pfnSSMGetU32(pSSM, &u32); 2317 2321 AssertRCReturn(rc, rc); 2318 2322 } … … 2326 2330 uint32_t cbRequest; 2327 2331 2328 SSMR3GetGCPhys(pSSM, &GCPhys);2329 rc = SSMR3GetU32(pSSM, &cbRequest);2332 pHlp->pfnSSMGetGCPhys(pSSM, &GCPhys); 2333 rc = pHlp->pfnSSMGetU32(pSSM, &cbRequest); 2330 2334 AssertRCReturn(rc, rc); 2331 2335
Note:
See TracChangeset
for help on using the changeset viewer.