mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 23:54:02 +02:00
MdePkg: Added Ring3UefiBootServicesTableLib draft.
This commit is contained in:
parent
51e2c2a3e8
commit
52c7661b83
999
MdePkg/Library/Ring3UefiBootServicesTableLib/Ring3.h
Normal file
999
MdePkg/Library/Ring3UefiBootServicesTableLib/Ring3.h
Normal file
@ -0,0 +1,999 @@
|
|||||||
|
/**
|
||||||
|
Raise the task priority level to the new level.
|
||||||
|
High level is implemented by disabling processor interrupts.
|
||||||
|
|
||||||
|
@param NewTpl New task priority level
|
||||||
|
|
||||||
|
@return The previous task priority level
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_TPL
|
||||||
|
EFIAPI
|
||||||
|
Ring3RaiseTpl (
|
||||||
|
IN EFI_TPL NewTpl
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Lowers the task priority to the previous value. If the new
|
||||||
|
priority unmasks events at a higher priority, they are dispatched.
|
||||||
|
|
||||||
|
@param NewTpl New, lower, task priority
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
Ring3RestoreTpl (
|
||||||
|
IN EFI_TPL NewTpl
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allocates pages from the memory map.
|
||||||
|
|
||||||
|
@param Type The type of allocation to perform
|
||||||
|
@param MemoryType The type of memory to turn the allocated pages
|
||||||
|
into
|
||||||
|
@param NumberOfPages The number of pages to allocate
|
||||||
|
@param Memory A pointer to receive the base allocated memory
|
||||||
|
address
|
||||||
|
|
||||||
|
@return Status. On success, Memory is filled in with the base address allocated
|
||||||
|
@retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in
|
||||||
|
spec.
|
||||||
|
@retval EFI_NOT_FOUND Could not allocate pages match the requirement.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES No enough pages to allocate.
|
||||||
|
@retval EFI_SUCCESS Pages successfully allocated.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3AllocatePages (
|
||||||
|
IN EFI_ALLOCATE_TYPE Type,
|
||||||
|
IN EFI_MEMORY_TYPE MemoryType,
|
||||||
|
IN UINTN NumberOfPages,
|
||||||
|
IN OUT EFI_PHYSICAL_ADDRESS *Memory
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Frees previous allocated pages.
|
||||||
|
|
||||||
|
@param Memory Base address of memory being freed
|
||||||
|
@param NumberOfPages The number of pages to free
|
||||||
|
|
||||||
|
@retval EFI_NOT_FOUND Could not find the entry that covers the range
|
||||||
|
@retval EFI_INVALID_PARAMETER Address not aligned
|
||||||
|
@return EFI_SUCCESS -Pages successfully freed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3FreePages (
|
||||||
|
IN EFI_PHYSICAL_ADDRESS Memory,
|
||||||
|
IN UINTN NumberOfPages
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function returns a copy of the current memory map. The map is an array of
|
||||||
|
memory descriptors, each of which describes a contiguous block of memory.
|
||||||
|
|
||||||
|
@param MemoryMapSize A pointer to the size, in bytes, of the
|
||||||
|
MemoryMap buffer. On input, this is the size of
|
||||||
|
the buffer allocated by the caller. On output,
|
||||||
|
it is the size of the buffer returned by the
|
||||||
|
firmware if the buffer was large enough, or the
|
||||||
|
size of the buffer needed to contain the map if
|
||||||
|
the buffer was too small.
|
||||||
|
@param MemoryMap A pointer to the buffer in which firmware places
|
||||||
|
the current memory map.
|
||||||
|
@param MapKey A pointer to the location in which firmware
|
||||||
|
returns the key for the current memory map.
|
||||||
|
@param DescriptorSize A pointer to the location in which firmware
|
||||||
|
returns the size, in bytes, of an individual
|
||||||
|
EFI_MEMORY_DESCRIPTOR.
|
||||||
|
@param DescriptorVersion A pointer to the location in which firmware
|
||||||
|
returns the version number associated with the
|
||||||
|
EFI_MEMORY_DESCRIPTOR.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The memory map was returned in the MemoryMap
|
||||||
|
buffer.
|
||||||
|
@retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current
|
||||||
|
buffer size needed to hold the memory map is
|
||||||
|
returned in MemoryMapSize.
|
||||||
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetMemoryMap (
|
||||||
|
IN OUT UINTN *MemoryMapSize,
|
||||||
|
IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,
|
||||||
|
OUT UINTN *MapKey,
|
||||||
|
OUT UINTN *DescriptorSize,
|
||||||
|
OUT UINT32 *DescriptorVersion
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Allocate pool of a particular type.
|
||||||
|
|
||||||
|
@param PoolType Type of pool to allocate
|
||||||
|
@param Size The amount of pool to allocate
|
||||||
|
@param Buffer The address to return a pointer to the allocated
|
||||||
|
pool
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER PoolType not valid or Buffer is NULL
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.
|
||||||
|
@retval EFI_SUCCESS Pool successfully allocated.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3AllocatePool (
|
||||||
|
IN EFI_MEMORY_TYPE PoolType,
|
||||||
|
IN UINTN Size,
|
||||||
|
OUT VOID **Buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Frees pool.
|
||||||
|
|
||||||
|
@param Buffer The allocated pool entry to free
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Buffer is not a valid value.
|
||||||
|
@retval EFI_SUCCESS Pool successfully freed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3FreePool (
|
||||||
|
IN VOID *Buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates an event.
|
||||||
|
|
||||||
|
@param Type The type of event to create and its mode and
|
||||||
|
attributes
|
||||||
|
@param NotifyTpl The task priority level of event notifications
|
||||||
|
@param NotifyFunction Pointer to the events notification function
|
||||||
|
@param NotifyContext Pointer to the notification functions context;
|
||||||
|
corresponds to parameter "Context" in the
|
||||||
|
notification function
|
||||||
|
@param Event Pointer to the newly created event if the call
|
||||||
|
succeeds; undefined otherwise
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The event structure was created
|
||||||
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
|
||||||
|
@retval EFI_OUT_OF_RESOURCES The event could not be allocated
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CreateEvent (
|
||||||
|
IN UINT32 Type,
|
||||||
|
IN EFI_TPL NotifyTpl,
|
||||||
|
IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,
|
||||||
|
IN VOID *NotifyContext OPTIONAL,
|
||||||
|
OUT EFI_EVENT *Event
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the type of timer and the trigger time for a timer event.
|
||||||
|
|
||||||
|
@param UserEvent The timer event that is to be signaled at the
|
||||||
|
specified time
|
||||||
|
@param Type The type of time that is specified in
|
||||||
|
TriggerTime
|
||||||
|
@param TriggerTime The number of 100ns units until the timer
|
||||||
|
expires
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The event has been set to be signaled at the
|
||||||
|
requested time
|
||||||
|
@retval EFI_INVALID_PARAMETER Event or Type is not valid
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetTimer (
|
||||||
|
IN EFI_EVENT UserEvent,
|
||||||
|
IN EFI_TIMER_DELAY Type,
|
||||||
|
IN UINT64 TriggerTime
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Stops execution until an event is signaled.
|
||||||
|
|
||||||
|
@param NumberOfEvents The number of events in the UserEvents array
|
||||||
|
@param UserEvents An array of EFI_EVENT
|
||||||
|
@param UserIndex Pointer to the index of the event which
|
||||||
|
satisfied the wait condition
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The event indicated by Index was signaled.
|
||||||
|
@retval EFI_INVALID_PARAMETER The event indicated by Index has a notification
|
||||||
|
function or Event was not a valid type
|
||||||
|
@retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3WaitForEvent (
|
||||||
|
IN UINTN NumberOfEvents,
|
||||||
|
IN EFI_EVENT *UserEvents,
|
||||||
|
OUT UINTN *UserIndex
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Signals the event. Queues the event to be notified if needed.
|
||||||
|
|
||||||
|
@param UserEvent The event to signal .
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Parameters are not valid.
|
||||||
|
@retval EFI_SUCCESS The event was signaled.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SignalEvent (
|
||||||
|
IN EFI_EVENT UserEvent
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Closes an event and frees the event structure.
|
||||||
|
|
||||||
|
@param UserEvent Event to close
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Parameters are not valid.
|
||||||
|
@retval EFI_SUCCESS The event has been closed
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CloseEvent (
|
||||||
|
IN EFI_EVENT UserEvent
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Check the status of an event.
|
||||||
|
|
||||||
|
@param UserEvent The event to check
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The event is in the signaled state
|
||||||
|
@retval EFI_NOT_READY The event is not in the signaled state
|
||||||
|
@retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CheckEvent (
|
||||||
|
IN EFI_EVENT UserEvent
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Wrapper function to CoreInstallProtocolInterfaceNotify. This is the public API which
|
||||||
|
Calls the private one which contains a BOOLEAN parameter for notifications
|
||||||
|
|
||||||
|
@param UserHandle The handle to install the protocol handler on,
|
||||||
|
or NULL if a new handle is to be allocated
|
||||||
|
@param Protocol The protocol to add to the handle
|
||||||
|
@param InterfaceType Indicates whether Interface is supplied in
|
||||||
|
native form.
|
||||||
|
@param Interface The interface for the protocol being added
|
||||||
|
|
||||||
|
@return Status code
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3InstallProtocolInterface (
|
||||||
|
IN OUT EFI_HANDLE *UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN EFI_INTERFACE_TYPE InterfaceType,
|
||||||
|
IN VOID *Interface
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.
|
||||||
|
|
||||||
|
@param UserHandle Handle on which the interface is to be
|
||||||
|
reinstalled
|
||||||
|
@param Protocol The numeric ID of the interface
|
||||||
|
@param OldInterface A pointer to the old interface
|
||||||
|
@param NewInterface A pointer to the new interface
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The protocol interface was installed
|
||||||
|
@retval EFI_NOT_FOUND The OldInterface on the handle was not found
|
||||||
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ReinstallProtocolInterface (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN VOID *OldInterface,
|
||||||
|
IN VOID *NewInterface
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Uninstalls all instances of a protocol:interfacer from a handle.
|
||||||
|
If the last protocol interface is remove from the handle, the
|
||||||
|
handle is freed.
|
||||||
|
|
||||||
|
@param UserHandle The handle to remove the protocol handler from
|
||||||
|
@param Protocol The protocol, of protocol:interface, to remove
|
||||||
|
@param Interface The interface, of protocol:interface, to remove
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Protocol is NULL.
|
||||||
|
@retval EFI_SUCCESS Protocol interface successfully uninstalled.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3UninstallProtocolInterface (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN VOID *Interface
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Queries a handle to determine if it supports a specified protocol.
|
||||||
|
|
||||||
|
@param UserHandle The handle being queried.
|
||||||
|
@param Protocol The published unique identifier of the protocol.
|
||||||
|
@param Interface Supplies the address where a pointer to the
|
||||||
|
corresponding Protocol Interface is returned.
|
||||||
|
|
||||||
|
@return The requested protocol interface for the handle
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3HandleProtocol (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
OUT VOID **Interface
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Add a new protocol notification record for the request protocol.
|
||||||
|
|
||||||
|
@param Protocol The requested protocol to add the notify
|
||||||
|
registration
|
||||||
|
@param Event The event to signal
|
||||||
|
@param Registration Returns the registration record
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter
|
||||||
|
@retval EFI_SUCCESS Successfully returned the registration record
|
||||||
|
that has been added
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3RegisterProtocolNotify (
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN EFI_EVENT Event,
|
||||||
|
OUT VOID **Registration
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Locates the requested handle(s) and returns them in Buffer.
|
||||||
|
|
||||||
|
@param SearchType The type of search to perform to locate the
|
||||||
|
handles
|
||||||
|
@param Protocol The protocol to search for
|
||||||
|
@param SearchKey Dependant on SearchType
|
||||||
|
@param BufferSize On input the size of Buffer. On output the
|
||||||
|
size of data returned.
|
||||||
|
@param Buffer The buffer to return the results in
|
||||||
|
|
||||||
|
@retval EFI_BUFFER_TOO_SMALL Buffer too small, required buffer size is
|
||||||
|
returned in BufferSize.
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter
|
||||||
|
@retval EFI_SUCCESS Successfully found the requested handle(s) and
|
||||||
|
returns them in Buffer.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateHandle (
|
||||||
|
IN EFI_LOCATE_SEARCH_TYPE SearchType,
|
||||||
|
IN EFI_GUID *Protocol OPTIONAL,
|
||||||
|
IN VOID *SearchKey OPTIONAL,
|
||||||
|
IN OUT UINTN *BufferSize,
|
||||||
|
OUT EFI_HANDLE *Buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Locates the handle to a device on the device path that best matches the specified protocol.
|
||||||
|
|
||||||
|
@param Protocol The protocol to search for.
|
||||||
|
@param DevicePath On input, a pointer to a pointer to the device
|
||||||
|
path. On output, the device path pointer is
|
||||||
|
modified to point to the remaining part of the
|
||||||
|
devicepath.
|
||||||
|
@param Device A pointer to the returned device handle.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The resulting handle was returned.
|
||||||
|
@retval EFI_NOT_FOUND No handles matched the search.
|
||||||
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateDevicePath (
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
|
||||||
|
OUT EFI_HANDLE *Device
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Boot Service called to add, modify, or remove a system configuration table from
|
||||||
|
the EFI System Table.
|
||||||
|
|
||||||
|
@param Guid Pointer to the GUID for the entry to add, update, or
|
||||||
|
remove
|
||||||
|
@param Table Pointer to the configuration table for the entry to add,
|
||||||
|
update, or remove, may be NULL.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS Guid, Table pair added, updated, or removed.
|
||||||
|
@return EFI_INVALID_PARAMETER Input GUID not valid.
|
||||||
|
@return EFI_NOT_FOUND Attempted to delete non-existant entry
|
||||||
|
@return EFI_OUT_OF_RESOURCES Not enough memory available
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3InstallConfigurationTable (
|
||||||
|
IN EFI_GUID *Guid,
|
||||||
|
IN VOID *Table
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Loads an EFI image into memory and returns a handle to the image.
|
||||||
|
|
||||||
|
@param BootPolicy If TRUE, indicates that the request originates
|
||||||
|
from the boot manager, and that the boot
|
||||||
|
manager is attempting to load FilePath as a
|
||||||
|
boot selection.
|
||||||
|
@param ParentImageHandle The caller's image handle.
|
||||||
|
@param FilePath The specific file path from which the image is
|
||||||
|
loaded.
|
||||||
|
@param SourceBuffer If not NULL, a pointer to the memory location
|
||||||
|
containing a copy of the image to be loaded.
|
||||||
|
@param SourceSize The size in bytes of SourceBuffer.
|
||||||
|
@param ImageHandle Pointer to the returned image handle that is
|
||||||
|
created when the image is successfully loaded.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The image was loaded into memory.
|
||||||
|
@retval EFI_NOT_FOUND The FilePath was not found.
|
||||||
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
|
||||||
|
@retval EFI_UNSUPPORTED The image type is not supported, or the device
|
||||||
|
path cannot be parsed to locate the proper
|
||||||
|
protocol for loading the file.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient
|
||||||
|
resources.
|
||||||
|
@retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
|
||||||
|
understood.
|
||||||
|
@retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
|
||||||
|
@retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
|
||||||
|
image from being loaded. NULL is returned in *ImageHandle.
|
||||||
|
@retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
|
||||||
|
valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
|
||||||
|
platform policy specifies that the image should not be started.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LoadImage (
|
||||||
|
IN BOOLEAN BootPolicy,
|
||||||
|
IN EFI_HANDLE ParentImageHandle,
|
||||||
|
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
|
||||||
|
IN VOID *SourceBuffer OPTIONAL,
|
||||||
|
IN UINTN SourceSize,
|
||||||
|
OUT EFI_HANDLE *ImageHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Transfer control to a loaded image's entry point.
|
||||||
|
|
||||||
|
@param ImageHandle Handle of image to be started.
|
||||||
|
@param ExitDataSize Pointer of the size to ExitData
|
||||||
|
@param ExitData Pointer to a pointer to a data buffer that
|
||||||
|
includes a Null-terminated string,
|
||||||
|
optionally followed by additional binary data.
|
||||||
|
The string is a description that the caller may
|
||||||
|
use to further indicate the reason for the
|
||||||
|
image's exit.
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter
|
||||||
|
@retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
|
||||||
|
@retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.
|
||||||
|
@retval EFI_SUCCESS Successfully transfer control to the image's
|
||||||
|
entry point.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3StartImage (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
OUT UINTN *ExitDataSize,
|
||||||
|
OUT CHAR16 **ExitData OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Terminates the currently loaded EFI image and returns control to boot services.
|
||||||
|
|
||||||
|
@param ImageHandle Handle that identifies the image. This
|
||||||
|
parameter is passed to the image on entry.
|
||||||
|
@param Status The image's exit code.
|
||||||
|
@param ExitDataSize The size, in bytes, of ExitData. Ignored if
|
||||||
|
ExitStatus is EFI_SUCCESS.
|
||||||
|
@param ExitData Pointer to a data buffer that includes a
|
||||||
|
Null-terminated Unicode string, optionally
|
||||||
|
followed by additional binary data. The string
|
||||||
|
is a description that the caller may use to
|
||||||
|
further indicate the reason for the image's
|
||||||
|
exit.
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Image handle is NULL or it is not current
|
||||||
|
image.
|
||||||
|
@retval EFI_SUCCESS Successfully terminates the currently loaded
|
||||||
|
EFI image.
|
||||||
|
@retval EFI_ACCESS_DENIED Should never reach there.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Could not allocate pool
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3Exit (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_STATUS Status,
|
||||||
|
IN UINTN ExitDataSize,
|
||||||
|
IN CHAR16 *ExitData OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Unloads an image.
|
||||||
|
|
||||||
|
@param ImageHandle Handle that identifies the image to be
|
||||||
|
unloaded.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The image has been unloaded.
|
||||||
|
@retval EFI_UNSUPPORTED The image has been started, and does not support
|
||||||
|
unload.
|
||||||
|
@retval EFI_INVALID_PARAMPETER ImageHandle is not a valid image handle.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3UnloadImage (
|
||||||
|
IN EFI_HANDLE ImageHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Terminates all boot services.
|
||||||
|
|
||||||
|
@param ImageHandle Handle that identifies the exiting image.
|
||||||
|
@param MapKey Key to the latest memory map.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Boot Services terminated
|
||||||
|
@retval EFI_INVALID_PARAMETER MapKey is incorrect.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ExitBootServices (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN UINTN MapKey
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a monotonically increasing count for the platform.
|
||||||
|
|
||||||
|
@param[out] Count The pointer to returned value.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The next monotonic count was returned.
|
||||||
|
@retval EFI_INVALID_PARAMETER Count is NULL.
|
||||||
|
@retval EFI_DEVICE_ERROR The device is not functioning properly.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetNextMonotonicCount (
|
||||||
|
OUT UINT64 *Count
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Introduces a fine-grained stall.
|
||||||
|
|
||||||
|
@param Microseconds The number of microseconds to stall execution.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS Execution was stalled for at least the requested
|
||||||
|
amount of microseconds.
|
||||||
|
@retval EFI_NOT_AVAILABLE_YET gMetronome is not available yet
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3Stall (
|
||||||
|
IN UINTN Microseconds
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the system's watchdog timer.
|
||||||
|
|
||||||
|
@param Timeout The number of seconds to set the watchdog timer to.
|
||||||
|
A value of zero disables the timer.
|
||||||
|
@param WatchdogCode The numeric code to log on a watchdog timer timeout
|
||||||
|
event. The firmware reserves codes 0x0000 to 0xFFFF.
|
||||||
|
Loaders and operating systems may use other timeout
|
||||||
|
codes.
|
||||||
|
@param DataSize The size, in bytes, of WatchdogData.
|
||||||
|
@param WatchdogData A data buffer that includes a Null-terminated Unicode
|
||||||
|
string, optionally followed by additional binary data.
|
||||||
|
The string is a description that the call may use to
|
||||||
|
further indicate the reason to be logged with a
|
||||||
|
watchdog event.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS Timeout has been set
|
||||||
|
@return EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet
|
||||||
|
@return EFI_UNSUPPORTED System does not have a timer (currently not used)
|
||||||
|
@return EFI_DEVICE_ERROR Could not complete due to hardware error
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetWatchdogTimer (
|
||||||
|
IN UINTN Timeout,
|
||||||
|
IN UINT64 WatchdogCode,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN CHAR16 *WatchdogData OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Connects one or more drivers to a controller.
|
||||||
|
|
||||||
|
@param ControllerHandle The handle of the controller to which driver(s) are to be connected.
|
||||||
|
@param DriverImageHandle A pointer to an ordered list handles that support the
|
||||||
|
EFI_DRIVER_BINDING_PROTOCOL.
|
||||||
|
@param RemainingDevicePath A pointer to the device path that specifies a child of the
|
||||||
|
controller specified by ControllerHandle.
|
||||||
|
@param Recursive If TRUE, then ConnectController() is called recursively
|
||||||
|
until the entire tree of controllers below the controller specified
|
||||||
|
by ControllerHandle have been created. If FALSE, then
|
||||||
|
the tree of controllers is only expanded one level.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle.
|
||||||
|
2) No drivers were connected to ControllerHandle, but
|
||||||
|
RemainingDevicePath is not NULL, and it is an End Device
|
||||||
|
Path Node.
|
||||||
|
@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
|
||||||
|
@retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances
|
||||||
|
present in the system.
|
||||||
|
2) No drivers were connected to ControllerHandle.
|
||||||
|
@retval EFI_SECURITY_VIOLATION
|
||||||
|
The user has no permission to start UEFI device drivers on the device path
|
||||||
|
associated with the ControllerHandle or specified by the RemainingDevicePath.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ConnectController (
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE *DriverImageHandle OPTIONAL,
|
||||||
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,
|
||||||
|
IN BOOLEAN Recursive
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Disonnects a controller from a driver
|
||||||
|
|
||||||
|
@param ControllerHandle ControllerHandle The handle of
|
||||||
|
the controller from which
|
||||||
|
driver(s) are to be
|
||||||
|
disconnected.
|
||||||
|
@param DriverImageHandle DriverImageHandle The driver to
|
||||||
|
disconnect from ControllerHandle.
|
||||||
|
@param ChildHandle ChildHandle The handle of the
|
||||||
|
child to destroy.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS One or more drivers were
|
||||||
|
disconnected from the controller.
|
||||||
|
@retval EFI_SUCCESS On entry, no drivers are managing
|
||||||
|
ControllerHandle.
|
||||||
|
@retval EFI_SUCCESS DriverImageHandle is not NULL,
|
||||||
|
and on entry DriverImageHandle is
|
||||||
|
not managing ControllerHandle.
|
||||||
|
@retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER DriverImageHandle is not NULL,
|
||||||
|
and it is not a valid EFI_HANDLE.
|
||||||
|
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL, and it
|
||||||
|
is not a valid EFI_HANDLE.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES There are not enough resources
|
||||||
|
available to disconnect any
|
||||||
|
drivers from ControllerHandle.
|
||||||
|
@retval EFI_DEVICE_ERROR The controller could not be
|
||||||
|
disconnected because of a device
|
||||||
|
error.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3DisconnectController (
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE DriverImageHandle OPTIONAL,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Locates the installed protocol handler for the handle, and
|
||||||
|
invokes it to obtain the protocol interface. Usage information
|
||||||
|
is registered in the protocol data base.
|
||||||
|
|
||||||
|
@param UserHandle The handle to obtain the protocol interface on
|
||||||
|
@param Protocol The ID of the protocol
|
||||||
|
@param Interface The location to return the protocol interface
|
||||||
|
@param ImageHandle The handle of the Image that is opening the
|
||||||
|
protocol interface specified by Protocol and
|
||||||
|
Interface.
|
||||||
|
@param ControllerHandle The controller handle that is requiring this
|
||||||
|
interface.
|
||||||
|
@param Attributes The open mode of the protocol interface
|
||||||
|
specified by Handle and Protocol.
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Protocol is NULL.
|
||||||
|
@retval EFI_SUCCESS Get the protocol interface.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3OpenProtocol (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
OUT VOID **Interface OPTIONAL,
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN UINT32 Attributes
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Closes a protocol on a handle that was opened using OpenProtocol().
|
||||||
|
|
||||||
|
@param UserHandle The handle for the protocol interface that was
|
||||||
|
previously opened with OpenProtocol(), and is
|
||||||
|
now being closed.
|
||||||
|
@param Protocol The published unique identifier of the protocol.
|
||||||
|
It is the caller's responsibility to pass in a
|
||||||
|
valid GUID.
|
||||||
|
@param AgentHandle The handle of the agent that is closing the
|
||||||
|
protocol interface.
|
||||||
|
@param ControllerHandle If the agent that opened a protocol is a driver
|
||||||
|
that follows the EFI Driver Model, then this
|
||||||
|
parameter is the controller handle that required
|
||||||
|
the protocol interface. If the agent does not
|
||||||
|
follow the EFI Driver Model, then this parameter
|
||||||
|
is optional and may be NULL.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The protocol instance was closed.
|
||||||
|
@retval EFI_INVALID_PARAMETER Handle, AgentHandle or ControllerHandle is not a
|
||||||
|
valid EFI_HANDLE.
|
||||||
|
@retval EFI_NOT_FOUND Can not find the specified protocol or
|
||||||
|
AgentHandle.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CloseProtocol (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN EFI_HANDLE AgentHandle,
|
||||||
|
IN EFI_HANDLE ControllerHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return information about Opened protocols in the system
|
||||||
|
|
||||||
|
@param UserHandle The handle to close the protocol interface on
|
||||||
|
@param Protocol The ID of the protocol
|
||||||
|
@param EntryBuffer A pointer to a buffer of open protocol
|
||||||
|
information in the form of
|
||||||
|
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
|
||||||
|
@param EntryCount Number of EntryBuffer entries
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3OpenProtocolInformation (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
|
||||||
|
OUT UINTN *EntryCount
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated
|
||||||
|
from pool.
|
||||||
|
|
||||||
|
@param UserHandle The handle from which to retrieve the list of
|
||||||
|
protocol interface GUIDs.
|
||||||
|
@param ProtocolBuffer A pointer to the list of protocol interface GUID
|
||||||
|
pointers that are installed on Handle.
|
||||||
|
@param ProtocolBufferCount A pointer to the number of GUID pointers present
|
||||||
|
in ProtocolBuffer.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The list of protocol interface GUIDs installed
|
||||||
|
on Handle was returned in ProtocolBuffer. The
|
||||||
|
number of protocol interface GUIDs was returned
|
||||||
|
in ProtocolBufferCount.
|
||||||
|
@retval EFI_INVALID_PARAMETER Handle is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
|
||||||
|
@retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the
|
||||||
|
results.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ProtocolsPerHandle (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
OUT EFI_GUID ***ProtocolBuffer,
|
||||||
|
OUT UINTN *ProtocolBufferCount
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Function returns an array of handles that support the requested protocol
|
||||||
|
in a buffer allocated from pool. This is a version of Ring3LocateHandle()
|
||||||
|
that allocates a buffer for the caller.
|
||||||
|
|
||||||
|
@param SearchType Specifies which handle(s) are to be returned.
|
||||||
|
@param Protocol Provides the protocol to search by. This
|
||||||
|
parameter is only valid for SearchType
|
||||||
|
ByProtocol.
|
||||||
|
@param SearchKey Supplies the search key depending on the
|
||||||
|
SearchType.
|
||||||
|
@param NumberHandles The number of handles returned in Buffer.
|
||||||
|
@param Buffer A pointer to the buffer to return the requested
|
||||||
|
array of handles that support Protocol.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The result array of handles was returned.
|
||||||
|
@retval EFI_NOT_FOUND No handles match the search.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the
|
||||||
|
matching results.
|
||||||
|
@retval EFI_INVALID_PARAMETER One or more parameters are not valid.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateHandleBuffer (
|
||||||
|
IN EFI_LOCATE_SEARCH_TYPE SearchType,
|
||||||
|
IN EFI_GUID *Protocol OPTIONAL,
|
||||||
|
IN VOID *SearchKey OPTIONAL,
|
||||||
|
IN OUT UINTN *NumberHandles,
|
||||||
|
OUT EFI_HANDLE **Buffer
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return the first Protocol Interface that matches the Protocol GUID. If
|
||||||
|
Registration is passed in, return a Protocol Instance that was just add
|
||||||
|
to the system. If Registration is NULL return the first Protocol Interface
|
||||||
|
you find.
|
||||||
|
|
||||||
|
@param Protocol The protocol to search for
|
||||||
|
@param Registration Optional Registration Key returned from
|
||||||
|
RegisterProtocolNotify()
|
||||||
|
@param Interface Return the Protocol interface (instance).
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS If a valid Interface is returned
|
||||||
|
@retval EFI_INVALID_PARAMETER Invalid parameter
|
||||||
|
@retval EFI_NOT_FOUND Protocol interface not found
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateProtocol (
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN VOID *Registration OPTIONAL,
|
||||||
|
OUT VOID **Interface
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Installs a list of protocol interface into the boot services environment.
|
||||||
|
This function calls InstallProtocolInterface() in a loop. If any error
|
||||||
|
occures all the protocols added by this function are removed. This is
|
||||||
|
basically a lib function to save space.
|
||||||
|
|
||||||
|
@param Handle The handle to install the protocol handlers on,
|
||||||
|
or NULL if a new handle is to be allocated
|
||||||
|
@param ... EFI_GUID followed by protocol instance. A NULL
|
||||||
|
terminates the list. The pairs are the
|
||||||
|
arguments to InstallProtocolInterface(). All the
|
||||||
|
protocols are added to Handle.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS All the protocol interface was installed.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols.
|
||||||
|
@retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in
|
||||||
|
the handle database.
|
||||||
|
@retval EFI_INVALID_PARAMETER Handle is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3InstallMultipleProtocolInterfaces (
|
||||||
|
IN OUT EFI_HANDLE *Handle,
|
||||||
|
...
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Uninstalls a list of protocol interface in the boot services environment.
|
||||||
|
This function calls UnisatllProtocolInterface() in a loop. This is
|
||||||
|
basically a lib function to save space.
|
||||||
|
|
||||||
|
@param Handle The handle to uninstall the protocol
|
||||||
|
@param ... EFI_GUID followed by protocol instance. A NULL
|
||||||
|
terminates the list. The pairs are the
|
||||||
|
arguments to UninstallProtocolInterface(). All
|
||||||
|
the protocols are added to Handle.
|
||||||
|
|
||||||
|
@return Status code
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3UninstallMultipleProtocolInterfaces (
|
||||||
|
IN EFI_HANDLE Handle,
|
||||||
|
...
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Computes and returns a 32-bit CRC for a data buffer.
|
||||||
|
|
||||||
|
@param[in] Data A pointer to the buffer on which the 32-bit CRC is to be computed.
|
||||||
|
@param[in] DataSize The number of bytes in the buffer Data.
|
||||||
|
@param[out] Crc32 The 32-bit CRC that was computed for the data buffer specified by Data
|
||||||
|
and DataSize.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in
|
||||||
|
Crc32.
|
||||||
|
@retval EFI_INVALID_PARAMETER Data is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER Crc32 is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER DataSize is 0.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CalculateCrc32 (
|
||||||
|
IN VOID *Data,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
OUT UINT32 *Crc32
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Creates an event in a group.
|
||||||
|
|
||||||
|
@param Type The type of event to create and its mode and
|
||||||
|
attributes
|
||||||
|
@param NotifyTpl The task priority level of event notifications
|
||||||
|
@param NotifyFunction Pointer to the events notification function
|
||||||
|
@param NotifyContext Pointer to the notification functions context;
|
||||||
|
corresponds to parameter "Context" in the
|
||||||
|
notification function
|
||||||
|
@param EventGroup GUID for EventGroup if NULL act the same as
|
||||||
|
gBS->CreateEvent().
|
||||||
|
@param Event Pointer to the newly created event if the call
|
||||||
|
succeeds; undefined otherwise
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The event structure was created
|
||||||
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value
|
||||||
|
@retval EFI_OUT_OF_RESOURCES The event could not be allocated
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CreateEventEx (
|
||||||
|
IN UINT32 Type,
|
||||||
|
IN EFI_TPL NotifyTpl,
|
||||||
|
IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,
|
||||||
|
IN CONST VOID *NotifyContext OPTIONAL,
|
||||||
|
IN CONST EFI_GUID *EventGroup OPTIONAL,
|
||||||
|
OUT EFI_EVENT *Event
|
||||||
|
);
|
@ -0,0 +1,561 @@
|
|||||||
|
/** @file
|
||||||
|
This library constructs Ring 3 wrappers for the EFI_BOOT_SERVICES.
|
||||||
|
|
||||||
|
Copyright (c) 2024, Mikhail Krichanov. All rights reserved.
|
||||||
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#include <Uefi.h>
|
||||||
|
|
||||||
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
|
||||||
|
#include "Ring3.h"
|
||||||
|
|
||||||
|
EFI_BOOT_SERVICES mBootServices = {
|
||||||
|
{
|
||||||
|
EFI_BOOT_SERVICES_SIGNATURE, // Signature
|
||||||
|
EFI_BOOT_SERVICES_REVISION, // Revision
|
||||||
|
sizeof (EFI_BOOT_SERVICES), // HeaderSize
|
||||||
|
0, // CRC32
|
||||||
|
0 // Reserved
|
||||||
|
},
|
||||||
|
(EFI_RAISE_TPL)Ring3RaiseTpl, // RaiseTPL
|
||||||
|
(EFI_RESTORE_TPL)Ring3RestoreTpl, // RestoreTPL
|
||||||
|
(EFI_ALLOCATE_PAGES)Ring3AllocatePages, // AllocatePages
|
||||||
|
(EFI_FREE_PAGES)Ring3FreePages, // FreePages
|
||||||
|
(EFI_GET_MEMORY_MAP)Ring3GetMemoryMap, // GetMemoryMap
|
||||||
|
(EFI_ALLOCATE_POOL)Ring3AllocatePool, // AllocatePool
|
||||||
|
(EFI_FREE_POOL)Ring3FreePool, // FreePool
|
||||||
|
(EFI_CREATE_EVENT)Ring3CreateEvent, // CreateEvent
|
||||||
|
(EFI_SET_TIMER)Ring3SetTimer, // SetTimer
|
||||||
|
(EFI_WAIT_FOR_EVENT)Ring3WaitForEvent, // WaitForEvent
|
||||||
|
(EFI_SIGNAL_EVENT)Ring3SignalEvent, // SignalEvent
|
||||||
|
(EFI_CLOSE_EVENT)Ring3CloseEvent, // CloseEvent
|
||||||
|
(EFI_CHECK_EVENT)Ring3CheckEvent, // CheckEvent
|
||||||
|
(EFI_INSTALL_PROTOCOL_INTERFACE)Ring3InstallProtocolInterface, // InstallProtocolInterface
|
||||||
|
(EFI_REINSTALL_PROTOCOL_INTERFACE)Ring3ReinstallProtocolInterface, // ReinstallProtocolInterface
|
||||||
|
(EFI_UNINSTALL_PROTOCOL_INTERFACE)Ring3UninstallProtocolInterface, // UninstallProtocolInterface
|
||||||
|
(EFI_HANDLE_PROTOCOL)Ring3HandleProtocol, // HandleProtocol
|
||||||
|
(VOID *)NULL, // Reserved
|
||||||
|
(EFI_REGISTER_PROTOCOL_NOTIFY)Ring3RegisterProtocolNotify, // RegisterProtocolNotify
|
||||||
|
(EFI_LOCATE_HANDLE)Ring3LocateHandle, // LocateHandle
|
||||||
|
(EFI_LOCATE_DEVICE_PATH)Ring3LocateDevicePath, // LocateDevicePath
|
||||||
|
(EFI_INSTALL_CONFIGURATION_TABLE)Ring3InstallConfigurationTable, // InstallConfigurationTable
|
||||||
|
(EFI_IMAGE_LOAD)Ring3LoadImage, // LoadImage
|
||||||
|
(EFI_IMAGE_START)Ring3StartImage, // StartImage
|
||||||
|
(EFI_EXIT)Ring3Exit, // Exit
|
||||||
|
(EFI_IMAGE_UNLOAD)Ring3UnloadImage, // UnloadImage
|
||||||
|
(EFI_EXIT_BOOT_SERVICES)Ring3ExitBootServices, // ExitBootServices
|
||||||
|
(EFI_GET_NEXT_MONOTONIC_COUNT)Ring3GetNextMonotonicCount, // GetNextMonotonicCount
|
||||||
|
(EFI_STALL)Ring3Stall, // Stall
|
||||||
|
(EFI_SET_WATCHDOG_TIMER)Ring3SetWatchdogTimer, // SetWatchdogTimer
|
||||||
|
(EFI_CONNECT_CONTROLLER)Ring3ConnectController, // ConnectController
|
||||||
|
(EFI_DISCONNECT_CONTROLLER)Ring3DisconnectController, // DisconnectController
|
||||||
|
(EFI_OPEN_PROTOCOL)Ring3OpenProtocol, // OpenProtocol
|
||||||
|
(EFI_CLOSE_PROTOCOL)Ring3CloseProtocol, // CloseProtocol
|
||||||
|
(EFI_OPEN_PROTOCOL_INFORMATION)Ring3OpenProtocolInformation, // OpenProtocolInformation
|
||||||
|
(EFI_PROTOCOLS_PER_HANDLE)Ring3ProtocolsPerHandle, // ProtocolsPerHandle
|
||||||
|
(EFI_LOCATE_HANDLE_BUFFER)Ring3LocateHandleBuffer, // LocateHandleBuffer
|
||||||
|
(EFI_LOCATE_PROTOCOL)Ring3LocateProtocol, // LocateProtocol
|
||||||
|
(EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)Ring3InstallMultipleProtocolInterfaces, // InstallMultipleProtocolInterfaces
|
||||||
|
(EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)Ring3UninstallMultipleProtocolInterfaces, // UninstallMultipleProtocolInterfaces
|
||||||
|
(EFI_CALCULATE_CRC32)Ring3CalculateCrc32, // CalculateCrc32
|
||||||
|
(EFI_COPY_MEM)CopyMem, // CopyMem
|
||||||
|
(EFI_SET_MEM)SetMem, // SetMem
|
||||||
|
(EFI_CREATE_EVENT_EX)Ring3CreateEventEx // CreateEventEx
|
||||||
|
};
|
||||||
|
|
||||||
|
// EFI_HANDLE gImageHandle = NULL;
|
||||||
|
// EFI_SYSTEM_TABLE *gST = NULL;
|
||||||
|
EFI_BOOT_SERVICES *gBS = &mBootServices;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The function constructs Ring 3 wrappers for the EFI_BOOT_SERVICES.
|
||||||
|
|
||||||
|
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||||
|
@param SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
UefiBootServicesTableLibConstructor (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Cache the Image Handle
|
||||||
|
//
|
||||||
|
// gImageHandle = ImageHandle;
|
||||||
|
// ASSERT (gImageHandle != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Cache pointer to the EFI System Table
|
||||||
|
//
|
||||||
|
// gST = SystemTable;
|
||||||
|
// ASSERT (gST != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Cache pointer to the EFI Boot Services Table
|
||||||
|
//
|
||||||
|
// gBS = SystemTable->BootServices;
|
||||||
|
// ASSERT (gBS != NULL);
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_TPL
|
||||||
|
EFIAPI
|
||||||
|
Ring3RaiseTpl (
|
||||||
|
IN EFI_TPL NewTpl
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return NewTpl;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
Ring3RestoreTpl (
|
||||||
|
IN EFI_TPL NewTpl
|
||||||
|
)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3AllocatePages (
|
||||||
|
IN EFI_ALLOCATE_TYPE Type,
|
||||||
|
IN EFI_MEMORY_TYPE MemoryType,
|
||||||
|
IN UINTN NumberOfPages,
|
||||||
|
IN OUT EFI_PHYSICAL_ADDRESS *Memory
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3FreePages (
|
||||||
|
IN EFI_PHYSICAL_ADDRESS Memory,
|
||||||
|
IN UINTN NumberOfPages
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetMemoryMap (
|
||||||
|
IN OUT UINTN *MemoryMapSize,
|
||||||
|
IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,
|
||||||
|
OUT UINTN *MapKey,
|
||||||
|
OUT UINTN *DescriptorSize,
|
||||||
|
OUT UINT32 *DescriptorVersion
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3AllocatePool (
|
||||||
|
IN EFI_MEMORY_TYPE PoolType,
|
||||||
|
IN UINTN Size,
|
||||||
|
OUT VOID **Buffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3FreePool (
|
||||||
|
IN VOID *Buffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CreateEvent (
|
||||||
|
IN UINT32 Type,
|
||||||
|
IN EFI_TPL NotifyTpl,
|
||||||
|
IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,
|
||||||
|
IN VOID *NotifyContext OPTIONAL,
|
||||||
|
OUT EFI_EVENT *Event
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetTimer (
|
||||||
|
IN EFI_EVENT UserEvent,
|
||||||
|
IN EFI_TIMER_DELAY Type,
|
||||||
|
IN UINT64 TriggerTime
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3WaitForEvent (
|
||||||
|
IN UINTN NumberOfEvents,
|
||||||
|
IN EFI_EVENT *UserEvents,
|
||||||
|
OUT UINTN *UserIndex
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SignalEvent (
|
||||||
|
IN EFI_EVENT UserEvent
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CloseEvent (
|
||||||
|
IN EFI_EVENT UserEvent
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CheckEvent (
|
||||||
|
IN EFI_EVENT UserEvent
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3InstallProtocolInterface (
|
||||||
|
IN OUT EFI_HANDLE *UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN EFI_INTERFACE_TYPE InterfaceType,
|
||||||
|
IN VOID *Interface
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ReinstallProtocolInterface (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN VOID *OldInterface,
|
||||||
|
IN VOID *NewInterface
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3UninstallProtocolInterface (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN VOID *Interface
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3HandleProtocol (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
OUT VOID **Interface
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3RegisterProtocolNotify (
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN EFI_EVENT Event,
|
||||||
|
OUT VOID **Registration
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateHandle (
|
||||||
|
IN EFI_LOCATE_SEARCH_TYPE SearchType,
|
||||||
|
IN EFI_GUID *Protocol OPTIONAL,
|
||||||
|
IN VOID *SearchKey OPTIONAL,
|
||||||
|
IN OUT UINTN *BufferSize,
|
||||||
|
OUT EFI_HANDLE *Buffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateDevicePath (
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
|
||||||
|
OUT EFI_HANDLE *Device
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3InstallConfigurationTable (
|
||||||
|
IN EFI_GUID *Guid,
|
||||||
|
IN VOID *Table
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LoadImage (
|
||||||
|
IN BOOLEAN BootPolicy,
|
||||||
|
IN EFI_HANDLE ParentImageHandle,
|
||||||
|
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
|
||||||
|
IN VOID *SourceBuffer OPTIONAL,
|
||||||
|
IN UINTN SourceSize,
|
||||||
|
OUT EFI_HANDLE *ImageHandle
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3StartImage (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
OUT UINTN *ExitDataSize,
|
||||||
|
OUT CHAR16 **ExitData OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3Exit (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_STATUS Status,
|
||||||
|
IN UINTN ExitDataSize,
|
||||||
|
IN CHAR16 *ExitData OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3UnloadImage (
|
||||||
|
IN EFI_HANDLE ImageHandle
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ExitBootServices (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN UINTN MapKey
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetNextMonotonicCount (
|
||||||
|
OUT UINT64 *Count
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3Stall (
|
||||||
|
IN UINTN Microseconds
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetWatchdogTimer (
|
||||||
|
IN UINTN Timeout,
|
||||||
|
IN UINT64 WatchdogCode,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN CHAR16 *WatchdogData OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ConnectController (
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE *DriverImageHandle OPTIONAL,
|
||||||
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,
|
||||||
|
IN BOOLEAN Recursive
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3DisconnectController (
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN EFI_HANDLE DriverImageHandle OPTIONAL,
|
||||||
|
IN EFI_HANDLE ChildHandle OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3OpenProtocol (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
OUT VOID **Interface OPTIONAL,
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_HANDLE ControllerHandle,
|
||||||
|
IN UINT32 Attributes
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CloseProtocol (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN EFI_HANDLE AgentHandle,
|
||||||
|
IN EFI_HANDLE ControllerHandle
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3OpenProtocolInformation (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
|
||||||
|
OUT UINTN *EntryCount
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ProtocolsPerHandle (
|
||||||
|
IN EFI_HANDLE UserHandle,
|
||||||
|
OUT EFI_GUID ***ProtocolBuffer,
|
||||||
|
OUT UINTN *ProtocolBufferCount
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateHandleBuffer (
|
||||||
|
IN EFI_LOCATE_SEARCH_TYPE SearchType,
|
||||||
|
IN EFI_GUID *Protocol OPTIONAL,
|
||||||
|
IN VOID *SearchKey OPTIONAL,
|
||||||
|
IN OUT UINTN *NumberHandles,
|
||||||
|
OUT EFI_HANDLE **Buffer
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3LocateProtocol (
|
||||||
|
IN EFI_GUID *Protocol,
|
||||||
|
IN VOID *Registration OPTIONAL,
|
||||||
|
OUT VOID **Interface
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3InstallMultipleProtocolInterfaces (
|
||||||
|
IN OUT EFI_HANDLE *Handle,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3UninstallMultipleProtocolInterfaces (
|
||||||
|
IN EFI_HANDLE Handle,
|
||||||
|
...
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CalculateCrc32 (
|
||||||
|
IN VOID *Data,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
OUT UINT32 *Crc32
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3CreateEventEx (
|
||||||
|
IN UINT32 Type,
|
||||||
|
IN EFI_TPL NotifyTpl,
|
||||||
|
IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,
|
||||||
|
IN CONST VOID *NotifyContext OPTIONAL,
|
||||||
|
IN CONST EFI_GUID *EventGroup OPTIONAL,
|
||||||
|
OUT EFI_EVENT *Event
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
## @file
|
||||||
|
# Ring 3 wrapper for UEFI Boot Services Table Library implementation.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2024, Mikhail Krichanov. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
#
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|
||||||
|
[Defines]
|
||||||
|
INF_VERSION = 0x00010005
|
||||||
|
BASE_NAME = Ring3UefiBootServicesTableLib
|
||||||
|
MODULE_UNI_FILE = Ring3UefiBootServicesTableLib.uni
|
||||||
|
FILE_GUID = b503b4b4-6dc1-412b-965f-a0f330b1d453
|
||||||
|
MODULE_TYPE = UEFI_DRIVER
|
||||||
|
VERSION_STRING = 1.0
|
||||||
|
LIBRARY_CLASS = UefiBootServicesTableLib|DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_APPLICATION UEFI_DRIVER
|
||||||
|
|
||||||
|
CONSTRUCTOR = UefiBootServicesTableLibConstructor
|
||||||
|
|
||||||
|
#
|
||||||
|
# VALID_ARCHITECTURES = IA32 X64 EBC
|
||||||
|
#
|
||||||
|
|
||||||
|
[Sources]
|
||||||
|
Ring3.h
|
||||||
|
Ring3UefiBootServicesTableLib.c
|
||||||
|
|
||||||
|
[Packages]
|
||||||
|
MdePkg/MdePkg.dec
|
||||||
|
|
||||||
|
|
||||||
|
[LibraryClasses]
|
||||||
|
BaseMemoryLib
|
@ -0,0 +1,12 @@
|
|||||||
|
// /** @file
|
||||||
|
// Ring 3 wrapper for UEFI Boot Services Table Library implementation.
|
||||||
|
//
|
||||||
|
// Copyright (c) 2024, Mikhail Krichanov. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
//
|
||||||
|
// **/
|
||||||
|
|
||||||
|
|
||||||
|
#string STR_MODULE_ABSTRACT #language en-US "Ring 3 wrapper for UEFI Boot Services Table Library implementation."
|
||||||
|
|
||||||
|
#string STR_MODULE_DESCRIPTION #language en-US "Ring 3 wrapper for UEFI Boot Services Table Library implementation."
|
Loading…
x
Reference in New Issue
Block a user