GET32
val = GET32(meta, hdr->CRC);
val = GET32(meta, hdr->CRC);
len = max(len, GET32(meta, hdr->cd_section) + GET32(meta, hdr->cd_length));
len = max(len, GET32(meta, hdr->pdr_section) + GET32(meta, hdr->pdr_length));
len = max(len, GET32(meta, hdr->vdr_section) + GET32(meta, hdr->vdr_length));
len = max(len, GET32(meta, hdr->cr_section) + GET32(meta, hdr->cr_length));
len = max(len, GET32(meta, hdr->pdd_section) + GET32(meta, hdr->pdd_length));
if ((val = GET32(meta, hdr->bbmlog_section)) != 0xffffffff)
len = max(len, val + GET32(meta, hdr->bbmlog_length));
if ((val = GET32(meta, hdr->Diagnostic_Space)) != 0xffffffff)
len = max(len, val + GET32(meta, hdr->Diagnostic_Space_Length));
if ((val = GET32(meta, hdr->Vendor_Specific_Logs)) != 0xffffffff)
len = max(len, val + GET32(meta, hdr->Vendor_Specific_Logs_Length));
if (GET32(meta, hdr->cd_length) * ss >= maxphys ||
GET32(meta, hdr->pdr_length) * ss >= maxphys ||
GET32(meta, hdr->vdr_length) * ss >= maxphys ||
GET32(meta, hdr->cr_length) * ss >= maxphys ||
GET32(meta, hdr->pdd_length) * ss >= maxphys ||
GET32(meta, hdr->bbmlog_length) * ss >= maxphys) {
buf = g_read_data(cp, (lba + GET32(meta, hdr->cd_section)) * ss,
GET32(meta, hdr->cd_length) * ss, &error);
meta->cdr = malloc(GET32(meta, hdr->cd_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(meta->cdr, buf, GET32(meta, hdr->cd_length) * ss);
if (GET32(meta, cdr->Signature) != DDF_CONTROLLER_DATA_SIGNATURE)
buf = g_read_data(cp, (lba + GET32(meta, hdr->pdr_section)) * ss,
GET32(meta, hdr->pdr_length) * ss, &error);
meta->pdr = malloc(GET32(meta, hdr->pdr_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(meta->pdr, buf, GET32(meta, hdr->pdr_length) * ss);
if (GET32(meta, pdr->Signature) != DDF_PDR_SIGNATURE)
if (GET32(meta, pdr->entry[i].PD_Reference) ==
buf = g_read_data(cp, (lba + GET32(meta, hdr->vdr_section)) * ss,
GET32(meta, hdr->vdr_length) * ss, &error);
meta->vdr = malloc(GET32(meta, hdr->vdr_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(meta->vdr, buf, GET32(meta, hdr->vdr_length) * ss);
if (GET32(meta, vdr->Signature) != DDF_VD_RECORD_SIGNATURE)
buf = g_read_data(cp, (lba + GET32(meta, hdr->cr_section)) * ss,
GET32(meta, hdr->cr_length) * ss, &error);
meta->cr = malloc(GET32(meta, hdr->cr_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(meta->cr, buf, GET32(meta, hdr->cr_length) * ss);
buf = g_read_data(cp, (lba + GET32(meta, hdr->pdd_section)) * ss,
GET32(meta, hdr->pdd_length) * ss, &error);
meta->pdd = malloc(GET32(meta, hdr->pdd_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(meta->pdd, buf, GET32(meta, hdr->pdd_length) * ss);
if (GET32(meta, pdd->Signature) != DDF_PDD_SIGNATURE)
i = ddf_meta_find_pd(meta, NULL, GET32(meta, pdd->PD_Reference));
if (GET32(meta, hdr->bbmlog_section) != 0xffffffff &&
GET32(meta, hdr->bbmlog_length) != 0) {
buf = g_read_data(cp, (lba + GET32(meta, hdr->bbmlog_section)) * ss,
GET32(meta, hdr->bbmlog_length) * ss, &error);
meta->bbm = malloc(GET32(meta, hdr->bbmlog_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(meta->bbm, buf, GET32(meta, hdr->bbmlog_length) * ss);
if (GET32(meta, bbm->Signature) != DDF_BBML_SIGNATURE)
size = GET32(meta, hdr->cd_length) * ss;
error = g_write_data(cp, (lba + GET32(meta, hdr->cd_section)) * ss,
size = GET32(meta, hdr->pdr_length) * ss;
error = g_write_data(cp, (lba + GET32(meta, hdr->pdr_section)) * ss,
size = GET32(meta, hdr->vdr_length) * ss;
error = g_write_data(cp, (lba + GET32(meta, hdr->vdr_section)) * ss,
error = g_write_data(cp, (lba + GET32(meta, hdr->cr_section)) * ss,
size = GET32(meta, hdr->pdd_length) * ss;
error = g_write_data(cp, (lba + GET32(meta, hdr->pdd_section)) * ss,
if (GET32(meta, hdr->bbmlog_length) != 0) {
size = GET32(meta, hdr->bbmlog_length) * ss;
(lba + GET32(meta, hdr->bbmlog_section)) * ss,
if (GET32(meta, pdd->PD_Reference) == id)
reference = GET32(&pd->pd_meta, pdd->PD_Reference);
#define GETCRNUM(m) (GET32((m), hdr->cr_length) / \
val = GET32(vmeta, bvdc[k]->Physical_Disk_Sequence[i]);
printf("Sequence_Number 0x%08x\n", GET32(meta, hdr->Sequence_Number));
printf("TimeStamp 0x%08x\n", GET32(meta, hdr->TimeStamp));
printf("WorkSpace_Length %u\n", GET32(meta, hdr->WorkSpace_Length));
printf("Controller Data %u:%u\n", GET32(meta, hdr->cd_section), GET32(meta, hdr->cd_length));
printf("Physical Disk %u:%u\n", GET32(meta, hdr->pdr_section), GET32(meta, hdr->pdr_length));
printf("Virtual Disk %u:%u\n", GET32(meta, hdr->vdr_section), GET32(meta, hdr->vdr_length));
printf("Configuration Recs %u:%u\n", GET32(meta, hdr->cr_section), GET32(meta, hdr->cr_length));
printf("Physical Disk Recs %u:%u\n", GET32(meta, hdr->pdd_section), GET32(meta, hdr->pdd_length));
printf("BBM Log %u:%u\n", GET32(meta, hdr->bbmlog_section), GET32(meta, hdr->bbmlog_length));
printf("Diagnostic Space %u:%u\n", GET32(meta, hdr->Diagnostic_Space), GET32(meta, hdr->Diagnostic_Space_Length));
printf("Vendor_Specific_Logs %u:%u\n", GET32(meta, hdr->Vendor_Specific_Logs), GET32(meta, hdr->Vendor_Specific_Logs_Length));
GET32(vmeta, vdc->Sequence_Number) + 1);
if (GET32(meta, pdr->entry[j].PD_Reference) == 0xffffffff)
GET32(meta, pdr->entry[j].PD_Reference));
GET32(&pd->pd_meta, pdd->PD_Reference));
GET32(vmeta, bvdc[bvd]->Physical_Disk_Sequence[pos]));
GET32(&pd->pd_meta, pdd->PD_Reference));
NULL, GET32(gmeta, pdr->entry[i].PD_Reference)) != NULL)
GET32(&pd->pd_meta, hdr->pdr_length) *
i = ddf_meta_find_pd(&pd->pd_meta, NULL, GET32(&pd->pd_meta, pdd->PD_Reference));
GET32(meta, pdd->PD_Reference));
if (GET32(meta, pdr->entry[i].PD_Reference) == PD_Reference)
if (GET32(vmeta, bvdc[bvd]->Physical_Disk_Sequence[pos]) ==
howmany(GET32(sample, hdr->WorkSpace_Length) *
howmany(GET32(sample, hdr->cd_length) *
howmany(GET32(sample, hdr->pdr_length) *
howmany(GET32(sample, hdr->vdr_length) *
howmany(GET32(sample, hdr->cr_length) *
howmany(GET32(sample, hdr->pdd_length) *
howmany(GET32(sample, hdr->bbmlog_length) *
howmany(GET32(sample, hdr->bbmlog_length) *
howmany(GET32(sample, hdr->bbmlog_length) *
pos += GET32(meta, hdr->cd_length);
pos += GET32(meta, hdr->pdr_length);
pos += GET32(meta, hdr->vdr_length);
pos += GET32(meta, hdr->cr_length);
pos += GET32(meta, hdr->pdd_length);
GET32(meta, hdr->bbmlog_length) != 0 ? pos : 0xffffffff);
pos += GET32(meta, hdr->bbmlog_length);
GET32(meta, hdr->Diagnostic_Space_Length) != 0 ? pos : 0xffffffff);
pos += GET32(meta, hdr->Diagnostic_Space_Length);
GET32(meta, hdr->Vendor_Specific_Logs_Length) != 0 ? pos : 0xffffffff);
pos += min(GET32(meta, hdr->Vendor_Specific_Logs_Length), 1);
size = GET32(meta, hdr->cd_length) * ss;
size = GET32(meta, hdr->pdr_length) * ss;
size = GET32(meta, hdr->vdr_length) * ss;
size = GET32(meta, hdr->cr_length) * ss;
size = GET32(meta, hdr->pdd_length) * ss;
if (GET32(meta, hdr->bbmlog_length) != 0) {
size = GET32(meta, hdr->bbmlog_length) * ss;
dst->cdr = malloc(GET32(src, hdr->cd_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(dst->cdr, src->cdr, GET32(src, hdr->cd_length) * ss);
dst->pdr = malloc(GET32(src, hdr->pdr_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(dst->pdr, src->pdr, GET32(src, hdr->pdr_length) * ss);
dst->vdr = malloc(GET32(src, hdr->vdr_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(dst->vdr, src->vdr, GET32(src, hdr->vdr_length) * ss);
dst->cr = malloc(GET32(src, hdr->cr_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(dst->cr, src->cr, GET32(src, hdr->cr_length) * ss);
dst->pdd = malloc(GET32(src, hdr->pdd_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(dst->pdd, src->pdd, GET32(src, hdr->pdd_length) * ss);
dst->bbm = malloc(GET32(src, hdr->bbmlog_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(dst->bbm, src->bbm, GET32(src, hdr->bbmlog_length) * ss);
GET32(src, pdr->entry[i].PD_Reference));
meta->cdr = malloc(GET32(sample, hdr->cd_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(meta->cdr, sample->cdr, GET32(sample, hdr->cd_length) * ss);
GET32(dst, vdc->Sequence_Number))) > 0))
GET32(dst, bvdc[bvd]->Sequence_Number))) > 0))
dst->cdr = malloc(GET32(src, hdr->cd_length) * ss, M_MD_DDF, M_WAITOK);
memcpy(dst->cdr, src->cdr, GET32(src, hdr->cd_length) * ss);
ref = GET32(meta, pdd->PD_Reference);