Skip to content

Commit c50e649

Browse files
committed
intel/metadata/fit: spell out SACM to StartupACM
This makes it easier to grasp. Intel docs also spell it out. See: https://www.intel.com/content/dam/develop/external/us/en/documents/firmware-interface-table-bios-specification-r1p2p1.pdf Signed-off-by: Daniel Maslowski <info@orangecms.org>
1 parent ff58259 commit c50e649

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

pkg/intel/metadata/fit/ent_startup_ac_module_entry.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import (
1818
)
1919

2020
// EntrySACM represents a FIT entry of type "Startup AC Module Entry" (0x02)
21-
type EntrySACM struct{ EntryBase }
21+
type EntryStartupACM struct{ EntryBase }
2222

23-
var _ EntryCustomGetDataSegmentSizer = (*EntrySACM)(nil)
23+
var _ EntryCustomGetDataSegmentSizer = (*EntryStartupACM)(nil)
2424

25-
func (entry *EntrySACM) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error) {
25+
func (entry *EntryStartupACM) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error) {
2626
offset, err := entry.Headers.getDataSegmentOffset(firmware)
2727
if err != nil {
2828
return 0, fmt.Errorf("unable to detect data segment offset: %w", err)
@@ -38,9 +38,9 @@ func (entry *EntrySACM) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64
3838
return uint64(size), nil
3939
}
4040

41-
var _ EntryCustomRecalculateHeaderser = (*EntrySACM)(nil)
41+
var _ EntryCustomRecalculateHeaderser = (*EntryStartupACM)(nil)
4242

43-
func (entry *EntrySACM) CustomRecalculateHeaders() error {
43+
func (entry *EntryStartupACM) CustomRecalculateHeaders() error {
4444
// See 4.4.7 of the FIT specification.
4545
entry.Headers.Size.SetUint32(0)
4646
return nil
@@ -566,7 +566,7 @@ func EntrySACMParseSize(b []byte) (uint32, error) {
566566
}
567567

568568
// ParseData parses SACM entry and returns EntrySACMData.
569-
func (entry *EntrySACM) ParseData() (*EntrySACMData, error) {
569+
func (entry *EntryStartupACM) ParseData() (*EntrySACMData, error) {
570570
entryData := EntrySACMData{}
571571
_, err := entryData.Read(entry.DataSegmentBytes)
572572
if err != nil {
@@ -654,7 +654,7 @@ type entrySACMJSON struct {
654654
}
655655

656656
// MarshalJSON implements json.Marshaler
657-
func (entry *EntrySACM) MarshalJSON() ([]byte, error) {
657+
func (entry *EntryStartupACM) MarshalJSON() ([]byte, error) {
658658
result := entrySACMJSON{}
659659
result.DataParsed, result.DataParseError = entry.ParseData()
660660
result.Headers = &entry.Headers
@@ -665,7 +665,7 @@ func (entry *EntrySACM) MarshalJSON() ([]byte, error) {
665665
}
666666

667667
// UnmarshalJSON implements json.Unmarshaller
668-
func (entry *EntrySACM) UnmarshalJSON(b []byte) error {
668+
func (entry *EntryStartupACM) UnmarshalJSON(b []byte) error {
669669
result := entrySACMJSON{}
670670
err := json.Unmarshal(b, &result)
671671
if err != nil {

pkg/intel/metadata/fit/entry_type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func RegisterEntryType(entryTypeID EntryType, entryGoType Entry) {
7070
func init() {
7171
RegisterEntryType(EntryTypeFITHeaderEntry, &EntryFITHeaderEntry{})
7272
RegisterEntryType(EntryTypeMicrocodeUpdateEntry, &EntryMicrocodeUpdateEntry{})
73-
RegisterEntryType(EntryTypeStartupACModuleEntry, &EntrySACM{})
73+
RegisterEntryType(EntryTypeStartupACModuleEntry, &EntryStartupACM{})
7474
RegisterEntryType(EntryTypeDiagnosticACModuleEntry, &EntryDiagnosticACM{})
7575
RegisterEntryType(EntryTypeBIOSStartupModuleEntry, &EntryBIOSStartupModuleEntry{})
7676
RegisterEntryType(EntryTypeTPMPolicyRecord, &EntryTPMPolicyRecord{})

0 commit comments

Comments
 (0)