Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootguard 1.0 support #394

Merged
merged 13 commits into from
Jan 11, 2023
File renamed without changes.
39 changes: 39 additions & 0 deletions pkg/intel/metadata/bg/bgbootpolicy/bpmh.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright 2017-2023 the LinuxBoot Authors. All rights reserved
zaolin marked this conversation as resolved.
Show resolved Hide resolved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:generate manifestcodegen

package bgbootpolicy

import "github.com/linuxboot/fiano/pkg/intel/metadata/bg"

type BPMH struct {
StructInfo `id:"__ACBP__" version:"0x10"`

HdrStructVersion uint8 `json:"HdrStructVersion"`

PMBPMVersion uint8 `json:"bpmhRevision"`

// PrettyString: BPM SVN
BPMSVN bg.SVN `json:"bpmhSNV"`
// PrettyString: ACM SVN Auth
ACMSVNAuth bg.SVN `json:"bpmhACMSVN"`

Reserved0 [1]byte `require:"0" json:"bpmhReserved0,omitempty"`

NEMDataStack Size4K `json:"bpmhNEMStackSize"`
}

// Size4K is a size in units of 4096 bytes.
type Size4K uint16

// InBytes returns the size in bytes.
func (s Size4K) InBytes() uint32 {
return uint32(s) * 4096
}

// NewSize4K returns the given size as multiple of 4K
func NewSize4K(size uint32) Size4K {
return Size4K(size / 4096)
}
Loading