Lines Matching refs:header

81 	struct v3_var_header   header;  member
85 nvram_v3_var_container_size(const struct v3_var_header *header) in nvram_v3_var_container_size() argument
87 return sizeof(struct nvram_v3_var_entry) + header->nameSize + header->dataSize; in nvram_v3_var_container_size()
91 variable_length(const struct v3_var_header *header) in variable_length() argument
93 return sizeof(struct v3_var_header) + header->nameSize + header->dataSize; in variable_length()
97 valid_store_header(const struct v3_store_header *header) in valid_store_header() argument
99 return (header->name == VARIABLE_STORE_SIGNATURE) && (header->version == VARIABLE_STORE_VERSION); in valid_store_header()
103 valid_variable_header(const struct v3_var_header *header, size_t buf_len) in valid_variable_header() argument
106 (header->startId == VARIABLE_DATA) && in valid_variable_header()
107 (variable_length(header) <= buf_len); in valid_variable_header()
270 const struct v3_store_header *header = (const struct v3_store_header *)image; in isValidImage() local
272 if ((header == nullptr) || (length < sizeof(*header))) { in isValidImage()
276 return valid_store_header(header); in isValidImage()
437 DEBUG_INFO("Looking for %s\n", v3Entry->header.name_data_buf); in reloadInternal()
438 …while ((latestOffset = find_active_var_in_image(&v3Entry->header, controllerImage, offset, _bankSi… in reloadInternal()
439 DEBUG_INFO("Found offset for %s @ %#08x\n", v3Entry->header.name_data_buf, latestOffset); in reloadInternal()
441 …DEBUG_INFO("Marking prev offset for %s at %#08x invalid\n", v3Entry->header.name_data_buf, offset); in reloadInternal()
455 …DEBUG_INFO("Existing offset for %s at %#08zx\n", v3Entry->header.name_data_buf, v3Entry->existing_… in reloadInternal()
458 DEBUG_ERROR("%s is not in the NOR image\n", v3Entry->header.name_data_buf); in reloadInternal()
460 DEBUG_INFO("%s marked for append\n", v3Entry->header.name_data_buf); in reloadInternal()
465 …DEBUG_INFO("Found offset for %s @ %#zx\n", v3Entry->header.name_data_buf, v3Entry->existing_offset… in reloadInternal()
470 if ((variable_length(&v3Entry->header) == variable_length(storeVar)) && in reloadInternal()
471 …(memcmp(v3Entry->header.name_data_buf, storeVar->name_data_buf, storeVar->nameSize + storeVar->dat… in reloadInternal()
472 …DEBUG_INFO("Store var data for %s matches, marking new state none\n", v3Entry->header.name_data_bu… in reloadInternal()
475 …DEBUG_INFO("Store var data for %s differs, marking new state append\n", v3Entry->header.name_data_… in reloadInternal()
516 variableName = (const char *)v3Entry->header.name_data_buf; in setEntryForRemove()
517 variableSize = (uint32_t)variable_length(&v3Entry->header); in setEntryForRemove()
518 canonicalKey = keyWithGuidAndCString(v3Entry->header.guid, variableName); in setEntryForRemove()
542 _provider->_diags->logVariable(getPartitionTypeForGUID(v3Entry->header.guid), in setEntryForRemove()
565 if ((v3Entry->header.nameSize == nameLen) && in findExistingEntry()
566 (memcmp(v3Entry->header.name_data_buf, varName, nameLen) == 0)) { in findExistingEntry()
568 if (uuid_compare(varGuid, v3Entry->header.guid) == 0) { in findExistingEntry()
572 v3Entry->existing_offset, variable_length(&v3Entry->header), v3Entry->new_state); in findExistingEntry()
576 …%s, e_off=%#lx, len=%#lx\n", varName, v3Entry->existing_offset, variable_length(&v3Entry->header)); in findExistingEntry()
712 const struct v3_var_header *header; in unserializeVariables() local
728 header = (const struct v3_var_header *)(_nvramImage + offset); in unserializeVariables()
741 if (!valid_variable_header(header, _bankSize - offset)) { in unserializeVariables()
747 uuid_unparse(header->guid, uuidString); in unserializeVariables()
748 DEBUG_INFO("Valid var @ %#08zx, state=%#02x, length=%#08zx, %s:%s\n", offset, header->state, in unserializeVariables()
749 variable_length(header), uuidString, header->name_data_buf); in unserializeVariables()
751 if (header->state != VAR_ADDED) { in unserializeVariables()
755 crc = crc32(0, header->name_data_buf + header->nameSize, header->dataSize); in unserializeVariables()
757 if (crc != header->crc) { in unserializeVariables()
758 DEBUG_ERROR("invalid crc @ %#lx, calculated=%#x, read=%#x\n", offset, crc, header->crc); in unserializeVariables()
762 v3Entry = (struct nvram_v3_var_entry *)IOMallocZeroData(nvram_v3_var_container_size(header)); in unserializeVariables()
763 __nochk_memcpy(&v3Entry->header, _nvramImage + offset, variable_length(header)); in unserializeVariables()
773 …findExistingEntry(v3Entry->header.guid, (const char *)v3Entry->header.name_data_buf, &existingEntr… in unserializeVariables()
776 existingSize = variable_length(&existingEntry->header); in unserializeVariables()
778 entryContainer = OSData::withBytes(v3Entry, (uint32_t)nvram_v3_var_container_size(header)); in unserializeVariables()
781 …DEBUG_INFO("Found existing for %s, resetting when controller available\n", v3Entry->header.name_da… in unserializeVariables()
784 entryContainer = OSData::withBytes(v3Entry, (uint32_t)nvram_v3_var_container_size(header)); in unserializeVariables()
789 …system = (_systemSize != 0) && (uuid_compare(v3Entry->header.guid, gAppleSystemVariableGuid) == 0); in unserializeVariables()
791 _systemUsed = _systemUsed + (uint32_t)variable_length(header) - (uint32_t)existingSize; in unserializeVariables()
793 _commonUsed = _commonUsed + (uint32_t)variable_length(header) - (uint32_t)existingSize; in unserializeVariables()
796 if (convertPropToObject(v3Entry->header.name_data_buf, v3Entry->header.nameSize, in unserializeVariables()
797 v3Entry->header.name_data_buf + v3Entry->header.nameSize, v3Entry->header.dataSize, in unserializeVariables()
799 …SSymbol> canonicalKey = keyWithGuidAndCString(v3Entry->header.guid, (const char *)v3Entry->header.… in unserializeVariables()
802 canonicalKey->getCStringNoCopy(), v3Entry->header.dataSize, system); in unserializeVariables()
807 _provider->_diags->logVariable(getPartitionTypeForGUID(v3Entry->header.guid), in unserializeVariables()
809 (void *)(uintptr_t)(header->name_data_buf + header->nameSize)); in unserializeVariables()
812 IOFreeData(v3Entry, nvram_v3_var_container_size(header)); in unserializeVariables()
814 offset += variable_length(header); in unserializeVariables()
872 existingVariableSize = variable_length(&v3Entry->header); in setVariableInternal()
895 memcpy(newV3Entry->header.name_data_buf, variableName, entryNameLen); in setVariableInternal()
896 …convertObjectToProp(newV3Entry->header.name_data_buf + entryNameLen, &dataSize, variableName, obje… in setVariableInternal()
898 newV3Entry->header.startId = VARIABLE_DATA; in setVariableInternal()
899 newV3Entry->header.nameSize = (uint32_t)entryNameLen; in setVariableInternal()
900 newV3Entry->header.dataSize = dataSize; in setVariableInternal()
901 newV3Entry->header.crc = crc32(0, newV3Entry->header.name_data_buf + entryNameLen, dataSize); in setVariableInternal()
902 memcpy(newV3Entry->header.guid, varGuid, sizeof(gAppleNVRAMGuid)); in setVariableInternal()
907 newV3Entry->header.state = v3Entry->header.state; in setVariableInternal()
908 newV3Entry->header.attributes = v3Entry->header.attributes; in setVariableInternal()
1064 varHeader = &varEntry->header; in reclaim()
1067 …i, varEntry->header.name_data_buf, varEntry->new_state, varEntry->existing_offset, varHeader->stat… in reclaim()
1121 varHeader = &varEntry->header; in getAppendSize()
1167 varHeader = &varEntry->header; in syncRaw()
1170 …varEntry->header.name_data_buf, varEntry->new_state, varEntry->header.state, varEntry->existing_of… in syncRaw()
1181 …varEntry->header.name_data_buf, appendBufferOffset, varEntry->existing_offset, prevOffset, varSize… in syncRaw()
1291 varHeader = &varEntry->header; in syncBlock()
1294 …i, varEntry->header.name_data_buf, varEntry->new_state, varEntry->existing_offset, varHeader->stat… in syncBlock()
1307 DEBUG_INFO("Dropping %s\n", varEntry->header.name_data_buf); in syncBlock()