1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241 |
- /*++
- Copyright (c) 2014 Minoca Corp.
- This file is licensed under the terms of the GNU General Public License
- version 3. Alternative licensing terms are available. Contact
- info@minocacorp.com for details. See the LICENSE file at the root of this
- project for complete licensing information.
- Module Name:
- spec.h
- Abstract:
- This header contains the primary UEFI specification definitions. Protocol
- definitions are defined elsewhere.
- Author:
- Evan Green 7-Feb-2014
- --*/
- //
- // ------------------------------------------------------------------- Includes
- //
- #include <minoca/uefi/protocol/devpath.h>
- #include <minoca/uefi/protocol/stextin.h>
- #include <minoca/uefi/protocol/stextinx.h>
- #include <minoca/uefi/protocol/stextout.h>
- //
- // ---------------------------------------------------------------- Definitions
- //
- //
- // Define EFI variable attributes.
- //
- #define EFI_VARIABLE_NON_VOLATILE 0x00000001
- #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
- #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
- //
- // Define the attribute for a hardware error record. This attribute is
- // identified by the mnemonic 'HR' elsewhere in the specification.
- //
- #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
- //
- // Define attributes of the Authenticated Variable.
- //
- #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
- #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
- #define EFI_VARIABLE_APPEND_WRITE 0x00000040
- //
- // Define flags for the daylight saving member of the EFI_TIME structure.
- //
- #define EFI_TIME_ADJUST_DAYLIGHT 0x01
- #define EFI_TIME_IN_DAYLIGHT 0x02
- //
- // Define the unspecified timezone value used in the time zone member of the
- // EFI_TIME structure.
- //
- #define EFI_UNSPECIFIED_TIMEZONE 0x07FF
- //
- // Define memory cacheability attributes.
- //
- #define EFI_MEMORY_UC 0x0000000000000001ULL
- #define EFI_MEMORY_WC 0x0000000000000002ULL
- #define EFI_MEMORY_WT 0x0000000000000004ULL
- #define EFI_MEMORY_WB 0x0000000000000008ULL
- #define EFI_MEMORY_UCE 0x0000000000000010ULL
- //
- // Define physical memory protection attributes.
- //
- #define EFI_MEMORY_WP 0x0000000000001000ULL
- #define EFI_MEMORY_RP 0x0000000000002000ULL
- #define EFI_MEMORY_XP 0x0000000000004000ULL
- //
- // Define runtime memory attributes.
- //
- #define EFI_MEMORY_RUNTIME 0x8000000000000000ULL
- //
- // Define memory descriptor version number.
- //
- #define EFI_MEMORY_DESCRIPTOR_VERSION 1
- //
- // Define the DebugDisposition values for the ConvertPointer service.
- //
- #define EFI_OPTIONAL_PTR 0x00000001
- //
- // Define flags for events.
- //
- #define EVT_TIMER 0x80000000
- #define EVT_RUNTIME 0x40000000
- #define EVT_NOTIFY_WAIT 0x00000100
- #define EVT_NOTIFY_SIGNAL 0x00000200
- #define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201
- #define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
- //
- // This flag is set if the notify context pointer is a runtime memory address.
- // This event is deprecated in UEFI2.0 and later specifications.
- //
- #define EVT_RUNTIME_CONTEXT 0x20000000
- //
- // Define task priority levels.
- //
- #define TPL_APPLICATION 4
- #define TPL_CALLBACK 8
- #define TPL_NOTIFY 16
- #define TPL_HIGH_LEVEL 31
- //
- // Define flags to the open protocol function.
- //
- #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
- #define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
- #define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
- #define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
- #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
- #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
- //
- // Define update capsule flags.
- //
- #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000
- #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
- #define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
- //
- // Define OS indications for update capsules.
- //
- #define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001
- #define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION 0x0000000000000002
- #define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004
- #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x0000000000000008
- #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x0000000000000010
- //
- // Definitions used in the EFI Runtime Services Table
- //
- #define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL
- #define EFI_2_40_SYSTEM_TABLE_REVISION ((2 << 16) | (40))
- #define EFI_2_31_SYSTEM_TABLE_REVISION ((2 << 16) | (31))
- #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
- #define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))
- #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))
- #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))
- #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))
- #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))
- #define EFI_SYSTEM_TABLE_REVISION EFI_2_40_SYSTEM_TABLE_REVISION
- #define EFI_SPECIFICATION_VERSION EFI_SYSTEM_TABLE_REVISION
- #define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544E5552ULL
- #define EFI_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_VERSION
- //
- // Definitions used in the EFI Boot Services Table
- //
- #define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544F4F42ULL
- #define EFI_BOOT_SERVICES_REVISION EFI_SPECIFICATION_VERSION
- //
- // Define EFI Load Options Attributes.
- //
- #define LOAD_OPTION_ACTIVE 0x00000001
- #define LOAD_OPTION_FORCE_RECONNECT 0x00000002
- #define LOAD_OPTION_HIDDEN 0x00000008
- #define LOAD_OPTION_CATEGORY 0x00001F00
- #define LOAD_OPTION_CATEGORY_BOOT 0x00000000
- #define LOAD_OPTION_CATEGORY_APP 0x00000100
- #define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001
- #define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002
- #define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300
- //
- // Define EFI File location to boot from on removable media devices.
- //
- #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"
- #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"
- #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"
- #define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI"
- #define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
- #if defined (EFI_X86)
- #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
- #elif defined (EFI_X64)
- #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64
- #elif defined (EFI_ARM)
- #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
- #elif defined (EFI_AARCH64)
- #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
- #else
- #error Unknown Processor Type
- #endif
- //
- // ------------------------------------------------------ Data Type Definitions
- //
- /*++
- Enumeration Description:
- This enumeration describes the memory types introduced in UEFI.
- Values:
- EfiReservedMemoryType - Indicates a reserved type that is not used.
- EfiLoaderCode - Indicates code portions of a loaded application. OS Loaders
- are UEFI applications.
- EfiLoaderData - Indicates data portions of a loaded application and the
- default allocation type used by an application to allocate pool memory.
- EfiBootServicesCode - Indicates the code portions of a loaded Boot Services
- Driver.
- EfiBootServicesData - Indicates the data portions of a loaded Boot Services
- Driver, and the default data allocation type used by a Boot Services
- Driver to allocate pool memory.
- EfiRuntimeServicesCode - Indicates the code portions of a loaded Runtime
- Services Driver.
- EfiRuntimeServicesData - Indicates the data portions of a loaded Runtime
- Services Driver and the default data allocation type used by a Runtime
- Services Driver to allocate pool memory.
- EfiConventionalMemory - Indicates free unallocated memory.
- EfiUnusableMemory - Indicates memory in which errors have been detected.
- EfiACPIReclaimMemory - Indicates memory that holds ACPI tables.
- EfiACPIMemoryNVS - Indicates address space reserved for use by the
- firmware.
- EfiMemoryMappedIO - Indicates a region used by system firmware to request
- that a memory-mapped I/O region be mapped by the OS to a virtual
- address so it can be accessed by EFI runtime services.
- EfiMemoryMappedIOPortSpace - Indicates a system memory-mapped I/O region
- that is used to translate memory cycles to I/O cycles by the processor.
- EfiPalCode - Indicates address space reserved by the firmware for code that
- is part of the processor.
- EfiMaxMemoryType - Indicates a type used to indicate the boundary of valid
- values.
- --*/
- typedef enum {
- EfiReservedMemoryType,
- EfiLoaderCode,
- EfiLoaderData,
- EfiBootServicesCode,
- EfiBootServicesData,
- EfiRuntimeServicesCode,
- EfiRuntimeServicesData,
- EfiConventionalMemory,
- EfiUnusableMemory,
- EfiACPIReclaimMemory,
- EfiACPIMemoryNVS,
- EfiMemoryMappedIO,
- EfiMemoryMappedIOPortSpace,
- EfiPalCode,
- EfiMaxMemoryType
- } EFI_MEMORY_TYPE;
- /*++
- Enumeration Description:
- This enumeration describes the allocation strategies that can be employed
- when allocating pages from UEFI.
- Values:
- AllocateAnyPages - Indicates to use any available pages that satisfy the
- request.
- AllocateMaxAddress - Indicates to allocate any range of pages whose
- uppermost address is less than or equal to the specified maximum
- address.
- AllocateAddress - Indicates to allocate pages at a specified address.
- MaxAllocateType - Indicates the maximum enumeration value, used only for
- bounds checking.
- --*/
- typedef enum {
- AllocateAnyPages,
- AllocateMaxAddress,
- AllocateAddress,
- MaxAllocateType
- } EFI_ALLOCATE_TYPE;
- /*++
- Enumeration Description:
- This enumeration describes timer delay types.
- Values:
- TimerCancel - Indicates an event should be cancelled.
- TimerPeriodic - Indicates the event is to be signaled periodically at a
- specified interval from the current time.
- TimerRelative - Indicates the event is to be singaled once at a specified
- interval from the current time.
- --*/
- typedef enum {
- TimerCancel,
- TimerPeriodic,
- TimerRelative
- } EFI_TIMER_DELAY;
- /*++
- Enumeration Description:
- This enumeration describes system reset types.
- Values:
- EfiResetCold - Indicates a system-wide reset. This sets all circuitry
- within the system to its initial state. This type of reset is
- asynchronous to system operation and operates without regard to cycle
- boundaries.
- EfiResetWarm - Indicates a system-wide initialization. The processors are
- set to their initial state, and pending cycles are not corrupted. If
- the system does not support this type, then a cold reset must be
- performed.
- EfiResetShutdown - Indicates entry into a power state equivalent to the
- ACPI G2/S5 or G3 state. If the system does not support this reset type,
- then when the system is rebooted, it should exhibit the cold reset
- attributes.
- EfiResetPlatformSpecific - Indicates a system-wide reset. The exact type of
- of reset is defined by the EFI_GUID that follows the null-terminated
- unicode string passed into the reset data. If a platform does not
- recognize the GUID in the reset data the platform must pick a supported
- reset type to perform. The platform may optionally log the parameters
- from any non-normal reset that occurs.
- --*/
- typedef enum {
- EfiResetCold,
- EfiResetWarm,
- EfiResetShutdown,
- EfiResetPlatformSpecific
- } EFI_RESET_TYPE;
- /*++
- Enumeration Description:
- This enumeration describes EFI interface types.
- Values:
- EFI_INTERFACE_NATIVE - Indicates the supplied protocol interface is
- supplied in native form.
- --*/
- typedef enum {
- EFI_NATIVE_INTERFACE
- } EFI_INTERFACE_TYPE;
- /*++
- Enumeration Description:
- This enumeration describes the EFI locate search types.
- Values:
- AllHandles - Indicates to retrieve all handles in the handle database.
- ByRegisterNotify - Indicates to retrieve the next handle from a
- RegisterProtocolNotify event.
- ByProtocol - Indicates to retrieve the set of handles that support a
- specified protocol.
- --*/
- typedef enum {
- AllHandles,
- ByRegisterNotify,
- ByProtocol
- } EFI_LOCATE_SEARCH_TYPE;
- /*++
- Structure Description:
- This structure describes the standard header that precedes all EFI tables.
- Members:
- Signature - Stores a 64-bit signature that identifies the type of table
- that follows.
- Revision - Stores the revision of the EFI specification to which this table
- conforms. The upper 16 bits contain the major revision, and the lower
- 16 bits contain the minor revision value. The minor revision values
- are limited to the range of 0 to 99, inclusive.
- HeaderSize - Stores the size, in bytes, of the entire table, including this
- header structure.
- CRC32 - Stores the 32-bit CRC for the entire table (whose length is defined
- in the header size field). This field is set to 0 during computation.
- Reserved - Stores a reserved field that must be set to zero.
- --*/
- typedef struct {
- UINT64 Signature;
- UINT32 Revision;
- UINT32 HeaderSize;
- UINT32 CRC32;
- UINT32 Reserved;
- } EFI_TABLE_HEADER;
- /*++
- Structure Description:
- This structure defines an EFI memory descriptor.
- Members:
- Type - Stores the type of memory. See the EFI_MEMORY_TYPE enum.
- Padding - Stores some padding to make the next member 8-byte aligned.
- PhysicalStart - Stores the physical address of the first byte of the memory
- region. This must be aligned on an EFI_PAGE_SIZE boundary.
- VirtualStart - Stores the virtual address of the first byte of the memory
- region. This must be aligned on an EFI_PAGE_SIZE boundary.
- NumberOfPages - Stores the number of pages described by the descriptor.
- Attribute - Stores a bitfield of memory attributes for that memory region.
- This is not necessarily the current settings for that region.
- --*/
- typedef struct {
- UINT32 Type;
- UINT32 Padding;
- EFI_PHYSICAL_ADDRESS PhysicalStart;
- EFI_VIRTUAL_ADDRESS VirtualStart;
- UINT64 NumberOfPages;
- UINT64 Attribute;
- } EFI_MEMORY_DESCRIPTOR;
- /*++
- Structure Description:
- This structure describes the capabilities of the real time clock device
- backing the get/set time services.
- Members:
- Resolution - Stores the reporting resolution of the real-time clock device
- in ticks per second. For a PC-AT CMOS RTC device, this value would be
- 1 Hz to indicate that the device reports timing to the nearest second.
- Accuracy - Stores the timekeeping accuracy of the real-time clock in an
- error rate of 1E-6 parts per million. For a clock with an accuracy of
- 50 parts per million, the value in this field would be 50 million.
- SetsToZero - Stores a boolean indicating that a time set operation clears
- the device's time below the reported resolution. If FALSE, the state
- below the reported resolution is not cleared when the time is set.
- PC-AT CMOS RTC devices set this value to FALSE.
- --*/
- typedef struct {
- UINT32 Resolution;
- UINT32 Accuracy;
- BOOLEAN SetsToZero;
- } EFI_TIME_CAPABILITIES;
- /*++
- Structure Description:
- This structure describes information about an open handle.
- Members:
- AgentHandle - Stores the handle of the agent that opened the handle.
- ControllerHandle - Stores the controller handle associated with the
- protocol.
- Attributes - Stores the attributes the handle was opened with.
- OpenCount - Stores the count of outstanding opens on these attributes.
- --*/
- typedef struct {
- EFI_HANDLE AgentHandle;
- EFI_HANDLE ControllerHandle;
- UINT32 Attributes;
- UINT32 OpenCount;
- } EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
- /*++
- Structure Description:
- This structure describes an EFI capsule block descriptor.
- Members:
- Length - Stores the length in bytes of the data pointed to by the
- data block or continuation pointer.
- DataBlock - Stores the physical address of the data block. This is used if
- the length is not zero.
- ContinuationPointer - Stores the physical address of another capsule block
- descriptor. This is used if the length is equal to zero. If this
- pointer is zero then this represents the end of the list.
- --*/
- typedef struct {
- UINT64 Length;
- union {
- EFI_PHYSICAL_ADDRESS DataBlock;
- EFI_PHYSICAL_ADDRESS ContinuationPointer;
- } Union;
- } EFI_CAPSULE_BLOCK_DESCRIPTOR;
- /*++
- Structure Description:
- This structure describes an EFI capsule header.
- Members:
- CapsuleGuid - Stores the GUID that defines the contents of the capsule.
- HeaderSize - Stores the size of the header, which can be bigger than the
- size of this structure if there are extended header entries.
- Flags - Stores a bitfield of flags describing the capsule attributes. The
- flag values 0x0000 - 0xFFFF are defined by the capsule GUID. Flag
- values of 0x10000 - 0xFFFFFFFF are defined by this specification.
- CapsuleImageSize - Stores the size in bytes of the capsule.
- --*/
- typedef struct {
- EFI_GUID CapsuleGuid;
- UINT32 HeaderSize;
- UINT32 Flags;
- UINT32 CapsuleImageSize;
- } EFI_CAPSULE_HEADER;
- /*++
- Structure Description:
- This structure an EFI capsule table. The EFI System Table entry must point
- to an array of capsules that contain the same capsule GUID value. The array
- must be prefixed by a UINT32 that represents the size of the array of
- capsules.
- Members:
- CapsuleArrayNumber - Stores the size of the array of capsules.
- CapsulePtr - Stores an array of capsules that contain the same capsule
- GUID value.
- --*/
- typedef struct {
- UINT32 CapsuleArrayNumber;
- VOID* CapsulePtr[1];
- } EFI_CAPSULE_TABLE;
- typedef
- EFI_STATUS
- (EFIAPI *EFI_ALLOCATE_PAGES) (
- EFI_ALLOCATE_TYPE Type,
- EFI_MEMORY_TYPE MemoryType,
- UINTN Pages,
- EFI_PHYSICAL_ADDRESS *Memory
- );
- /*++
- Routine Description:
- This routine allocates memory pages from the system.
- Arguments:
- Type - Supplies the allocation strategy to use.
- MemoryType - Supplies the memory type of the allocation.
- Pages - Supplies the number of contiguous EFI_PAGE_SIZE pages.
- Memory - Supplies a pointer that on input contains a physical address whose
- use depends on the allocation strategy. On output, the physical address
- of the allocation will be returned.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the Type or MemoryType are invalid, or Memory is
- NULL.
- EFI_OUT_OF_RESOURCES if the pages could not be allocated.
- EFI_NOT_FOUND if the requested pages could not be found.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_FREE_PAGES) (
- EFI_PHYSICAL_ADDRESS Memory,
- UINTN Pages
- );
- /*++
- Routine Description:
- This routine frees memory pages back to the system.
- Arguments:
- Memory - Supplies the base physical address of the allocation to free.
- Pages - Supplies the number of pages to free.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the memory is not page aligned or is invalid.
- EFI_NOT_FOUND if the requested pages were not allocated.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_GET_MEMORY_MAP) (
- UINTN *MemoryMapSize,
- EFI_MEMORY_DESCRIPTOR *MemoryMap,
- UINTN *MapKey,
- UINTN *DescriptorSize,
- UINT32 *DescriptorVersion
- );
- /*++
- Routine Description:
- This routine returns the current memory map.
- Arguments:
- MemoryMapSize - Supplies a pointer to the size, in bytes, of the memory
- map buffer. On input, this is the size of the buffer allocated by the
- caller. On output, this is the size of the buffer returned by the
- firmware if the buffer was large enough, or the size of the buffer
- needed if the buffer was too small.
- MemoryMap - Supplies a pointer to a caller-allocated buffer where the
- memory map will be written on success.
- MapKey - Supplies a pointer where the firmware returns the map key.
- DescriptorSize - Supplies a pointer where the firmware returns the size of
- the EFI_MEMORY_DESCRIPTOR structure.
- DescriptorVersion - Supplies a pointer where the firmware returns the
- version number associated with the EFI_MEMORY_DESCRIPTOR structure.
- Return Value:
- EFI_SUCCESS on success.
- EFI_BUFFER_TOO_SMALL if the supplied buffer was too small. The size needed
- is returned in the size parameter.
- EFI_INVALID_PARAMETER if the supplied size or memory map pointers are NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_ALLOCATE_POOL) (
- EFI_MEMORY_TYPE PoolType,
- UINTN Size,
- VOID **Buffer
- );
- /*++
- Routine Description:
- This routine allocates memory from the heap.
- Arguments:
- PoolType - Supplies the type of pool to allocate.
- Size - Supplies the number of bytes to allocate from the pool.
- Buffer - Supplies a pointer where a pointer to the allocated buffer will
- be returned on success.
- Return Value:
- EFI_SUCCESS on success.
- EFI_OUT_OF_RESOURCES if memory could not be allocated.
- EFI_INVALID_PARAMETER if the pool type was invalid or the buffer is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_FREE_POOL) (
- VOID *Buffer
- );
- /*++
- Routine Description:
- This routine frees heap allocated memory.
- Arguments:
- Buffer - Supplies a pointer to the buffer to free.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the buffer was invalid.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) (
- UINTN MemoryMapSize,
- UINTN DescriptorSize,
- UINT32 DescriptorVersion,
- EFI_MEMORY_DESCRIPTOR *VirtualMap
- );
- /*++
- Routine Description:
- This routine changes the runtime addressing mode of EFI firmware from
- physical to virtual.
- Arguments:
- MemoryMapSize - Supplies the size of the virtual map.
- DescriptorSize - Supplies the size of an entry in the virtual map.
- DescriptorVersion - Supplies the version of the structure entries in the
- virtual map.
- VirtualMap - Supplies the array of memory descriptors which contain the
- new virtual address mappings for all runtime ranges.
- Return Value:
- EFI_SUCCESS on success.
- EFI_UNSUPPORTED if the firmware is not at runtime, or the firmware is
- already in virtual address mapped mode.
- EFI_INVALID_PARAMETER if the descriptor size or version is invalid.
- EFI_NO_MAPPING if the virtual address was not supplied for a range in the
- memory map that requires a mapping.
- EFI_NOT_FOUND if a virtual address was supplied for an address that is not
- found in the memory map.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CONNECT_CONTROLLER) (
- EFI_HANDLE ControllerHandle,
- EFI_HANDLE *DriverImageHandle,
- EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath,
- BOOLEAN Recursive
- );
- /*++
- Routine Description:
- This routine connects one or more drivers to a controller.
- Arguments:
- ControllerHandle - Supplies the handle of the controller which driver(s)
- are connecting to.
- DriverImageHandle - Supplies a pointer to an ordered list of handles that
- support the EFI_DRIVER_BINDING_PROTOCOL.
- RemainingDevicePath - Supplies an optional pointer to the device path that
- specifies a child of the controller specified by the controller handle.
- Recursive - Supplies a boolean indicating if this routine should be called
- recursively until the entire tree of controllers below the specified
- controller has been connected. If FALSE, then the tree of controllers
- is only expanded one level.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the controller handle is NULL.
- EFI_NOT_FOUND if either there are no EFI_DRIVER_BINDING_PROTOCOL instances
- present in the system, or no drivers were connected to the controller
- handle.
- EFI_SECURITY_VIOLATION if the user has no permission to start UEFI device
- drivers on the device associated with the controller handle or specified
- by the remaining device path.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_DISCONNECT_CONTROLLER) (
- EFI_HANDLE ControllerHandle,
- EFI_HANDLE DriverImageHandle,
- EFI_HANDLE ChildHandle
- );
- /*++
- Routine Description:
- This routine disconnects one or more drivers to a controller.
- Arguments:
- ControllerHandle - Supplies the handle of the controller which driver(s)
- are disconnecting from.
- DriverImageHandle - Supplies an optional pointer to the driver to
- disconnect from the controller. If NULL, all drivers are disconnected.
- ChildHandle - Supplies an optional pointer to the handle of the child to
- destroy.
- Return Value:
- EFI_SUCCESS if one or more drivers were disconnected, no drivers are
- managing the handle, or a driver image handle was supplied and it is not
- controlling the given handle.
- EFI_INVALID_PARAMETER if the controller handle or driver handle is not a
- valid EFI handle, or the driver image handle doesn't support the
- EFI_DRIVER_BINDING_PROTOCOL.
- EFI_OUT_OF_RESOURCES if there are not enough resources are available to
- disconnect the controller(s).
- EFI_DEVICE_ERROR if the controller could not be disconnected because of a
- device error.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CONVERT_POINTER) (
- UINTN DebugDisposition,
- VOID **Address
- );
- /*++
- Routine Description:
- This routine determines the new virtual address that is to be used on
- subsequent memory accesses.
- Arguments:
- DebugDisposition - Supplies type information for the pointer being
- converted.
- Address - Supplies a pointer to a pointer that is to be fixed to be the
- value needed for the new virtual address mappings being applied.
- Return Value:
- EFI_SUCCESS if the pointer was modified.
- EFI_INVALID_PARAMETER if the address is NULL or the value of Address is
- NULL and the debug disposition does not have the EFI_OPTIONAL_PTR bit set.
- EFI_NOT_FOUND if the pointer pointed to by the address parameter was not
- found to be part of the current memory map. This is normally fatal.
- --*/
- typedef
- VOID
- (EFIAPI *EFI_EVENT_NOTIFY) (
- EFI_EVENT Event,
- VOID *Context
- );
- /*++
- Routine Description:
- This routine invokes a notification event.
- Arguments:
- Event - Supplies a pointer to the event to invoke.
- Context - Supplies a pointer to the notification function's context.
- Return Value:
- None.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CREATE_EVENT) (
- UINT32 Type,
- EFI_TPL NotifyTpl,
- EFI_EVENT_NOTIFY NotifyFunction,
- VOID *NotifyContext,
- EFI_EVENT *Event
- );
- /*++
- Routine Description:
- This routine creates an event.
- Arguments:
- Type - Supplies the type of event to create, as well as its mode and
- attributes.
- NotifyTpl - Supplies an optional task priority level of event notifications.
- NotifyFunction - Supplies an optional pointer to the event's notification
- function.
- NotifyContext - Supplies an optional context pointer that will be passed
- to the notify function when the event is signaled.
- Event - Supplies a pointer where the new event will be returned on success.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if one or more parameters are not valid.
- EFI_OUT_OF_RESOURCES if memory could not be allocated.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CREATE_EVENT_EX) (
- UINT32 Type,
- EFI_TPL NotifyTpl,
- EFI_EVENT_NOTIFY NotifyFunction,
- VOID *NotifyContext,
- EFI_GUID *EventGroup,
- EFI_EVENT *Event
- );
- /*++
- Routine Description:
- This routine creates an event.
- Arguments:
- Type - Supplies the type of event to create, as well as its mode and
- attributes.
- NotifyTpl - Supplies an optional task priority level of event notifications.
- NotifyFunction - Supplies an optional pointer to the event's notification
- function.
- NotifyContext - Supplies an optional context pointer that will be passed
- to the notify function when the event is signaled.
- EventGroup - Supplies an optional pointer to the unique identifier of the
- group to which this event belongs. If this is NULL, the function
- behaves as if the parameters were passed to the original create event
- function.
- Event - Supplies a pointer where the new event will be returned on success.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if one or more parameters are not valid.
- EFI_OUT_OF_RESOURCES if memory could not be allocated.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_SET_TIMER) (
- EFI_EVENT Event,
- EFI_TIMER_DELAY Type,
- UINT64 TriggerTime
- );
- /*++
- Routine Description:
- This routine sets the type of timer and trigger time for a timer event.
- Arguments:
- Event - Supplies the timer to set.
- Type - Supplies the type of trigger to set.
- TriggerTime - Supplies the number of 100ns units until the timer expires.
- Zero is legal, and means the timer will be signaled on the next timer
- tick.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the event or type is not valid.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_SIGNAL_EVENT) (
- EFI_EVENT Event
- );
- /*++
- Routine Description:
- This routine signals an event.
- Arguments:
- Event - Supplies the event to signal.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the given event is not valid.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_WAIT_FOR_EVENT) (
- UINTN NumberOfEvents,
- EFI_EVENT *Event,
- UINTN *Index
- );
- /*++
- Routine Description:
- This routine stops execution until an event is signaled.
- Arguments:
- NumberOfEvents - Supplies the number of events in the event array.
- Event - Supplies the array of EFI_EVENTs.
- Index - Supplies a pointer where the index of the event which satisfied the
- wait will be returned.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the number of events is zero, or the event
- indicated by the index return parameter is of type EVT_NOTIFY_SIGNAL.
- EFI_UNSUPPORTED if the current TPL is not TPL_APPLICATION.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CLOSE_EVENT) (
- EFI_EVENT Event
- );
- /*++
- Routine Description:
- This routine closes an event.
- Arguments:
- Event - Supplies the event to close.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the given event is invalid.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CHECK_EVENT) (
- EFI_EVENT Event
- );
- /*++
- Routine Description:
- This routine checks whether or not an event is in the signaled state.
- Arguments:
- Event - Supplies the event to check.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_READY if the event is not signaled.
- EFI_INVALID_PARAMETER if the event is of type EVT_NOTIFY_SIGNAL.
- --*/
- typedef
- EFI_TPL
- (EFIAPI *EFI_RAISE_TPL) (
- EFI_TPL NewTpl
- );
- /*++
- Routine Description:
- This routine raises the current Task Priority Level.
- Arguments:
- NewTpl - Supplies the new TPL to set.
- Return Value:
- Returns the previous TPL.
- --*/
- typedef
- VOID
- (EFIAPI *EFI_RESTORE_TPL) (
- EFI_TPL OldTpl
- );
- /*++
- Routine Description:
- This routine restores the Task Priority Level back to its original value
- before it was raised.
- Arguments:
- OldTpl - Supplies the original TPL to restore back to.
- Return Value:
- None.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_GET_VARIABLE) (
- CHAR16 *VariableName,
- EFI_GUID *VendorGuid,
- UINT32 *Attributes,
- UINTN *DataSize,
- VOID *Data
- );
- /*++
- Routine Description:
- This routine returns the value of a variable.
- Arguments:
- VariableName - Supplies a pointer to a null-terminated string containing
- the name of the vendor's variable.
- VendorGuid - Supplies a pointer to the unique GUID for the vendor.
- Attributes - Supplies an optional pointer where the attribute mask for the
- variable will be returned.
- DataSize - Supplies a pointer that on input contains the size of the data
- buffer. On output, the actual size of the data will be returned.
- Data - Supplies a pointer where the variable value will be returned.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if the variable was not found.
- EFI_BUFFER_TOO_SMALL if the supplied buffer is not big enough.
- EFI_INVALID_PARAMETER if the variable name, vendor GUID, or data size is
- NULL.
- EFI_DEVICE_ERROR if a hardware error occurred trying to read the variable.
- EFI_SECURITY_VIOLATION if the variable could not be retrieved due to an
- authentication failure.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) (
- UINTN *VariableNameSize,
- CHAR16 *VariableName,
- EFI_GUID *VendorGuid
- );
- /*++
- Routine Description:
- This routine enumerates the current variable names.
- Arguments:
- VariableNameSize - Supplies a pointer that on input contains the size of
- the variable name buffer. On output, will contain the size of the
- variable name.
- VariableName - Supplies a pointer that on input contains the last variable
- name that was returned. On output, returns the null terminated string
- of the current variable.
- VendorGuid - Supplies a pointer that on input contains the last vendor GUID
- returned by this routine. On output, returns the vendor GUID of the
- current variable.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if the next variable was not found.
- EFI_BUFFER_TOO_SMALL if the supplied buffer is not big enough.
- EFI_INVALID_PARAMETER if the variable name, vendor GUID, or data size is
- NULL.
- EFI_DEVICE_ERROR if a hardware error occurred trying to read the variable.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_SET_VARIABLE) (
- CHAR16 *VariableName,
- EFI_GUID *VendorGuid,
- UINT32 Attributes,
- UINTN DataSize,
- VOID *Data
- );
- /*++
- Routine Description:
- This routine sets the value of a variable.
- Arguments:
- VariableName - Supplies a pointer to a null-terminated string containing
- the name of the vendor's variable. Each variable name is unique for a
- particular vendor GUID. A variable name must be at least one character
- in length.
- VendorGuid - Supplies a pointer to the unique GUID for the vendor.
- Attributes - Supplies the attributes for this variable. See EFI_VARIABLE_*
- definitions.
- DataSize - Supplies the size of the data buffer. Unless the
- EFI_VARIABLE_APPEND_WRITE, EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or
- EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a
- size of zero causes the variable to be deleted. When the
- EFI_VARIABLE_APPEND_WRITE attribute is set, then a set variable call
- with a data size of zero will not cause any change to the variable
- value (the timestamp associated with the variable may be updated
- however even if no new data value is provided,see the description of
- the EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the
- data size will not be zero since the EFI_VARIABLE_AUTHENTICATION_2
- descriptor will be populated).
- Data - Supplies the contents of the variable.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if the variable being updated or deleted was not found.
- EFI_INVALID_PARAMETER if an invalid combination of attribute bits, name,
- and GUID was suplied, data size exceeds the maximum, or the variable name
- is an empty string.
- EFI_DEVICE_ERROR if a hardware error occurred trying to access the variable.
- EFI_WRITE_PROTECTED if the variable is read-only or cannot be deleted.
- EFI_SECURITY_VIOLATION if variable could not be written due to
- EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS or
- EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the
- authorization information does NOT pass the validation check carried out by
- the firmware.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_GET_TIME) (
- EFI_TIME *Time,
- EFI_TIME_CAPABILITIES *Capabilities
- );
- /*++
- Routine Description:
- This routine returns the current time and dat information, and
- timekeeping capabilities of the hardware platform.
- Arguments:
- Time - Supplies a pointer where the current time will be returned.
- Capabilities - Supplies an optional pointer where the capabilities will be
- returned on success.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the time parameter was NULL.
- EFI_DEVICE_ERROR if there was a hardware error accessing the device.
- EFI_UNSUPPORTED if the wakeup timer is not supported on this platform.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_SET_TIME) (
- EFI_TIME *Time
- );
- /*++
- Routine Description:
- This routine sets the current local time and date information.
- Arguments:
- Time - Supplies a pointer to the time to set.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if a time field is out of range.
- EFI_DEVICE_ERROR if there was a hardware error accessing the device.
- EFI_UNSUPPORTED if the wakeup timer is not supported on this platform.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_GET_WAKEUP_TIME) (
- BOOLEAN *Enabled,
- BOOLEAN *Pending,
- EFI_TIME *Time
- );
- /*++
- Routine Description:
- This routine gets the current wake alarm setting.
- Arguments:
- Enabled - Supplies a pointer that receives a boolean indicating if the
- alarm is currently enabled or disabled.
- Pending - Supplies a pointer that receives a boolean indicating if the
- alarm signal is pending and requires acknowledgement.
- Time - Supplies a pointer that receives the current wake time.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if any parameter is NULL.
- EFI_DEVICE_ERROR if there was a hardware error accessing the device.
- EFI_UNSUPPORTED if the wakeup timer is not supported on this platform.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_SET_WAKEUP_TIME) (
- BOOLEAN Enable,
- EFI_TIME *Time
- );
- /*++
- Routine Description:
- This routine sets the current wake alarm setting.
- Arguments:
- Enable - Supplies a boolean enabling or disabling the wakeup timer.
- Time - Supplies an optional pointer to the time to set. This parameter is
- only optional if the enable parameter is FALSE.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if a time field is out of range.
- EFI_DEVICE_ERROR if there was a hardware error accessing the device.
- EFI_UNSUPPORTED if the wakeup timer is not supported on this platform.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_IMAGE_LOAD) (
- BOOLEAN BootPolicy,
- EFI_HANDLE ParentImageHandle,
- EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- VOID *SourceBuffer,
- UINTN SourceSize,
- EFI_HANDLE *ImageHandle
- );
- /*++
- Routine Description:
- This routine loads an EFI image into memory.
- Arguments:
- BootPolicy - Supplies a boolean indicating that the request originates
- from the boot manager, and that the boot manager is attempting to load
- the given file path as a boot selection. This is ignored if the source
- buffer is NULL.
- ParentImageHandle - Supplies the caller's image handle.
- DevicePath - Supplies a pointer to the device path from which the image is
- loaded.
- SourceBuffer - Supplies an optional pointer to the memory location
- containing a copy of the image to be loaded.
- SourceSize - Supplies the size in bytes of the source buffer.
- ImageHandle - Supplies a pointer where the loaded image handle will be
- returned on success.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if both the source buffer and device path are NULL.
- EFI_INVALID_PARAMETER if one or more parameters are not valid.
- EFI_UNSUPPORTED if the image type is unsupported.
- EFI_OUT_OF_RESOURCES if an allocation failed.
- EFI_LOAD_ERROR if the image format was corrupt or not understood.
- EFI_DEVICE_ERROR if the underlying device returned a read error.
- EFI_ACCESS_DENIED if the platform policy prohibits the image from being
- loaded.
- EFI_SECURITY_VIOLATION if the image was successfully loaded, but the
- platform policy indicates the image should not be started.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_IMAGE_START) (
- EFI_HANDLE ImageHandle,
- UINTN *ExitDataSize,
- CHAR16 **ExitData
- );
- /*++
- Routine Description:
- This routine transfers control to a loaded image's entry point.
- Arguments:
- ImageHandle - Supplies the handle of the image to run.
- ExitDataSize - Supplies a pointer to the size, in bytes, of the exit data.
- ExitData - Supplies an optional pointer where a pointer will be returned
- that includes a null-terminated string, optionally followed by
- additional binary data.
- Return Value:
- EFI_INVALID_PARAMETER if the image handle is invalid or the image has
- already been started.
- EFI_SECURITY_VIOLATION if the platform policy specifies the image should
- not be started.
- Otherwise, returns the exit code from the image.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_EXIT) (
- EFI_HANDLE ImageHandle,
- EFI_STATUS ExitStatus,
- UINTN ExitDataSize,
- CHAR16 *ExitData
- );
- /*++
- Routine Description:
- This routine terminates an loaded EFI image and returns control to boot
- services.
- Arguments:
- ImageHandle - Supplies the handle of the image passed upon entry.
- ExitStatus - Supplies the exit code.
- ExitDataSize - Supplies the size of the exit data. This is ignored if the
- exit status code is EFI_SUCCESS.
- ExitData - Supplies an optional pointer where a pointer will be returned
- that includes a null-terminated string describing the reason the
- application exited, optionally followed by additional binary data. This
- buffer must be allocated from AllocatePool.
- Return Value:
- EFI_SUCCESS if the image was unloaded.
- EFI_INVALID_PARAMETER if the image has been loaded and started with
- LoadImage and StartImage, but the image is not currently executing.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_IMAGE_UNLOAD) (
- EFI_HANDLE ImageHandle
- );
- /*++
- Routine Description:
- This routine unloads an image.
- Arguments:
- ImageHandle - Supplies the handle of the image to unload.
- ExitStatus - Supplies the exit code.
- ExitDataSize - Supplies the size of the exit data. This is ignored if the
- exit status code is EFI_SUCCESS.
- ExitData - Supplies an optional pointer where a pointer will be returned
- that includes a null-terminated string describing the reason the
- application exited, optionally followed by additional binary data. This
- buffer must be allocated from AllocatePool.
- Return Value:
- EFI_SUCCESS if the image was unloaded.
- EFI_INVALID_PARAMETER if the image handle is not valid.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_EXIT_BOOT_SERVICES) (
- EFI_HANDLE ImageHandle,
- UINTN MapKey
- );
- /*++
- Routine Description:
- This routine terminates all boot services.
- Arguments:
- ImageHandle - Supplies the handle that identifies the exiting image.
- MapKey - Supplies the latest memory map key.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the map key is incorrect.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_STALL) (
- UINTN Microseconds
- );
- /*++
- Routine Description:
- This routine induces a fine-grained delay.
- Arguments:
- Microseconds - Supplies the number of microseconds to stall execution for.
- Return Value:
- EFI_SUCCESS on success.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_SET_WATCHDOG_TIMER) (
- UINTN Timeout,
- UINT64 WatchdogCode,
- UINTN DataSize,
- CHAR16 *WatchdogData
- );
- /*++
- Routine Description:
- This routine sets the system's watchdog timer.
- Arguments:
- Timeout - Supplies the number of seconds to set the timer for.
- WatchdogCode - Supplies a numeric code to log on a watchdog timeout event.
- DataSize - Supplies the size of the watchdog data.
- WatchdogData - Supplies an optional buffer that includes a null-terminated
- string, optionally followed by additional binary data.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the supplied watchdog code is invalid.
- EFI_UNSUPPORTED if there is no watchdog timer.
- EFI_DEVICE_ERROR if an error occurred accessing the device hardware.
- --*/
- typedef
- VOID
- (EFIAPI *EFI_RESET_SYSTEM) (
- EFI_RESET_TYPE ResetType,
- EFI_STATUS ResetStatus,
- UINTN DataSize,
- VOID *ResetData
- );
- /*++
- Routine Description:
- This routine resets the entire platform.
- Arguments:
- ResetType - Supplies the type of reset to perform.
- ResetStatus - Supplies the status code for this reset.
- DataSize - Supplies the size of the reset data.
- ResetData - Supplies an optional pointer for reset types of cold, warm, or
- shutdown to a null-terminated string, optionally followed by additional
- binary data.
- Return Value:
- None. This routine does not return.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) (
- UINT64 *Count
- );
- /*++
- Routine Description:
- This routine returns a monotonically increasing count for the platform.
- Arguments:
- Count - Supplies a pointer where the next count is returned.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the count is NULL.
- EFI_DEVICE_ERROR if the device is not functioning properly.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (
- UINT32 *HighCount
- );
- /*++
- Routine Description:
- This routine returns the next high 32 bits of the platform's monotonic
- counter.
- Arguments:
- HighCount - Supplies a pointer where the value is returned.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if the count is NULL.
- EFI_DEVICE_ERROR if the device is not functioning properly.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CALCULATE_CRC32) (
- VOID *Data,
- UINTN DataSize,
- UINT32 *Crc32
- );
- /*++
- Routine Description:
- This routine computes the 32-bit CRC for a data buffer.
- Arguments:
- Data - Supplies a pointer to the buffer to compute the CRC on.
- DataSize - Supplies the size of the data buffer in bytes.
- Crc32 - Supplies a pointer where the 32-bit CRC will be returned.
- Return Value:
- EFI_SUCCESS on success.
- EFI_INVALID_PARAMETER if any parameter is NULL, or the data size is zero.
- --*/
- typedef
- VOID
- (EFIAPI *EFI_COPY_MEM) (
- VOID *Destination,
- VOID *Source,
- UINTN Length
- );
- /*++
- Routine Description:
- This routine copies the contents of one buffer to another.
- Arguments:
- Destination - Supplies a pointer to the destination of the copy.
- Source - Supplies a pointer to the source of the copy.
- Length - Supplies the number of bytes to copy.
- Return Value:
- None.
- --*/
- typedef
- VOID
- (EFIAPI *EFI_SET_MEM) (
- VOID *Buffer,
- UINTN Size,
- UINT8 Value
- );
- /*++
- Routine Description:
- This routine fills a buffer with a specified value.
- Arguments:
- Buffer - Supplies a pointer to the buffer to fill.
- Size - Supplies the size of the buffer in bytes.
- Value - Supplies the value to fill the buffer with.
- Return Value:
- None.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
- EFI_HANDLE *Handle,
- EFI_GUID *Protocol,
- EFI_INTERFACE_TYPE InterfaceType,
- VOID *Interface
- );
- /*++
- Routine Description:
- This routine installs a protocol interface on a device handle. If the
- handle does not exist, it is created and added to the list of handles in
- the system. InstallMultipleProtocolInterfaces performs more error checking
- than this routine, so it is recommended to be used in place of this
- routine.
- Arguments:
- Handle - Supplies a pointer to the EFI handle on which the interface is to
- be installed.
- Protocol - Supplies a pointer to the numeric ID of the protocol interface.
- InterfaceType - Supplies the interface type.
- Interface - Supplies a pointer to the protocol interface.
- Return Value:
- EFI_SUCCESS on success.
- EFI_OUT_OF_RESOURCES if memory could not be allocated.
- EFI_INVALID_PARAMETER if the handle or protocol is NULL, the interface type
- is not native, or the protocol is already install on the given handle.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
- EFI_HANDLE *Handle,
- ...
- );
- /*++
- Routine Description:
- This routine installs one or more protocol interface into the boot
- services environment.
- Arguments:
- Handle - Supplies a pointer to the EFI handle on which the interface is to
- be installed, or a pointer to NULL if a new handle is to be allocated.
- ... - Supplies a variable argument list containing pairs of protocol GUIDs
- and protocol interfaces.
- Return Value:
- EFI_SUCCESS on success.
- EFI_OUT_OF_RESOURCES if memory could not be allocated.
- EFI_ALREADY_STARTED if a device path protocol instance was passed in that
- is already present in the handle database.
- EFI_INVALID_PARAMETER if the handle is NULL or the protocol is already
- installed on the given handle.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (
- EFI_HANDLE Handle,
- EFI_GUID *Protocol,
- VOID *OldInterface,
- VOID *NewInterface
- );
- /*++
- Routine Description:
- This routine reinstalls a protocol interface on a device handle.
- Arguments:
- Handle - Supplies the device handle on which the interface is to be
- reinstalled.
- Protocol - Supplies a pointer to the numeric ID of the interface.
- OldInterface - Supplies a pointer to the old interface. NULL can be used if
- a structure is not associated with the protocol.
- NewInterface - Supplies a pointer to the new interface.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if the old interface was not found.
- EFI_ACCESS_DENIED if the protocl interface could not be reinstalled because
- the old interface is still being used by a driver that will not release it.
- EFI_INVALID_PARAMETER if the handle or protocol is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (
- EFI_HANDLE Handle,
- EFI_GUID *Protocol,
- VOID *Interface
- );
- /*++
- Routine Description:
- This routine removes a protocol interface from a device handle. It is
- recommended that UninstallMultipleProtocolInterfaces be used in place of
- this routine.
- Arguments:
- Handle - Supplies the device handle on which the interface is to be
- removed.
- Protocol - Supplies a pointer to the numeric ID of the interface.
- Interface - Supplies a pointer to the interface.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if the old interface was not found.
- EFI_ACCESS_DENIED if the protocl interface could not be reinstalled because
- the old interface is still being used by a driver that will not release it.
- EFI_INVALID_PARAMETER if the handle or protocol is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
- EFI_HANDLE Handle,
- ...
- );
- /*++
- Routine Description:
- This routine removes one or more protocol interfaces into the boot services
- environment.
- Arguments:
- Handle - Supplies the device handle on which the interface is to be
- removed.
- ... - Supplies a variable argument list containing pairs of protocol GUIDs
- and protocol interfaces.
- Return Value:
- EFI_SUCCESS if all of the requested protocol interfaces were removed.
- EFI_INVALID_PARAMETER if one of the protocol interfaces was not previously
- installed on the given.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_HANDLE_PROTOCOL) (
- EFI_HANDLE Handle,
- EFI_GUID *Protocol,
- VOID **Interface
- );
- /*++
- Routine Description:
- This routine queries a handle to determine if it supports a specified
- protocol.
- Arguments:
- Handle - Supplies the handle being queried.
- Protocol - Supplies the published unique identifier of the protocol.
- Interface - Supplies the address where a pointer to the corresponding
- protocol interface is returned.
- Return Value:
- EFI_SUCCESS if the interface information was returned.
- EFI_UNSUPPORTED if the device not support the specified protocol.
- EFI_INVALID_PARAMETER if the handle, protocol, or interface is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_OPEN_PROTOCOL) (
- EFI_HANDLE Handle,
- EFI_GUID *Protocol,
- VOID **Interface,
- EFI_HANDLE AgentHandle,
- EFI_HANDLE ControllerHandle,
- UINT32 Attributes
- );
- /*++
- Routine Description:
- This routine queries a handle to determine if it supports a specified
- protocol. If the protocol is supported by the handle, it opens the protocol
- on behalf of the calling agent.
- Arguments:
- Handle - Supplies the handle for the protocol interface that is being
- opened.
- Protocol - Supplies the published unique identifier of the protocol.
- Interface - Supplies the address where a pointer to the corresponding
- protocol interface is returned.
- AgentHandle - Supplies the handle of the agent that is opening the protocol
- interface specified by the protocol and interface.
- ControllerHandle - Supplies the controller handle that requires the
- protocl interface if the caller is a driver that follows the UEFI
- driver model. If the caller does not follow the UEFI Driver Model, then
- this parameter is optional.
- Attributes - Supplies the open mode of the protocol interface specified by
- the given handle and protocol.
- Return Value:
- EFI_SUCCESS if the interface information was returned.
- EFI_UNSUPPORTED if the handle not support the specified protocol.
- EFI_INVALID_PARAMETER if a parameter is invalid.
- EFI_ACCESS_DENIED if the required attributes can't be supported in the
- current environment.
- EFI_ALREADY_STARTED if the item on the open list already has required
- attributes whose agent handle is the same as the given one.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_CLOSE_PROTOCOL) (
- EFI_HANDLE Handle,
- EFI_GUID *Protocol,
- EFI_HANDLE AgentHandle,
- EFI_HANDLE ControllerHandle
- );
- /*++
- Routine Description:
- This routine closes a protocol on a handle that was previously opened.
- Arguments:
- Handle - Supplies the handle for the protocol interface was previously
- opened.
- Protocol - Supplies the published unique identifier of the protocol.
- AgentHandle - Supplies the handle of the agent that is closing the
- protocol interface.
- ControllerHandle - Supplies the controller handle that required the
- protocl interface if the caller is a driver that follows the UEFI
- driver model. If the caller does not follow the UEFI Driver Model, then
- this parameter is optional.
- Return Value:
- EFI_SUCCESS if the interface information was returned.
- EFI_INVALID_PARAMETER if the handle, agent, or protocol is NULL, or if the
- controller handle is not NULL and the controller handle is not valid.
- EFI_NOT_FOUND if the handle does not support the given protocol, or the
- protocol interface is not currently open by the agent and controller
- handles.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
- EFI_HANDLE Handle,
- EFI_GUID *Protocol,
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
- UINTN *EntryCount
- );
- /*++
- Routine Description:
- This routine retrieves a list of agents that currently have a protocol
- interface opened.
- Arguments:
- Handle - Supplies the handle for the protocol interface being queried.
- Protocol - Supplies the published unique identifier of the protocol.
- EntryBuffer - Supplies a pointer where a pointer to a buffer of open
- protocol information in the form of EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
- structures will be returned.
- EntryCount - Supplies a pointer that receives the number of entries in the
- buffer.
- Return Value:
- EFI_SUCCESS if the interface information was returned.
- EFI_OUT_OF_RESOURCES if an allocation failed.
- EFI_NOT_FOUND if the handle does not support the given protocol.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
- EFI_HANDLE Handle,
- EFI_GUID ***ProtocolBuffer,
- UINTN *ProtocolBufferCount
- );
- /*++
- Routine Description:
- This routine retrieves the list of protocol interface GUIDs that are
- installed on a handle in a buffer allocated from pool.
- Arguments:
- Handle - Supplies the handle from which to retrieve the list of protocol
- interface GUIDs.
- ProtocolBuffer - Supplies a pointer to the list of protocol interface GUID
- pointers that are installed on the given handle.
- ProtocolBufferCount - Supplies a pointer to the number of GUID pointers
- present in the protocol buffer.
- Return Value:
- EFI_SUCCESS if the interface information was returned.
- EFI_OUT_OF_RESOURCES if an allocation failed.
- EFI_INVALID_PARAMETER if the handle is NULL or invalid, or the protocol
- buffer or count is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (
- EFI_GUID *Protocol,
- EFI_EVENT Event,
- VOID **Registration
- );
- /*++
- Routine Description:
- This routine creates an event that is to be signaled whenever an interface
- is installed for a specified protocol.
- Arguments:
- Protocol - Supplies the numeric ID of the protocol for which the event is
- to be registered.
- Event - Supplies the event that is to be signaled whenever a protocol
- interface is registered for the given protocol.
- Registration - Supplies a pointer to a memory location to receive the
- registration value.
- Return Value:
- EFI_SUCCESS on success.
- EFI_OUT_OF_RESOURCES if an allocation failed.
- EFI_INVALID_PARAMETER if the protocol, event, or registration is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_LOCATE_HANDLE) (
- EFI_LOCATE_SEARCH_TYPE SearchType,
- EFI_GUID *Protocol,
- VOID *SearchKey,
- UINTN *BufferSize,
- EFI_HANDLE *Buffer
- );
- /*++
- Routine Description:
- This routine returns an array of handles that support a specified protocol.
- Arguments:
- SearchType - Supplies which handle(s) are to be returned.
- Protocol - Supplies an optional pointer to the protocols to search by.
- SearchKey - Supplies an optional pointer to the search key.
- BufferSize - Supplies a pointer that on input contains the size of the
- result buffer in bytes. On output, the size of the result array will be
- returned (even if the buffer was too small).
- Buffer - Supplies a pointer where the results will be returned.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if no handles match the search.
- EFI_BUFFER_TOO_SMALL if the given buffer wasn't big enough to hold all the
- results.
- EFI_INVALID_PARAMETER if the serach type is invalid, one of the parameters
- required by the given search type was NULL, one or more matches are found
- and the buffer size is NULL, or the buffer size is large enough and the
- buffer is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_LOCATE_DEVICE_PATH) (
- EFI_GUID *Protocol,
- EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- EFI_HANDLE *Device
- );
- /*++
- Routine Description:
- This routine attempts to locate the handle to a device on the device path
- that supports the specified protocol.
- Arguments:
- Protocol - Supplies a pointer to the protocol to search for.
- DevicePath - Supplies a pointer that on input contains a pointer to the
- device path. On output, the path pointer is modified to point to the
- remaining part of the device path.
- Device - Supplies a pointer where the handle of the device will be
- returned.
- Return Value:
- EFI_SUCCESS if a handle was returned.
- EFI_NOT_FOUND if no handles match the search.
- EFI_INVALID_PARAMETER if the protocol is NULL, device path is NULL, or a
- handle matched and the device is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
- EFI_GUID *Guid,
- VOID *Table
- );
- /*++
- Routine Description:
- This routine adds, updates, or removes a configuration table entry from the
- EFI System Table.
- Arguments:
- Guid - Supplies a pointer to the GUID for the entry to add, update, or
- remove.
- Table - Supplies a pointer to the configuration table for the entry to add,
- update, or remove. This may be NULL.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if an attempt was made to delete a nonexistant entry.
- EFI_INVALID_PARAMETER if the GUID is NULL.
- EFI_OUT_OF_RESOURCES if an allocation failed.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
- EFI_LOCATE_SEARCH_TYPE SearchType,
- EFI_GUID *Protocol,
- VOID *SearchKey,
- UINTN *HandleCount,
- EFI_HANDLE **Buffer
- );
- /*++
- Routine Description:
- This routine returns an array of handles that support the requested
- protocol in a buffer allocated from pool.
- Arguments:
- SearchType - Supplies the search behavior.
- Protocol - Supplies a pointer to the protocol to search by.
- SearchKey - Supplies a pointer to the search key.
- HandleCount - Supplies a pointer where the number of handles will be
- returned.
- Buffer - Supplies a pointer where an array will be returned containing the
- requested handles.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if no handles match the search.
- EFI_INVALID_PARAMETER if the handle count or buffer is NULL.
- EFI_OUT_OF_RESOURCES if an allocation failed.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_LOCATE_PROTOCOL) (
- EFI_GUID *Protocol,
- VOID *Registration,
- VOID **Interface
- );
- /*++
- Routine Description:
- This routine returns the first protocol instance that matches the given
- protocol.
- Arguments:
- Protocol - Supplies a pointer to the protocol to search by.
- Registration - Supplies a pointer to an optional registration key
- returned from RegisterProtocolNotify.
- Interface - Supplies a pointer where a pointer to the first interface that
- matches will be returned on success.
- Return Value:
- EFI_SUCCESS on success.
- EFI_NOT_FOUND if no protocol instances matched the search.
- EFI_INVALID_PARAMETER if the interface is NULL.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_UPDATE_CAPSULE) (
- EFI_CAPSULE_HEADER **CapsuleHeaderArray,
- UINTN CapsuleCount,
- EFI_PHYSICAL_ADDRESS ScatterGatherList
- );
- /*++
- Routine Description:
- This routine passes capsules to the firmware with both virtual and physical
- mapping. Depending on the intended consumption, the firmware may process
- the capsule immediately. If the payload should persist across a system
- reset, the reset value returned from EFI_QueryCapsuleCapabilities must be
- passed into ResetSystem and will cause the capsule to be processed by the
- firmware as part of the reset process.
- Arguments:
- CapsuleHeaderArray - Supplies a virtual pointer to an array of virtual
- pointers to the capsules being passed into update capsule.
- CapsuleCount - Supplies the number of pointers to EFI_CAPSULE_HEADERs in
- the capsule header array.
- ScatterGatherList - Supplies an optional physical pointer to a set of
- EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the location in physical
- memory of a set of capsules.
- Return Value:
- EFI_SUCCESS if a valid capsule was passed. If
- CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the capsule has been
- successfully processed by the firmware.
- EFI_INVALID_PARAMETER if the capsule size is NULL, the capsule count is
- zero, or an incompatible set of flags were set in the capsule header.
- EFI_DEVICE_ERROR if the capsule update was started, but failed due to a
- device error.
- EFI_UNSUPPORTED if the capsule type is not supported on this platform.
- EFI_OUT_OF_RESOURCES if resources could not be allocated. If this call
- originated during runtime, this error is returned if the caller must retry
- the call during boot services.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES) (
- EFI_CAPSULE_HEADER **CapsuleHeaderArray,
- UINTN CapsuleCount,
- UINT64 *MaximumCapsuleSize,
- EFI_RESET_TYPE *ResetType
- );
- /*++
- Routine Description:
- This routine returns whether or not the capsule is supported via the
- UpdateCapsule routine.
- Arguments:
- CapsuleHeaderArray - Supplies a virtual pointer to an array of virtual
- pointers to the capsules being passed into update capsule.
- CapsuleCount - Supplies the number of pointers to EFI_CAPSULE_HEADERs in
- the capsule header array.
- MaximumCapsuleSize - Supplies a pointer that on output contains the maximum
- size that the update capsule routine can support as an argument to
- the update capsule routine.
- ResetType - Supplies a pointer where the reset type required to perform the
- capsule update is returned.
- Return Value:
- EFI_SUCCESS if a valid answer was returned.
- EFI_UNSUPPORTED if the capsule type is not supported on this platform.
- EFI_DEVICE_ERROR if the capsule update was started, but failed due to a
- device error.
- EFI_INVALID_PARAMETER if the maximum capsule size is NULL.
- EFI_OUT_OF_RESOURCES if resources could not be allocated. If this call
- originated during runtime, this error is returned if the caller must retry
- the call during boot services.
- --*/
- typedef
- EFI_STATUS
- (EFIAPI *EFI_QUERY_VARIABLE_INFO) (
- UINT32 Attributes,
- UINT64 *MaximumVariableStorageSize,
- UINT64 *RemainingVariableStorageSize,
- UINT64 *MaximumVariableSize
- );
- /*++
- Routine Description:
- This routine returns information about EFI variables.
- Arguments:
- Attributes - Supplies a bitmask of attributes specifying the type of
- variables on which to return information.
- MaximumVariableStorageSize - Supplies a pointer where the maximum size of
- storage space for EFI variables with the given attributes will be
- returned.
- RemainingVariableStorageSize - Supplies a pointer where the remaining size
- of the storage space available for EFI variables associated with the
- attributes specified will be returned.
- MaximumVariableSize - Supplies a pointer where the maximum size of an
- individual variable will be returned on success.
- Return Value:
- EFI_SUCCESS if a valid answer was returned.
- EFI_UNSUPPORTED if the attribute is not supported on this platform.
- EFI_INVALID_PARAMETER if an invalid combination of attributes was supplied.
- --*/
- /*++
- Structure Description:
- This structure defines the EFI Runtime Services Table.
- Members:
- Hdr - Stores the standard header for an EFI table.
- GetTime - Stores a pointer to a function for getting the current time.
- SetTime - Stores a pointer to a function for setting the current time.
- GetWakeupTime - Stores a pointer to a function for getting the current
- wake alarm time.
- SetWakeupTime - Stores a pointer to a function for setting (or disabling)
- the wake alarm.
- SetVirtualAddressMap - Stores a pointer to a function used to enable
- running EFI runtime services with virtual-to-physical translation (the
- MMU) enabled.
- ConvertPointer - Stores a pointer to a function used to convert a pointer
- into a virtual runtime pointer.
- GetVariable - Stores a pointer to a function used to get the value of an
- EFI variable.
- GetNextVariableName - Stores a pointer to a function used to iterate
- through a set of variables.
- SetVariable - Stores a pointer to a function used to set or delete an
- EFI variable.
- GetNextHighMonotonicCount - Stores a pointer to a function used to get
- the high 32-bits of a monotonically increasing number.
- ResetSystem - Stores a pointer to a function used to shut down or reset
- the platform.
- UpdateCapsule - Stores a pointer to a function used to send an update
- capsule to firmware.
- QueryCapsuleCapabilities - Stores a pointer to a function used to
- interrogate the firmware about update capsule capabilities.
- QueryVariableInfo - Stores a pointer to a function used to get
- information about EFI variable storage.
- --*/
- typedef struct {
- EFI_TABLE_HEADER Hdr;
- EFI_GET_TIME GetTime;
- EFI_SET_TIME SetTime;
- EFI_GET_WAKEUP_TIME GetWakeupTime;
- EFI_SET_WAKEUP_TIME SetWakeupTime;
- EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;
- EFI_CONVERT_POINTER ConvertPointer;
- EFI_GET_VARIABLE GetVariable;
- EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
- EFI_SET_VARIABLE SetVariable;
- EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;
- EFI_RESET_SYSTEM ResetSystem;
- EFI_UPDATE_CAPSULE UpdateCapsule;
- EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities;
- EFI_QUERY_VARIABLE_INFO QueryVariableInfo;
- } EFI_RUNTIME_SERVICES;
- /*++
- Structure Description:
- This structure defines the EFI Boot Services Table.
- Members:
- Hdr - Stores the standard header for an EFI table.
- RaiseTPL - Stores a pointer to a function for raising the current Task
- Priority Level.
- RestoreTPL - Stores a pointer to a function for restoring a previous Task
- Priority Level.
- AllocatePages - Stores a pointer to a function for allocating pages from
- EFI firmware.
- FreePages - Stores a pointer to a function for freeing pages previously
- allocated.
- GetMemoryMap - Stores a pointer to a function for returning the current
- memory map.
- AllocatePool - Stores a pointer to a function for allocating heap memory.
- FreePool - Stores a pointer to a function for freeing heap allocated
- memory.
- CreateEvent - Stores a pointer to a function for creating an event or
- timer.
- SetTimer - Stores a pointer to a function for setting the trigger on a
- timer.
- WaitForEvent - Stores a pointer to a function for waiting until an event
- is triggered.
- SignalEvent - Stores a pointer to a function for signaling an event.
- CloseEvent - Stores a pointer to a function for closing an event.
- CheckEvent - Stores a pointer to a function for determining if an event
- is signaled.
- InstallProtocolInterface - Stores a pointer to a function for adding
- a protocol to a handle (or creating a new handle).
- ReinstallProtocolInterface - Stores a pointer to a function for
- reinstalling a protocol on a handle.
- UninstallProtocolInterface - Stores a pointer to a function for removing
- a protocol from a handle.
- HandleProtocol - Stores a pointer to a function for determining if a
- handle supports a given protocol.
- Reserved - Stores a reserved pointer. Ignore this.
- RegisterProtocolNotify - Stores a pointer to a function for registering
- for notifications when a protocol is added to a handle.
- LocateHandle - Stores a pointer to a function for locating a handle
- associated with a protocol.
- LocateDevicePath - Stores a pointer to a function for locating a handle on
- a given device path that supports a given protocol.
- InstallConfigurationTable - Stores a pointer to a function for adding a
- configuration table to the firmware.
- LoadImage - Stores a pointer to a function for loading a new EFI image.
- StartImage - Stores a pointer to a function for starting a loaded EFI image.
- Exit - Stores a pointer to a function for exiting an application.
- UnloadImage - Stores a pointer to a function for unloading a loaded EFI
- image.
- ExitBootServices - Stores a pointer to a function for terminating boot
- services.
- GetNextMonotonicCount - Stores a pointer to a function for getting a
- monotonically increasing value.
- Stall - Stores a pointer to a function for performing fine-grained delays.
- SetWatchdogTimer - Stores a pointer to a function for setting a platform
- watchdog timer.
- ConnectController - Stores a pointer to a function for connecting a driver
- to a device controller handle.
- DisconnectController - Stores a pointer to a function for disconnecting a
- driver from a device controller handle.
- OpenProtocol - Stores a pointer to a function for opening a protocol
- interface on a handle.
- CloseProtocol - Stores a pointer to a function for closing a previously
- opened protocol interface on a handle.
- OpenProtocolInformation - Stores a pointer to a function for getting a list
- of agents that currently have a protocol interface opened.
- ProtocolsPerHandle - Stores a pointer to a function for returning a list of
- protocol interface GUIDs that are installed on a handle.
- LocateHandleBuffer - Stores a pointer to a function for getting the list of
- handles that support the requested protocol.
- LocateProtocol - Stores a pointer to a function that returns the first
- protocol instance that matches a given protocol.
- InstallMultipleProtocolInterfaces - Stores a pointer to a function for
- installing one or more protocol interfaces on a handle.
- UninstallMultipleProtocolInterfaces - Stores a pointer to a function for
- uninstalling one or more protocol interfaces from a handle.
- CalculateCrc32 - Stores a pointer to a function for calculating the CRC32
- of a given buffer.
- CopyMem - Stores a pointer to a function for copying memory buffers.
- SetMem - Stores a pointer to a function for initializing memory buffers.
- CreateEventEx - Stores a pointer to a function for creating an event
- optionally associated with a particular event group.
- --*/
- typedef struct {
- EFI_TABLE_HEADER Hdr;
- EFI_RAISE_TPL RaiseTPL;
- EFI_RESTORE_TPL RestoreTPL;
- EFI_ALLOCATE_PAGES AllocatePages;
- EFI_FREE_PAGES FreePages;
- EFI_GET_MEMORY_MAP GetMemoryMap;
- EFI_ALLOCATE_POOL AllocatePool;
- EFI_FREE_POOL FreePool;
- EFI_CREATE_EVENT CreateEvent;
- EFI_SET_TIMER SetTimer;
- EFI_WAIT_FOR_EVENT WaitForEvent;
- EFI_SIGNAL_EVENT SignalEvent;
- EFI_CLOSE_EVENT CloseEvent;
- EFI_CHECK_EVENT CheckEvent;
- EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
- EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
- EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
- EFI_HANDLE_PROTOCOL HandleProtocol;
- VOID *Reserved;
- EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
- EFI_LOCATE_HANDLE LocateHandle;
- EFI_LOCATE_DEVICE_PATH LocateDevicePath;
- EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
- EFI_IMAGE_LOAD LoadImage;
- EFI_IMAGE_START StartImage;
- EFI_EXIT Exit;
- EFI_IMAGE_UNLOAD UnloadImage;
- EFI_EXIT_BOOT_SERVICES ExitBootServices;
- EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
- EFI_STALL Stall;
- EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
- EFI_CONNECT_CONTROLLER ConnectController;
- EFI_DISCONNECT_CONTROLLER DisconnectController;
- EFI_OPEN_PROTOCOL OpenProtocol;
- EFI_CLOSE_PROTOCOL CloseProtocol;
- EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;
- EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;
- EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;
- EFI_LOCATE_PROTOCOL LocateProtocol;
- EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
- EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES
- UninstallMultipleProtocolInterfaces;
- EFI_CALCULATE_CRC32 CalculateCrc32;
- EFI_COPY_MEM CopyMem;
- EFI_SET_MEM SetMem;
- EFI_CREATE_EVENT_EX CreateEventEx;
- } EFI_BOOT_SERVICES;
- /*++
- Structure Description:
- This structure defines a set consisting of a GUID and a pointer defining
- a configuration table in the EFI System Table.
- Members:
- VendorGuid - Stores the GUID identifying the configuration table.
- VendorTable - Stores a pointer to the configuration table.
- --*/
- typedef struct {
- EFI_GUID VendorGuid;
- VOID *VendorTable;
- } EFI_CONFIGURATION_TABLE;
- /*++
- Structure Description:
- This structure defines the EFI System Table.
- Members:
- Hdr - Stores the standard EFI table header.
- FirmwareVendor - Stores a pointer to a null terminated string identifying
- the vendor that produces the firmware for the platform.
- FirmwareRevision - Stores a firmware vendor specific value identifying the
- revision of the system firmware on this platform.
- ConsoleInHandle - Stores the handle for the active console input device.
- This handle must support EFI_SIMPLE_TEXT_INPUT_PROTOCOL and
- EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
- ConIn - Stores a pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface
- associated with the console in handle.
- ConsoleOutHandle - Stores the handle for the active console output device.
- ConOut - Stores a pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
- associated with the console out handle.
- StandardErrorHandle - Stores the handle for the active standard error
- console device. This device must support the
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
- StdErr - Stores a pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
- that is associated with StandardErrorHandle.
- RuntimeServices - Stores a pointer to the EFI Runtime Services Table.
- BootServices - Stores a pointer to the EFI Boot Services Table.
- NumberOfTableEntries - Stores the number of system configuration tables in
- the configuration table buffer.
- ConfigurationTable - Stores a pointer to the array of system configuration
- tables.
- --*/
- typedef struct {
- EFI_TABLE_HEADER Hdr;
- CHAR16 *FirmwareVendor;
- UINT32 FirmwareRevision;
- EFI_HANDLE ConsoleInHandle;
- EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;
- EFI_HANDLE ConsoleOutHandle;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
- EFI_HANDLE StandardErrorHandle;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr;
- EFI_RUNTIME_SERVICES *RuntimeServices;
- EFI_BOOT_SERVICES *BootServices;
- UINTN NumberOfTableEntries;
- EFI_CONFIGURATION_TABLE *ConfigurationTable;
- } EFI_SYSTEM_TABLE;
- typedef
- EFI_STATUS
- (EFIAPI *EFI_IMAGE_ENTRY_POINT) (
- EFI_HANDLE ImageHandle,
- EFI_SYSTEM_TABLE *SystemTable
- );
- /*++
- Routine Description:
- This routine is an entry point into an EFI image. The entry point is the
- same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers (both
- device and bus drivers).
- Arguments:
- ImageHandle - Supplies the firmware allocated handle associated with this
- (just entered) UEFI image.
- SystemTable - Supplies a pointer to the EFI System Table.
- Return Value:
- EFI_SUCCESS if the operation completed successfully.
- Other error codes if an unexpected error occurred.
- --*/
- /*++
- Union Description:
- This union defines EFI Boot Key Data.
- Members:
- Options - Stores boot key options.
- Revision - Stores the revision of the EFI_KEY_OPTION structure.
- Currently 0.
- ShiftPressed - Stores a bit indicating either the left or right shift
- key is pressed.
- ControlPressed - Stores a bit indicating either the left or right
- control key is pressed.
- AltPressed - Stores a bit indicating either the left or right alt key
- is pressed.
- LogoPressed - Stores a bit indicating either the left or right Logo key
- is pressed.
- MenuPressed - Stores a bit indicating that the menu key is pressed.
- SysReqPressed - Stores a bit indicating the SysReq key is pressed.
- Reserved - Stores bits reserved for future use.
- InputKeyCount - Stores the number of entries in the Keys member of
- the EFI_KEY_OPTION structure. Valid values are between 0 and 3,
- inclusive. If zero, then only the shift state is considered. If
- more than one, the boot option will only be launched if all the
- specified keys are pressed with the same shift state.
- PackedValue - Stores the packed representation of the options.
- --*/
- typedef union {
- struct {
- UINT32 Revision:8;
- UINT32 ShiftPressed:1;
- UINT32 ControlPressed:1;
- UINT32 AltPressed:1;
- UINT32 LogoPressed:1;
- UINT32 MenuPressed:1;
- UINT32 SysReqPressed:1;
- UINT32 Reserved:16;
- UINT32 InputKeyCount:2;
- } Options;
- UINT32 PackedValue;
- } EFI_BOOT_KEY_DATA;
- /*++
- Structure Description:
- This structure defines an EFI Boot Key Option.
- Members:
- KeyData - Stores options about how the key will be processed.
- BootOptionCrc - Stores the CRC32 of the entire EFI_LOAD_OPTION to which
- this boot option refers. If the CRCs do mot match this value, then this
- key option is ignored.
- BootOption - Stores the Boot#### option which will be invoked if this key
- is pressed and the boot option is active (LOAD_OPTION_ACTIVE is set).
- Keys - Stores the key codes to compare against those returned by the
- EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols. The
- number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT
- field in the key options.
- --*/
- #pragma pack(push, 1)
- typedef struct {
- EFI_BOOT_KEY_DATA KeyData;
- UINT32 BootOptionCrc;
- UINT16 BootOption;
- //EFI_INPUT_KEY Keys[];
- } PACKED EFI_KEY_OPTION;
- #pragma pack(pop)
- //
- // -------------------------------------------------------------------- Globals
- //
- //
- // -------------------------------------------------------- Function Prototypes
- //
|