Lines Matching full:hdr
52 gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, in gptupdate() argument
66 entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; in gptupdate()
70 slba += hdr->hdr_lba_table; in gptupdate()
76 hdr->hdr_crc_table = crc32(0, Z_NULL, 0); in gptupdate()
77 hdr->hdr_crc_table = crc32(hdr->hdr_crc_table, (const Bytef *)table, in gptupdate()
78 hdr->hdr_entries * hdr->hdr_entsz); in gptupdate()
79 hdr->hdr_crc_self = crc32(0, Z_NULL, 0); in gptupdate()
80 hdr->hdr_crc_self = crc32(hdr->hdr_crc_self, (const Bytef *)hdr, in gptupdate()
81 hdr->hdr_size); in gptupdate()
83 bcopy(hdr, secbuf, hdr->hdr_size); in gptupdate()
84 if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) { in gptupdate()
183 gptread_hdr(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, in gptread_hdr() argument
192 bcopy(secbuf, hdr, sizeof(*hdr)); in gptread_hdr()
193 if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || in gptread_hdr()
194 hdr->hdr_lba_self != hdrlba || hdr->hdr_revision < 0x00010000 || in gptread_hdr()
195 hdr->hdr_entsz < sizeof(struct gpt_ent) || in gptread_hdr()
196 hdr->hdr_entries > MAXTBLENTS || DEV_BSIZE % hdr->hdr_entsz != 0) { in gptread_hdr()
200 crc = hdr->hdr_crc_self; in gptread_hdr()
201 hdr->hdr_crc_self = crc32(0, Z_NULL, 0); in gptread_hdr()
202 if (crc32(hdr->hdr_crc_self, (const Bytef *)hdr, hdr->hdr_size) != in gptread_hdr()
208 hdr->hdr_crc_self = crc; in gptread_hdr()
232 gptbootconv(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, in gptbootconv() argument
241 entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; in gptbootconv()
242 for (nent = 0, slba = hdr->hdr_lba_table; in gptbootconv()
243 slba < hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; in gptbootconv()
269 hdr->hdr_crc_table = crc32(0, Z_NULL, 0); in gptbootconv()
270 hdr->hdr_crc_table = crc32(hdr->hdr_crc_table, (const Bytef *)table, in gptbootconv()
271 hdr->hdr_entries * hdr->hdr_entsz); in gptbootconv()
272 hdr->hdr_crc_self = crc32(0, Z_NULL, 0); in gptbootconv()
273 hdr->hdr_crc_self = crc32(hdr->hdr_crc_self, (const Bytef *)hdr, in gptbootconv()
274 hdr->hdr_size); in gptbootconv()
276 bcopy(hdr, secbuf, hdr->hdr_size); in gptbootconv()
277 if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) in gptbootconv()
282 gptread_table(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, in gptread_table() argument
290 if (hdr->hdr_entries == 0) in gptread_table()
293 entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; in gptread_table()
294 slba = hdr->hdr_lba_table; in gptread_table()
305 if (++nent >= hdr->hdr_entries) in gptread_table()
308 if (nent >= hdr->hdr_entries) in gptread_table()
312 if (crc32(0, (const Bytef *)table, nent * hdr->hdr_entsz) != in gptread_table()
313 hdr->hdr_crc_table) { in gptread_table()