Lines Matching refs:hdr

56 gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr,  in gptupdate()  argument
70 entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; in gptupdate()
74 slba += hdr->hdr_lba_table; in gptupdate()
80 hdr->hdr_crc_table = crc32(0, Z_NULL, 0); in gptupdate()
81 hdr->hdr_crc_table = crc32(hdr->hdr_crc_table, table, in gptupdate()
82 hdr->hdr_entries * hdr->hdr_entsz); in gptupdate()
83 hdr->hdr_crc_self = crc32(0, Z_NULL, 0); in gptupdate()
84 hdr->hdr_crc_self = crc32(hdr->hdr_crc_self, hdr, hdr->hdr_size); in gptupdate()
86 bcopy(hdr, secbuf, hdr->hdr_size); in gptupdate()
87 if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) { in gptupdate()
186 gptread_hdr(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, in gptread_hdr() argument
195 bcopy(secbuf, hdr, sizeof (*hdr)); in gptread_hdr()
196 if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof (hdr->hdr_sig)) != 0 || in gptread_hdr()
197 hdr->hdr_lba_self != hdrlba || hdr->hdr_revision < 0x00010000 || in gptread_hdr()
198 hdr->hdr_entsz < sizeof (struct gpt_ent) || in gptread_hdr()
199 hdr->hdr_entries > MAXTBLENTS || DEV_BSIZE % hdr->hdr_entsz != 0) { in gptread_hdr()
203 crc = hdr->hdr_crc_self; in gptread_hdr()
204 hdr->hdr_crc_self = crc32(0, Z_NULL, 0); in gptread_hdr()
205 if (crc32(hdr->hdr_crc_self, hdr, hdr->hdr_size) != crc) { in gptread_hdr()
210 hdr->hdr_crc_self = crc; in gptread_hdr()
234 gptbootconv(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, in gptbootconv() argument
243 entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; in gptbootconv()
244 for (nent = 0, slba = hdr->hdr_lba_table; in gptbootconv()
245 slba < hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; in gptbootconv()
271 hdr->hdr_crc_table = crc32(0, Z_NULL, 0); in gptbootconv()
272 hdr->hdr_crc_table = crc32(hdr->hdr_crc_table, table, in gptbootconv()
273 hdr->hdr_entries * hdr->hdr_entsz); in gptbootconv()
274 hdr->hdr_crc_self = crc32(0, Z_NULL, 0); in gptbootconv()
275 hdr->hdr_crc_self = crc32(hdr->hdr_crc_self, hdr, hdr->hdr_size); in gptbootconv()
277 bcopy(hdr, secbuf, hdr->hdr_size); in gptbootconv()
278 if (drvwrite(dskp, secbuf, hdr->hdr_lba_self, 1)) in gptbootconv()
284 struct gpt_hdr *hdr, struct gpt_ent *table) in gptread_table() argument
291 if (hdr->hdr_entries == 0) in gptread_table()
294 entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; in gptread_table()
295 slba = hdr->hdr_lba_table; in gptread_table()
306 if (++nent >= hdr->hdr_entries) in gptread_table()
309 if (nent >= hdr->hdr_entries) in gptread_table()
313 if (crc32(0, table, nent * hdr->hdr_entsz) != hdr->hdr_crc_table) { in gptread_table()