Lines Matching refs:hdr
387 struct bootstage_hdr *hdr = (struct bootstage_hdr *)base;
393 if (hdr + 1 > (struct bootstage_hdr *)end) {
394 debug("%s: Not enough space for bootstage hdr\n", __func__);
399 hdr->version = BOOTSTAGE_VERSION;
401 hdr->count = data->rec_count;
402 hdr->size = 0;
403 hdr->magic = BOOTSTAGE_MAGIC;
404 hdr->next_id = data->next_id;
405 ptr += sizeof(*hdr);
426 hdr->size = ptr - (char *)base;
427 debug("Stashed %d records\n", hdr->count);
434 const struct bootstage_hdr *hdr = (struct bootstage_hdr *)base;
444 if (hdr + 1 > (struct bootstage_hdr *)end) {
445 debug("%s: Not enough space for bootstage hdr\n", __func__);
449 if (hdr->magic != BOOTSTAGE_MAGIC) {
454 if (ptr + hdr->size > end) {
459 if (hdr->count * sizeof(*rec) > hdr->size) {
461 "only %d bytes is available\n", __func__, hdr->count,
462 (ulong)hdr->count * sizeof(*rec), hdr->size);
466 if (hdr->version != BOOTSTAGE_VERSION) {
468 __func__, hdr->version);
472 if (data->rec_count + hdr->count > RECORD_COUNT) {
475 __func__, hdr->count, RECORD_COUNT - data->rec_count);
479 ptr += sizeof(*hdr);
482 rec_size = hdr->count * sizeof(*data->record);
487 for (rec = data->record + data->next_id, i = 0; i < hdr->count;
498 data->rec_count += hdr->count;
499 data->next_id = hdr->next_id;
500 debug("Unstashed %d records\n", hdr->count);