Lines Matching defs:pBsdLabel

188  * @param   pBsdLabel    BSD disklabel to get the checksum for.
190 static uint16_t rtDvmFmtBsdLblDiskLabelChkSum(PBsdLabel pBsdLabel)
193 uint16_t *pCurr = (uint16_t *)pBsdLabel;
194 uint16_t *pEnd = (uint16_t *)&pBsdLabel->aPartitions[pBsdLabel->cPartitions];
220 * @param pBsdLabel Pointer to the BSD disklabel to decode.
222 static bool rtDvmFmtBsdLblDiskLabelDecode(PBsdLabel pBsdLabel)
224 pBsdLabel->u32Magic = RT_LE2H_U32(pBsdLabel->u32Magic);
225 pBsdLabel->u16DriveType = RT_LE2H_U16(pBsdLabel->u16DriveType);
226 pBsdLabel->u16SubType = RT_LE2H_U16(pBsdLabel->u16SubType);
227 pBsdLabel->cbSector = RT_LE2H_U32(pBsdLabel->cbSector);
228 pBsdLabel->cSectorsPerTrack = RT_LE2H_U32(pBsdLabel->cSectorsPerTrack);
229 pBsdLabel->cTracksPerCylinder = RT_LE2H_U32(pBsdLabel->cTracksPerCylinder);
230 pBsdLabel->cDataCylindersPerUnit = RT_LE2H_U32(pBsdLabel->cDataCylindersPerUnit);
231 pBsdLabel->cDataSectorsPerCylinder = RT_LE2H_U32(pBsdLabel->cDataSectorsPerCylinder);
232 pBsdLabel->cSectorsPerUnit = RT_LE2H_U32(pBsdLabel->cSectorsPerUnit);
233 pBsdLabel->cSpareSectorsPerTrack = RT_LE2H_U16(pBsdLabel->cSpareSectorsPerTrack);
234 pBsdLabel->cSpareSectorsPerCylinder = RT_LE2H_U16(pBsdLabel->cSpareSectorsPerCylinder);
235 pBsdLabel->cSpareCylindersPerUnit = RT_LE2H_U32(pBsdLabel->cSpareCylindersPerUnit);
236 pBsdLabel->cRotationsPerMinute = RT_LE2H_U16(pBsdLabel->cRotationsPerMinute);
237 pBsdLabel->uSectorInterleave = RT_LE2H_U16(pBsdLabel->uSectorInterleave);
238 pBsdLabel->uSectorSkewPerTrack = RT_LE2H_U16(pBsdLabel->uSectorSkewPerTrack);
239 pBsdLabel->uSectorSkewPerCylinder = RT_LE2H_U16(pBsdLabel->uSectorSkewPerCylinder);
240 pBsdLabel->usHeadSwitch = RT_LE2H_U16(pBsdLabel->usHeadSwitch);
241 pBsdLabel->usTrackSeek = RT_LE2H_U16(pBsdLabel->usTrackSeek);
242 pBsdLabel->fFlags = RT_LE2H_U32(pBsdLabel->fFlags);
244 for (unsigned i = 0; i < RT_ELEMENTS(pBsdLabel->au32DriveData); i++)
245 pBsdLabel->au32DriveData[i] = RT_LE2H_U32(pBsdLabel->au32DriveData[i]);
246 for (unsigned i = 0; i < RT_ELEMENTS(pBsdLabel->au32Reserved); i++)
247 pBsdLabel->au32Reserved[i] = RT_LE2H_U32(pBsdLabel->au32Reserved[i]);
249 pBsdLabel->u32Magic2 = RT_LE2H_U32(pBsdLabel->u32Magic2);
250 pBsdLabel->u16ChkSum = RT_LE2H_U16(pBsdLabel->u16ChkSum);
251 pBsdLabel->cPartitions = RT_LE2H_U16(pBsdLabel->cPartitions);
252 pBsdLabel->cbBootArea = RT_LE2H_U32(pBsdLabel->cbBootArea);
253 pBsdLabel->cbFsSuperBlock = RT_LE2H_U32(pBsdLabel->cbFsSuperBlock);
256 if ( pBsdLabel->u32Magic != RTDVM_BSDLBL_MAGIC
257 || pBsdLabel->u32Magic2 != RTDVM_BSDLBL_MAGIC
258 || pBsdLabel->cPartitions != RTDVM_BSDLBL_MAX_PARTITIONS)
262 for (unsigned i = 0; i < RT_ELEMENTS(pBsdLabel->aPartitions); i++)
263 rtDvmFmtBsdLblDiskLabelDecodePartition(&pBsdLabel->aPartitions[i]);
266 uint16_t u16ChkSumSaved = pBsdLabel->u16ChkSum;
268 pBsdLabel->u16ChkSum = 0;
269 if (u16ChkSumSaved != rtDvmFmtBsdLblDiskLabelChkSum(pBsdLabel))
272 pBsdLabel->u16ChkSum = u16ChkSumSaved;