Changeset 25050 in vbox for trunk/src/VBox/Devices/Graphics/HGSMI
- Timestamp:
- Nov 27, 2009 1:40:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
r24926 r25050 93 93 #define VBOXHGSMI_STATE_FIFOSTOP_MAGIC 0x1fedcba9 94 94 95 #define VBOXHGSMI_SAVE_START(_pSSM) do{ int rc = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_START_MAGIC); AssertRC(rc);}while(0)96 #define VBOXHGSMI_SAVE_STOP(_pSSM) do{ int rc = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_STOP_MAGIC); AssertRC(rc);}while(0)97 #define VBOXHGSMI_SAVE_FIFOSTART(_pSSM) do{ int rc = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTART_MAGIC); AssertRC(rc);}while(0)98 #define VBOXHGSMI_SAVE_FIFOSTOP(_pSSM) do{ int rc = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTOP_MAGIC); AssertRC(rc);}while(0)95 #define VBOXHGSMI_SAVE_START(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_START_MAGIC); AssertRC(rc2);}while(0) 96 #define VBOXHGSMI_SAVE_STOP(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_STOP_MAGIC); AssertRC(rc2);}while(0) 97 #define VBOXHGSMI_SAVE_FIFOSTART(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTART_MAGIC); AssertRC(rc2);}while(0) 98 #define VBOXHGSMI_SAVE_FIFOSTOP(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTOP_MAGIC); AssertRC(rc2);}while(0) 99 99 100 100 #define VBOXHGSMI_LOAD_CHECK(_pSSM, _v) \ 101 101 do{ \ 102 102 uint32_t u32; \ 103 int rc = SSMR3GetU32(_pSSM, &u32); AssertRC(rc); \103 int rc2 = SSMR3GetU32(_pSSM, &u32); AssertRC(rc2); \ 104 104 Assert(u32 == (_v)); \ 105 105 }while(0) … … 1086 1086 static int hgsmiHostSaveFifoEntryLocked (HGSMIHOSTFIFOENTRY *pEntry, PSSMHANDLE pSSM) 1087 1087 { 1088 int rc = SSMR3PutU32 (pSSM, pEntry->fl); AssertRC(rc); 1089 rc = SSMR3PutU32 (pSSM, pEntry->offBuffer); AssertRC(rc); 1090 return rc; 1088 SSMR3PutU32 (pSSM, pEntry->fl); 1089 return SSMR3PutU32 (pSSM, pEntry->offBuffer); 1091 1090 } 1092 1091 … … 1099 1098 ++size; 1100 1099 } 1101 int rc = SSMR3PutU32 (pSSM, size); AssertRC(rc);1102 1103 for(HGSMILISTENTRY * pEntry = pFifo->pHead; pEntry ; pEntry = pEntry->pNext)1100 int rc = SSMR3PutU32 (pSSM, size); 1101 1102 for(HGSMILISTENTRY * pEntry = pFifo->pHead; pEntry && RT_SUCCESS(rc); pEntry = pEntry->pNext) 1104 1103 { 1105 1104 HGSMIHOSTFIFOENTRY *pFifoEntry = HGSMILISTENTRY_2_FIFOENTRY(pEntry); 1106 rc = hgsmiHostSaveFifoEntryLocked (pFifoEntry, pSSM); AssertRC(rc);1105 rc = hgsmiHostSaveFifoEntryLocked (pFifoEntry, pSSM); 1107 1106 } 1108 1107 … … 1123 1122 pEntry->fl = u32; 1124 1123 rc = SSMR3GetU32 (pSSM, &pEntry->offBuffer); AssertRC(rc); 1125 *ppEntry = pEntry; 1124 if (RT_SUCCESS (rc)) 1125 *ppEntry = pEntry; 1126 else 1127 hgsmiHostFIFOFree (pIns, pEntry); 1126 1128 } 1127 1129 … … 1140 1142 { 1141 1143 HGSMIHOSTFIFOENTRY *pFifoEntry = NULL; /* initialized to shut up gcc */ 1142 rc = hgsmiHostLoadFifoEntryLocked (pIns, &pFifoEntry, pSSM); AssertRC(rc); 1143 if (RT_SUCCESS (rc)) 1144 { 1145 hgsmiListAppend (pFifo, &pFifoEntry->entry); 1146 } 1144 rc = hgsmiHostLoadFifoEntryLocked (pIns, &pFifoEntry, pSSM); 1145 AssertRCBreak(rc); 1146 hgsmiListAppend (pFifo, &pFifoEntry->entry); 1147 1147 } 1148 1148 } … … 1161 1161 1162 1162 HGSMIOFFSET off = pIns->pHGFlags ? HGSMIPointerToOffset(&pIns->area, (const HGSMIBUFFERHEADER *)pIns->pHGFlags) : HGSMIOFFSET_VOID; 1163 rc = SSMR3PutU32 (pSSM, off); AssertRC(rc);1163 SSMR3PutU32 (pSSM, off); 1164 1164 1165 1165 off = HGSMIHeapHandleLocationOffset(&pIns->hostHeap); 1166 rc = SSMR3PutU32 (pSSM, off); AssertRC(rc);1166 rc = SSMR3PutU32 (pSSM, off); 1167 1167 if(off != HGSMIOFFSET_VOID) 1168 1168 { 1169 rc = SSMR3PutU32 (pSSM, HGSMIHeapOffset(&pIns->hostHeap)); AssertRC(rc);1170 rc = SSMR3PutU32(pSSM, HGSMIHeapSize(&pIns->hostHeap)); AssertRC(rc);1169 SSMR3PutU32 (pSSM, HGSMIHeapOffset(&pIns->hostHeap)); 1170 SSMR3PutU32 (pSSM, HGSMIHeapSize(&pIns->hostHeap)); 1171 1171 /* need save mem pointer to calculate offset on restore */ 1172 rc = SSMR3PutU64 (pSSM, (uint64_t)pIns->area.pu8Base); AssertRC(rc);1173 rc = hgsmiFIFOLock (pIns); AssertRC(rc);1172 SSMR3PutU64 (pSSM, (uint64_t)pIns->area.pu8Base); 1173 rc = hgsmiFIFOLock (pIns); 1174 1174 if(RT_SUCCESS(rc)) 1175 1175 { … … 1196 1196 int rc; 1197 1197 HGSMIOFFSET off; 1198 rc = SSMR3GetU32(pSSM, &off); AssertRC(rc); 1198 rc = SSMR3GetU32(pSSM, &off); 1199 AssertRCReturn(rc, rc); 1199 1200 pIns->pHGFlags = (off != HGSMIOFFSET_VOID) ? (HGSMIHOSTFLAGS*)HGSMIOffsetToPointer (&pIns->area, off) : NULL; 1200 1201 1201 1202 HGSMIHEAP hHeap = pIns->hostHeap; 1202 rc = SSMR3GetU32(pSSM, &off); AssertRC(rc); 1203 rc = SSMR3GetU32(pSSM, &off); 1204 AssertRCReturn(rc, rc); 1203 1205 if(off != HGSMIOFFSET_VOID) 1204 1206 { 1205 1207 HGSMIOFFSET offHeap; 1208 SSMR3GetU32(pSSM, &offHeap); 1206 1209 uint32_t cbHeap; 1207 rc = SSMR3GetU32(pSSM, &offHeap); AssertRC(rc); 1208 rc = SSMR3GetU32(pSSM, &cbHeap); AssertRC(rc); 1210 SSMR3GetU32(pSSM, &cbHeap); 1209 1211 uint64_t oldMem; 1210 rc = SSMR3GetU64(pSSM, &oldMem); AssertRC(rc); 1211 1212 rc = hgsmiHostHeapLock (pIns); AssertRC(rc); 1212 rc = SSMR3GetU64(pSSM, &oldMem); 1213 AssertRCReturn(rc, rc); 1214 1215 rc = hgsmiHostHeapLock (pIns); 1213 1216 if (RT_SUCCESS (rc)) 1214 1217 { … … 1225 1228 } 1226 1229 1227 1228 rc = hgsmiFIFOLock (pIns); AssertRC(rc); 1229 if(RT_SUCCESS(rc)) 1230 { 1231 rc = hgsmiHostLoadFifoLocked (pIns, &pIns->hostFIFO, pSSM); AssertRC(rc); 1232 rc = hgsmiHostLoadFifoLocked (pIns, &pIns->hostFIFORead, pSSM); AssertRC(rc); 1233 rc = hgsmiHostLoadFifoLocked (pIns, &pIns->hostFIFOProcessed, pSSM); AssertRC(rc); 1234 1235 hgsmiFIFOUnlock (pIns); 1230 if (RT_SUCCESS(rc)) 1231 { 1232 rc = hgsmiFIFOLock (pIns); 1233 if(RT_SUCCESS(rc)) 1234 { 1235 rc = hgsmiHostLoadFifoLocked (pIns, &pIns->hostFIFO, pSSM); 1236 if (RT_SUCCESS(rc)) 1237 rc = hgsmiHostLoadFifoLocked (pIns, &pIns->hostFIFORead, pSSM); 1238 if (RT_SUCCESS(rc)) 1239 rc = hgsmiHostLoadFifoLocked (pIns, &pIns->hostFIFOProcessed, pSSM); 1240 1241 hgsmiFIFOUnlock (pIns); 1242 } 1236 1243 } 1237 1244 }
Note:
See TracChangeset
for help on using the changeset viewer.