Documentation ¶
Index ¶
Constants ¶
View Source
const ( // BasePhysAddr is the absolute physical address where the firmware image ends. // // See Figure 2.1 in https://www.intel.com/content/dam/www/public/us/en/documents/guides/fit-bios-specification.pdf // // Note: A firmware image grows towards lower addresses. So an image will be mapped to addresses: // [ BasePhysAddr-length .. BasePhysAddr ) // // Note: SPI chip is mapped into this region. So we actually work directly with data of the SPI chip // // See also CalculatePhysAddrOfOffset(). BasePhysAddr = 1 << 32 // "4GB" )
Variables ¶
View Source
var ( // HPSignedFileMagic is the magic used to detect if the firmware is actually // an HP signed container-file (so it's required to extract/find // the firmware image first). HPSignedFileMagic = []byte(`--=</Begin HP Signed File Fingerprint\>=--`) // HPImageMagic is the magic used to find the beginning of the real // firmware image inside of a HP signed container-file HPImageMagic = []byte(`HPIMAGE`) )
Functions ¶
func CalculateOffsetFromPhysAddr ¶
CalculateOffsetFromPhysAddr calculates the offset within an image of the physical address (address to a region mapped from the SPI chip).
Examples:
CalculateOffsetFromPhysAddr(0xffffffff, 0x1000) == 0xfff CalculateOffsetFromPhysAddr(0xffffffc0, 0x1000) == 0xfc0
func CalculatePhysAddrFromTailOffset ¶
CalculatePhysAddrFromTailOffset calculates the physical address (address to a region mapped from the SPI chip) using an offset towards down, relatively to BasePhysAddr.
Examples:
CalculatePhysAddrFromTailOffset(0x01) == 0xffffffff CalculatePhysAddrFromTailOffset(0x40) == 0xffffffc0
func CalculateTailOffsetFromPhysAddr ¶
CalculateTailOffsetFromPhysAddr calculates the offset (towards down, relatively to BasePhysAddr) of the physical address (address to a region mapped from the SPI chip).
This is the reverse function to CalculatePhysAddrFromTailOffset()
Examples:
CalculateTailOffsetFromPhysAddr(0xffffffff) == 0x01 CalculateTailOffsetFromPhysAddr(0xffffffc0) == 0x40
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.