Debian Codegraph @

util/intelp2m/platforms/common/fields/raw/raw.go

raw symbols SCIP
1 package raw
2
3 import "review.coreboot.org/coreboot.git/util/intelp2m/platforms/common"
4
5 type FieldCollection struct{}
6
7 // DecodeDW0() decodes DW0 register value and adds it to the macro string
8 func (FieldCollection) DecodeDW0(macro *common.Macro) *common.Macro {
9 dw0 := macro.Platform.GetRegisterDW0()
10 return macro.Add(dw0.String())
11 }
12
13 // DecodeDW1() decodes DW1 register value and adds it to the macro string
14 func (FieldCollection) DecodeDW1(macro *common.Macro) *common.Macro {
15 dw1 := macro.Platform.GetRegisterDW1()
16 return macro.Add(dw1.String())
17 }
18
19 // GenerateMacro() generates the field macro collection and adds it to the macro string
20 func (f FieldCollection) GenerateMacro(macro *common.Macro) *common.Macro {
21 macro.Add("_PAD_CFG_STRUCT(").Id().Add(", ")
22 f.DecodeDW0(macro).Add(", ")
23 return f.DecodeDW1(macro).Add("),")
24 }