Versions in this module Expand all Collapse all v1 v1.0.1 Jan 26, 2025 Changes in this version type LowLevelHardwareInterfaces + CPUID func(uint32, uint32) (uint32, uint32, uint32, uint32) v1.0.0 Jan 26, 2025 Changes in this version + const DPRPCIRegSandyAndNewer + const DPRPciRegBroadwellDE + const TSEGPCIBroadwellde + const TsegPCIRegSandyAndNewer + var HashSHA1 = HashAlg(tpm2.AlgSHA1) + var HashSHA256 = HashAlg(tpm2.AlgSHA256) + var HostbridgeIDsBroadwellDE = []uint16 + var HostbridgeIDsSandyCompatible = []uint16 + func AddressRangesIsDMAProtected(l LowLevelHardwareInterfaces, first, end uint64) (bool, error) + func AllowsVMXInSMX(h LowLevelHardwareInterfaces) (bool, error) + func GetACPITableDevMem(h LowLevelHardwareInterfaces, n string) ([]byte, error) + func GetACPITableSysFS(h LowLevelHardwareInterfaces, n string) ([]byte, error) + func HasSMRR(h LowLevelHardwareInterfaces) (bool, error) + func IA32FeatureControlIsLocked(h LowLevelHardwareInterfaces) (bool, error) + func IA32PlatformID(h LowLevelHardwareInterfaces) (uint64, error) + func IsReservedInE820(l LowLevelHardwareInterfaces, start uint64, end uint64) (bool, error) + func IterateOverSMBIOSTablesType0(h LowLevelHardwareInterfaces, callback func(t0 *SMBIOSType0) bool) (ret bool, err error) + func IterateOverSMBIOSTablesType17(h LowLevelHardwareInterfaces, callback func(t17 *SMBIOSType17) bool) (ret bool, err error) + func ReadHostBridgeTseg(h LowLevelHardwareInterfaces) (uint32, uint32, error) + func TXTLeavesAreEnabled(h LowLevelHardwareInterfaces) (bool, error) + func UsableMemoryAbove4G(l LowLevelHardwareInterfaces) (size uint64, err error) + func UsableMemoryBelow4G(l LowLevelHardwareInterfaces) (size uint64, err error) + type ACPIRsdp struct + ExtendedChecksum uint8 + RSDPLen uint32 + Reserved [3]uint8 + XSDTPtr uint64 + type ACPIRsdpRev1 struct + Checksum uint8 + OEMID [6]uint8 + RSDTPtr uint32 + Revision uint8 + Signature [8]uint8 + type DMAProtectedRange struct + Lock bool + Size uint8 + Top uint16 + func ReadHostBridgeDPR(h LowLevelHardwareInterfaces) (DMAProtectedRange, error) + type HashAlg uint8 + func (a HashAlg) String() string + type HwAPI struct + func (h HwAPI) CPUID(leaf, subleaf uint32) (eax, ebx, ecx, edx uint32) + func (h HwAPI) CPULogCount() uint32 + func (h HwAPI) CPUSignature() uint32 + func (h HwAPI) CPUSignatureFull() (uint32, uint32, uint32, uint32) + func (h HwAPI) GetACPITable(n string) ([]byte, error) + func (h HwAPI) HasMTRR() bool + func (h HwAPI) HasSMX() bool + func (h HwAPI) HasVMX() bool + func (h HwAPI) IterateOverE820Ranges(target string, callback func(start uint64, end uint64) bool) (bool, error) + func (h HwAPI) IterateOverSMBIOSTables(n uint8, callback func(s *smbios.Structure) bool) (ret bool, err error) + func (h HwAPI) LookupIOAddress(addr uint64, regs VTdRegisters) ([]uint64, error) + func (h HwAPI) NVLocked(tpmCon *TPM) (bool, error) + func (h HwAPI) NVReadValue(tpmCon *TPM, index uint32, password string, size, offhandle uint32) ([]byte, error) + func (h HwAPI) NewTPM() (*TPM, error) + func (h HwAPI) PCIEnumerateVisibleDevices(cb func(d PCIDevice) (abort bool)) (err error) + func (h HwAPI) PCIReadConfigSpace(d PCIDevice, off int, lenBytes int) ([]byte, error) + func (h HwAPI) PCIWriteConfigSpace(d PCIDevice, off int, in interface{}) (err error) + func (h HwAPI) ProcessorBrandName() string + func (h HwAPI) ReadMSR(msr int64) []uint64 + func (h HwAPI) ReadNVPublic(tpmCon *TPM, index uint32) ([]byte, error) + func (h HwAPI) ReadPCR(tpmCon *TPM, pcr uint32) ([]byte, error) + func (h HwAPI) VersionString() string + func (t HwAPI) ReadPhys(addr int64, data UintN) error + func (t HwAPI) ReadPhysBuf(addr int64, buf []byte) error + func (t HwAPI) WritePhys(addr int64, data UintN) error + type IA32Debug struct + Enabled bool + Locked bool + PCHStrap bool + func IA32DebugInterfaceEnabledOrLocked(h LowLevelHardwareInterfaces) (*IA32Debug, error) + type LowLevelHardwareInterfaces interface + CPULogCount func() uint32 + CPUSignature func() uint32 + CPUSignatureFull func() (uint32, uint32, uint32, uint32) + GetACPITable func(n string) ([]byte, error) + HasMTRR func() bool + HasSMX func() bool + HasVMX func() bool + IterateOverE820Ranges func(target string, callback func(start uint64, end uint64) bool) (bool, error) + IterateOverSMBIOSTables func(n uint8, callback func(s *smbios.Structure) bool) (ret bool, err error) + LookupIOAddress func(addr uint64, regs VTdRegisters) ([]uint64, error) + NVLocked func(tpmCon *TPM) (bool, error) + NVReadValue func(tpmCon *TPM, index uint32, password string, size, offhandle uint32) ([]byte, error) + NewTPM func() (*TPM, error) + PCIEnumerateVisibleDevices func(cb func(d PCIDevice) (abort bool)) (err error) + PCIReadConfigSpace func(d PCIDevice, off int, len int) ([]byte, error) + PCIWriteConfigSpace func(d PCIDevice, off int, val interface{}) error + ProcessorBrandName func() string + ReadMSR func(msr int64) []uint64 + ReadNVPublic func(tpmCon *TPM, index uint32) ([]byte, error) + ReadPCR func(tpmCon *TPM, pcr uint32) ([]byte, error) + ReadPhys func(addr int64, data UintN) error + ReadPhysBuf func(addr int64, buf []byte) error + VersionString func() string + WritePhys func(addr int64, data UintN) error + func GetAPI() LowLevelHardwareInterfaces + type PCIDevice struct + BAR map[int]uint64 + Bus int + Device int + Function int + Hidden bool + ROM uint64 + type PCR struct + Digest []byte + DigestAlg crypto.Hash + Index int + type SMBIOSType0 struct + BIOSReleaseDate string + BIOSSize int + BIOSStartingAddress int + BIOSVersion string + BiosCharacteristics uint32 + BiosCharacteristicsExtension []uint8 + EmbeddedControllerMajor uint8 + EmbeddedControllerMinor uint8 + SystemBiosMajor uint8 + SystemBiosMinor uint8 + Vendor string + type SMBIOSType16 struct + type SMBIOSType17 struct + AssetTag string + BankLocator string + DataWidth int + DeviceLocator string + Manufacturer string + MemoryErrorInformation *SMBIOSType18 + PartNumber string + PhysicalMemory *SMBIOSType16 + SerialNumber string + Size uint64 + Speed int + TotalWidth int + type SMBIOSType18 struct + type SMRR struct + Active bool + PhysBase uint64 + PhysMask uint64 + func GetSMRRInfo(h LowLevelHardwareInterfaces) (SMRR, error) + type TCGVendorID uint32 + func (id TCGVendorID) String() string + type TPM struct + Interf TPMInterface + RWC io.ReadWriteCloser + SysPath string + Version TPMVersion + func NewTPM() (*TPM, error) + func (t *TPM) Close() error + func (t *TPM) GetCapability(cap, subcap uint32) ([]interface{}, error) + func (t *TPM) GetVersion() TPMVersion + func (t *TPM) Info() (*TPMInfo, error) + func (t *TPM) MeasurementLog() ([]byte, error) + func (t *TPM) NVReadValue(index uint32, ownerPassword string, size, offhandle uint32) ([]byte, error) + func (t *TPM) ReadNVPublic(index uint32) ([]byte, error) + func (t *TPM) ReadPCR(pcrIndex uint32) ([]byte, error) + func (t *TPM) ReadPCRs(alg HashAlg) ([]PCR, error) + type TPMInfo struct + FirmwareVersionMajor int + FirmwareVersionMinor int + Interface TPMInterface + Manufacturer TCGVendorID + VendorInfo string + Version TPMVersion + type TPMInterface uint8 + const TPMInterfaceDaemonManaged + const TPMInterfaceDirect + const TPMInterfaceKernelManaged + type TPMVersion uint8 + const TPMVersion12 + const TPMVersion20 + const TPMVersionAgnostic + type Uint16 uint16 + func (u *Uint16) Size() int64 + func (u *Uint16) String() string + type Uint32 uint32 + func (u *Uint32) Size() int64 + func (u *Uint32) String() string + type Uint64 uint64 + func (u *Uint64) Size() int64 + func (u *Uint64) String() string + type Uint8 uint8 + func (u *Uint8) Size() int64 + func (u *Uint8) String() string + type UintN interface + Size func() int64 + String func() string + type VTdRegisters struct + AdvancedFaultLog uint64 + Capabilities uint64 + ContextCommand uint64 + ExtendedCapabilities uint64 + FaultEventAddress uint32 + FaultEventControl uint32 + FaultEventData uint32 + FaultEventUpperAddress uint32 + FaultStatus uint32 + FixedRangeMTRR16K80000 uint64 + FixedRangeMTRR16KA0000 uint64 + FixedRangeMTRR4KC0000 uint64 + FixedRangeMTRR4KC8000 uint64 + FixedRangeMTRR4KD0000 uint64 + FixedRangeMTRR4KD8000 uint64 + FixedRangeMTRR4KE0000 uint64 + FixedRangeMTRR4KE8000 uint64 + FixedRangeMTRR4KF0000 uint64 + FixedRangeMTRR4KF8000 uint64 + FixedRangeMTRR64K00000 uint64 + GlobalCommand uint32 + GlobalStatus uint32 + InterruptRemappingTableAddress uint64 + InvalidationCompletionEventAddress uint32 + InvalidationCompletionEventControl uint32 + InvalidationCompletionEventData uint32 + InvalidationCompletionEventUpperAddress uint32 + InvalidationCompletionStatus uint32 + InvalidationQueueAddress uint64 + InvalidationQueueHead uint64 + InvalidationQueueTail uint64 + MTRRCapability uint64 + MTRRDefaultType uint64 + PageRequestEventAddress uint32 + PageRequestEventControl uint32 + PageRequestEventData uint32 + PageRequestEventUpperAddress uint32 + PageRequestQueueAddress uint64 + PageRequestQueueHead uint64 + PageRequestQueueTail uint64 + PageRequestStatus uint32 + ProtectedHighMemoryBase uint64 + ProtectedHighMemoryLimit uint64 + ProtectedLowMemoryBase uint32 + ProtectedLowMemoryLimit uint32 + ProtectedMemoryEnable uint32 + Reserved1 uint32 + Reserved10 uint64 + Reserved11 uint64 + Reserved12 uint64 + Reserved2 uint32 + Reserved3 uint64 + Reserved4 uint64 + Reserved5 uint32 + Reserved6 uint32 + Reserved7 uint64 + Reserved8 uint32 + RootTableAddress uint64 + VariableRangeMTRRBase0 uint64 + VariableRangeMTRRBase1 uint64 + VariableRangeMTRRBase2 uint64 + VariableRangeMTRRBase3 uint64 + VariableRangeMTRRBase4 uint64 + VariableRangeMTRRBase5 uint64 + VariableRangeMTRRBase6 uint64 + VariableRangeMTRRBase7 uint64 + VariableRangeMTRRBase8 uint64 + VariableRangeMTRRBase9 uint64 + VariableRangeMTRRMask0 uint64 + VariableRangeMTRRMask1 uint64 + VariableRangeMTRRMask2 uint64 + VariableRangeMTRRMask3 uint64 + VariableRangeMTRRMask4 uint64 + VariableRangeMTRRMask5 uint64 + VariableRangeMTRRMask6 uint64 + VariableRangeMTRRMask7 uint64 + VariableRangeMTRRMask8 uint64 + VariableRangeMTRRMask9 uint64 + Version uint32 + VirtualCommand uint64 + VirtualCommandCapability uint64 + VirtualCommandResponse uint64