github.com/linuxboot/fiano@v1.2.0/pkg/intel/metadata/fit/ent_bios_policy_record.go (about) 1 // Copyright 2017-2021 the LinuxBoot Authors. All rights reserved 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package fit 6 7 import ( 8 "io" 9 ) 10 11 // EntryBIOSPolicyRecord represents a FIT entry of type "BIOS Policy Record" (0x09) 12 type EntryBIOSPolicyRecord struct{ EntryBase } 13 14 var _ EntryCustomGetDataSegmentSizer = (*EntryBIOSPolicyRecord)(nil) 15 16 func (entry *EntryBIOSPolicyRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error) { 17 return uint64(entry.Headers.Size.Uint32()), nil 18 } 19 20 var _ EntryCustomRecalculateHeaderser = (*EntryBIOSPolicyRecord)(nil) 21 22 // CustomRecalculateHeaders recalculates metadata to be consistent with data. 23 // For example, it fixes checksum, data size, entry type and so on. 24 func (entry *EntryBIOSPolicyRecord) CustomRecalculateHeaders() error { 25 mostCommonRecalculateHeadersOfEntry(entry) 26 27 entry.Headers.Size.SetUint32(uint32(len(entry.DataSegmentBytes))) 28 return nil 29 }