uefi

package
v0.0.0-...-e83addd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2021 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoadedImageProtocol                              = "5B1B31A1-9562-11D2-8E3F-00A0C969723B"
	ConsoleSupportTest_SimpleTextInputExProtocolTest = "DD9E7534-7762-4698-8C14-F58517A625AA"
)
View Source
const (
	AllocateAnyPages = iota
	AllocateMaxAddress
	AllocateAddress
	MaxAllocateType
)

allocate types They made the cardinal mistake of using 0-based contiguous range.

View Source
const (
	EfiReservedMemoryType = iota
	EfiLoaderCode
	EfiLoaderData
	EfiBootServicesCode
	EfiBootServicesData
	EfiRuntimeServicesCode
	EfiRuntimeServicesData
	EfiConventionalMemory
	EfiUnusableMemory
	EfiACPIReclaimMemory
	EfiACPIMemoryNVS
	EfiMemoryMappedIO
	EfiMemoryMappedIOPortSpace
	EfiPalCode
	EfiMaxMemoryType = EfiPalCode
)
View Source
const (
	UC = 1 << iota
	WC
	WT
	WB
	UCE
)

possible caching types for the memory range Caching Types

View Source
const (
	// physical memory protection on range
	WP = 1 << (iota + 12)
	RP
	XP
	All = RP | WP | XP
)
View Source
const (
	// range requires a runtime mapping
	RequiresRuntimeMapping = 0x8000000000000000
	// The memory descriptor version -- always 1.
	MemoryDescriptorVersion = 1
)
View Source
const (
	EFI_SUCCESS               = 0
	EFI_LOAD_ERROR            = (1)
	EFI_INVALID_PARAMETER     = (2)
	EFI_UNSUPPORTED           = (3)
	EFI_BAD_BUFFER_SIZE       = (4)
	EFI_BUFFER_TOO_SMALL      = (5)
	EFI_NOT_READY             = (6)
	EFI_DEVICE_ERROR          = (7)
	EFI_WRITE_PROTECTED       = (8)
	EFI_OUT_OF_RESOURCES      = (9)
	EFI_VOLUME_CORRUPTED      = (10)
	EFI_VOLUME_FULL           = (11)
	EFI_NO_MEDIA              = (12)
	EFI_MEDIA_CHANGED         = (13)
	EFI_NOT_FOUND             = (14)
	EFI_ACCESS_DENIED         = (15)
	EFI_NO_RESPONSE           = (16)
	EFI_NO_MAPPING            = (17)
	EFI_TIMEOUT               = (18)
	EFI_NOT_STARTED           = (19)
	EFI_ALREADY_STARTED       = (20)
	EFI_ABORTED               = (21)
	EFI_ICMP_ERROR            = (22)
	EFI_TFTP_ERROR            = (23)
	EFI_PROTOCOL_ERROR        = (24)
	EFI_INCOMPATIBLE_VERSION  = (25)
	EFI_SECURITY_VIOLATION    = (26)
	EFI_CRC_ERROR             = (27)
	EFI_END_OF_MEDIA          = (28)
	EFI_END_OF_FILE           = (31)
	EFI_INVALID_LANGUAGE      = (32)
	EFI_COMPROMISED_DATA      = (33)
	EFI_WARN_UNKOWN_GLYPH     = (1)
	EFI_WARN_UNKNOWN_GLYPH    = (1)
	EFI_WARN_DELETE_FAILURE   = (2)
	EFI_WARN_WRITE_FAILURE    = (3)
	EFI_WARN_BUFFER_TOO_SMALL = (4)
)

All the things we hate about UEFI in one convenient place

View Source
const (
	EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  = 0x00000001
	EFI_OPEN_PROTOCOL_GET_PROTOCOL        = 0x00000002
	EFI_OPEN_PROTOCOL_TEST_PROTOCOL       = 0x00000004
	EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER = 0x00000008
	EFI_OPEN_PROTOCOL_BY_DRIVER           = 0x00000010
	EFI_OPEN_PROTOCOL_EXCLUSIVE           = 0x00000020
)

oh, barf. Did someone just not get the memo about using more than a single bit and in particular not using 1 to mean something. Guess so.

Variables

View Source
var (
	BlockIOGUID                                          = guid.MustParse("964E5B21-6459-11D2-8E39-00A0C969723B")
	ConInGUID                                            = guid.MustParse("387477C1-69C7-11D2-8E39-0A00C969723B")
	ConOutGUID                                           = guid.MustParse("387477C2-69C7-11D2-8E39-0A00C969723B")
	LoadedImageGUID                                      = guid.MustParse(LoadedImageProtocol)
	ConsoleSupportTest_SimpleTextInputExProtocolTestGUID = guid.MustParse(ConsoleSupportTest_SimpleTextInputExProtocolTest)
)
View Source
var (
	EFIVariables = map[string]*EFIVariable{}
)

Functions

func EFIErr

func EFIErr(e EFIError) uintptr

EfiErrUint returns a uintptr for an EFI Error

Types

type EFIError

type EFIError struct {
	Err error
	Val uintptr
}

EFIError implements error

func (EFIError) Error

func (e EFIError) Error() string

func (EFIError) Is

func (e EFIError) Is(target error) bool

type EFIVariable

type EFIVariable struct {
	N    string
	Attr uintptr
	Data []byte
}

EFIVariable is a variable type. In our can't-make-this-shit-up category, GUIDs have a name and a variable. Name because nobody likes to just use GUIDs. GUID because names might collide. Could they have done a path, back in the day? Well, sure, but GUIDs are so wonderful! We store the name as the form NAME:GUID, where name is the string and GUID is the string form of the GUID.

func ReadVariable

func ReadVariable(n string, g guid.GUID) (*EFIVariable, error)

ReadVariable reads a UEFI variable

type MemRegion

type MemRegion struct {
	MType uint32 // Field size is 32 bits followed by 32 bit pad

	PA     paddr
	VA     vaddr
	Npages uint64
	Attr   uint64
	// contains filtered or unexported fields
}

MemRegion defines a single UEFI memory region

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL