func MakeTyped(f Firmware) *TypedFirmware {
	return &TypedFirmware{
		Type:  reflect.TypeOf(f).String(),
		Value: f,
	}
}
MakeTyped takes a Firmware interface and makes a (type, value) pair.
package uefi
import (
	"bytes"
	"encoding/binary"
	"encoding/json"
	"fmt"
	"reflect"
)
var (
	ReadOnly = false
	DisableDecompression = false
)
type ROMAttributes struct {
	ErasePolarity byte  
}
const poisonedPolarity byte = 0xF0
var Attributes = ROMAttributes{ErasePolarity: poisonedPolarity}
func SetErasePolarity(ep byte) error {
	if ep != 0xFF && ep != 0 {
		return fmt.Errorf("invalid erase polarity requested, should only be 0x00 or 0xFF, got 0x%02X",
			ep)
	}
	if Attributes.ErasePolarity != poisonedPolarity {
		if Attributes.ErasePolarity != ep {
			return fmt.Errorf("conflicting erase polarities, was 0x%02X, requested 0x%02X",
				Attributes.ErasePolarity, ep)
		}
		return nil
	}
	Attributes.ErasePolarity = ep
	return nil
}
type Firmware interface {
	Buf() []byte
	SetBuf(buf []byte)
	Apply(v Visitor) error
	ApplyChildren(v Visitor) error
}
type TypedFirmware struct {
	Type  string
	Value Firmware
}