Lines Matching refs:v3Entry

228 	void setEntryForRemove(struct nvram_v3_var_entry *v3Entry, bool system);
397 struct nvram_v3_var_entry *v3Entry; in reloadInternal() local
435 v3Entry = (struct nvram_v3_var_entry *)entryContainer->getBytesNoCopy(); in reloadInternal()
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()
454 v3Entry->existing_offset = latestOffset ? latestOffset : prevOffset; in reloadInternal()
455 …DEBUG_INFO("Existing offset for %s at %#08zx\n", v3Entry->header.name_data_buf, v3Entry->existing_… in reloadInternal()
457 if (v3Entry->existing_offset == 0) { in reloadInternal()
458 DEBUG_ERROR("%s is not in the NOR image\n", v3Entry->header.name_data_buf); in reloadInternal()
459 if (v3Entry->new_state != VAR_NEW_STATE_REMOVE) { in reloadInternal()
460 DEBUG_INFO("%s marked for append\n", v3Entry->header.name_data_buf); in reloadInternal()
462 v3Entry->new_state = VAR_NEW_STATE_APPEND; in reloadInternal()
465 …DEBUG_INFO("Found offset for %s @ %#zx\n", v3Entry->header.name_data_buf, v3Entry->existing_offset… in reloadInternal()
466 storeVar = (const struct v3_var_header *)&controllerImage[v3Entry->existing_offset]; in reloadInternal()
468 if (v3Entry->new_state != VAR_NEW_STATE_REMOVE) { 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()
473 v3Entry->new_state = VAR_NEW_STATE_NONE; in reloadInternal()
475 …DEBUG_INFO("Store var data for %s differs, marking new state append\n", v3Entry->header.name_data_… in reloadInternal()
476 v3Entry->new_state = VAR_NEW_STATE_APPEND; in reloadInternal()
481 DEBUG_INFO("Removing entry at %#08zx with next sync\n", v3Entry->existing_offset); in reloadInternal()
508 IONVRAMV3Handler::setEntryForRemove(struct nvram_v3_var_entry *v3Entry, bool system) in setEntryForRemove() argument
514 require_action(v3Entry != nullptr, exit, DEBUG_INFO("remove with no entry\n")); in setEntryForRemove()
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()
520 if (v3Entry->new_state == VAR_NEW_STATE_REMOVE) { in setEntryForRemove()
525 v3Entry->new_state = VAR_NEW_STATE_REMOVE; in setEntryForRemove()
542 _provider->_diags->logVariable(getPartitionTypeForGUID(v3Entry->header.guid), in setEntryForRemove()
556 struct nvram_v3_var_entry *v3Entry = nullptr; in findExistingEntry() local
563 v3Entry = (struct nvram_v3_var_entry *)entryContainer->getBytesNoCopy(); in findExistingEntry()
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 …ng entry for %s, e_off=%#lx, len=%#lx\n", varName, v3Entry->existing_offset, variable_length(&v3En… in findExistingEntry()
581 v3Entry = nullptr; in findExistingEntry()
584 if (v3Entry != nullptr) { in findExistingEntry()
586 *existing = v3Entry; in findExistingEntry()
711 struct nvram_v3_var_entry *v3Entry; in unserializeVariables() local
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()
769 v3Entry->existing_offset = 0; in unserializeVariables()
770 v3Entry->new_state = VAR_NEW_STATE_NONE; in unserializeVariables()
773 …findExistingEntry(v3Entry->header.guid, (const char *)v3Entry->header.name_data_buf, &existingEntr… 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()
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 …r<const OSSymbol> canonicalKey = keyWithGuidAndCString(v3Entry->header.guid, (const char *)v3Entry in unserializeVariables()
802 canonicalKey->getCStringNoCopy(), v3Entry->header.dataSize, system); in unserializeVariables()
807 _provider->_diags->logVariable(getPartitionTypeForGUID(v3Entry->header.guid), in unserializeVariables()
812 IOFreeData(v3Entry, nvram_v3_var_container_size(header)); in unserializeVariables()
844 struct nvram_v3_var_entry *v3Entry = nullptr; in setVariableInternal() local
865 findExistingEntry(varGuid, variableName, &v3Entry, &existingEntryIndex); in setVariableInternal()
868 setEntryForRemove(v3Entry, system); in setVariableInternal()
870 if ((v3Entry != nullptr) && (v3Entry->new_state != VAR_NEW_STATE_REMOVE)) { in setVariableInternal()
872 existingVariableSize = variable_length(&v3Entry->header); in setVariableInternal()
905 if (v3Entry) { in setVariableInternal()
906 newV3Entry->existing_offset = v3Entry->existing_offset; in setVariableInternal()
907 newV3Entry->header.state = v3Entry->header.state; in setVariableInternal()
908 newV3Entry->header.attributes = v3Entry->header.attributes; in setVariableInternal()