github.com/linuxboot/fiano@v1.2.0/pkg/intel/metadata/bg/bgbootpolicy/bpmh.go (about) 1 // Copyright 2017-2023 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 //go:generate manifestcodegen 6 7 package bgbootpolicy 8 9 import "github.com/linuxboot/fiano/pkg/intel/metadata/bg" 10 11 type BPMH struct { 12 StructInfo `id:"__ACBP__" version:"0x10"` 13 14 HdrStructVersion uint8 `json:"HdrStructVersion"` 15 16 PMBPMVersion uint8 `json:"bpmhRevision"` 17 18 // PrettyString: BPM SVN 19 BPMSVN bg.SVN `json:"bpmhSNV"` 20 // PrettyString: ACM SVN Auth 21 ACMSVNAuth bg.SVN `json:"bpmhACMSVN"` 22 23 Reserved0 [1]byte `require:"0" json:"bpmhReserved0,omitempty"` 24 25 NEMDataStack Size4K `json:"bpmhNEMStackSize"` 26 } 27 28 // Size4K is a size in units of 4096 bytes. 29 type Size4K uint16 30 31 // InBytes returns the size in bytes. 32 func (s Size4K) InBytes() uint32 { 33 return uint32(s) * 4096 34 } 35 36 // NewSize4K returns the given size as multiple of 4K 37 func NewSize4K(size uint32) Size4K { 38 return Size4K(size / 4096) 39 }