/** @file Copyright (c) 2024 - 2025, Mikhail Krichanov. All rights reserved. SPDX-License-Identifier: BSD-3-Clause **/ #include #include #include #include #include EFI_STATUS EFIAPI SysCall ( IN UINT8 Type, IN UINT8 NumberOfArguments, ... ); /** 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 UserSpaceRaiseTpl ( 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 UserSpaceRestoreTpl ( 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 UserSpaceAllocatePages ( 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 UserSpaceFreePages ( 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 UserSpaceGetMemoryMap ( 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 Buffer is NULL. PoolType is in the range EfiMaxMemoryType..0x6FFFFFFF. PoolType is EfiPersistentMemory. @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed. @retval EFI_SUCCESS Pool successfully allocated. **/ EFI_STATUS EFIAPI UserSpaceAllocatePool ( 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 UserSpaceFreePool ( 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 UserSpaceCreateEvent ( 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 UserSpaceSetTimer ( 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 UserSpaceWaitForEvent ( 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 UserSpaceSignalEvent ( 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 UserSpaceCloseEvent ( 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 UserSpaceCheckEvent ( 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 UserSpaceInstallProtocolInterface ( 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 UserSpaceReinstallProtocolInterface ( 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 UserSpaceUninstallProtocolInterface ( 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 UserSpaceHandleProtocol ( 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 UserSpaceRegisterProtocolNotify ( 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 UserSpaceLocateHandle ( 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 UserSpaceLocateDevicePath ( 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 UserSpaceInstallConfigurationTable ( 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 UserSpaceLoadImage ( 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 UserSpaceStartImage ( 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 UserSpaceExit ( 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 UserSpaceUnloadImage ( 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 UserSpaceExitBootServices ( 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 UserSpaceGetNextMonotonicCount ( 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 UserSpaceStall ( 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 UserSpaceSetWatchdogTimer ( 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 UserSpaceConnectController ( 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 UserSpaceDisconnectController ( 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 UserSpaceOpenProtocol ( 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 UserSpaceCloseProtocol ( 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 UserSpaceOpenProtocolInformation ( 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 UserSpaceProtocolsPerHandle ( 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 UserSpaceLocateHandle() 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 UserSpaceLocateHandleBuffer ( 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 UserSpaceLocateProtocol ( 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 UserSpaceInstallMultipleProtocolInterfaces ( 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 UserSpaceUninstallMultipleProtocolInterfaces ( 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 UserSpaceCalculateCrc32 ( 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 UserSpaceCreateEventEx ( 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 ); /** Reset the Block Device. @param This Indicates a pointer to the calling context. @param ExtendedVerification Driver may perform diagnostics on reset. @retval EFI_SUCCESS The device was reset. @retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset. **/ EFI_STATUS EFIAPI UserSpaceBlockIoReset ( IN EFI_BLOCK_IO_PROTOCOL *This, IN BOOLEAN ExtendedVerification ); /** Read BufferSize bytes from Lba into Buffer. @param This Indicates a pointer to the calling context. @param MediaId Id of the media, changes every time the media is replaced. @param Lba The starting Logical Block Address to read from @param BufferSize Size of Buffer, must be a multiple of device block size. @param Buffer A pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer. @retval EFI_SUCCESS The data was read correctly from the device. @retval EFI_DEVICE_ERROR The device reported an error while performing the read. @retval EFI_NO_MEDIA There is no media in the device. @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device. @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device. @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid, or the buffer is not on proper alignment. **/ EFI_STATUS EFIAPI UserSpaceBlockIoRead ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, OUT VOID *Buffer ); /** Write BufferSize bytes from Lba into Buffer. @param This Indicates a pointer to the calling context. @param MediaId The media ID that the write request is for. @param Lba The starting logical block address to be written. The caller is responsible for writing to only legitimate locations. @param BufferSize Size of Buffer, must be a multiple of device block size. @param Buffer A pointer to the source buffer for the data. @retval EFI_SUCCESS The data was written correctly to the device. @retval EFI_WRITE_PROTECTED The device can not be written to. @retval EFI_DEVICE_ERROR The device reported an error while performing the write. @retval EFI_NO_MEDIA There is no media in the device. @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device. @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device. @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid, or the buffer is not on proper alignment. **/ EFI_STATUS EFIAPI UserSpaceBlockIoWrite ( IN EFI_BLOCK_IO_PROTOCOL *This, IN UINT32 MediaId, IN EFI_LBA Lba, IN UINTN BufferSize, IN VOID *Buffer ); /** Flush the Block Device. @param This Indicates a pointer to the calling context. @retval EFI_SUCCESS All outstanding data was written to the device @retval EFI_DEVICE_ERROR The device reported an error while writting back the data @retval EFI_NO_MEDIA There is no media in the device. **/ EFI_STATUS EFIAPI UserSpaceBlockIoFlush ( IN EFI_BLOCK_IO_PROTOCOL *This ); /** Read BufferSize bytes from Offset into Buffer. @param This Protocol instance pointer. @param MediaId Id of the media, changes every time the media is replaced. @param Offset The starting byte offset to read from @param BufferSize Size of Buffer @param Buffer Buffer containing read data @retval EFI_SUCCESS The data was read correctly from the device. @retval EFI_DEVICE_ERROR The device reported an error while performing the read. @retval EFI_NO_MEDIA There is no media in the device. @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device. @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not valid for the device. **/ EFI_STATUS EFIAPI UserSpaceDiskIoRead ( IN EFI_DISK_IO_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Offset, IN UINTN BufferSize, OUT VOID *Buffer ); /** Writes a specified number of bytes to a device. @param This Indicates a pointer to the calling context. @param MediaId ID of the medium to be written. @param Offset The starting byte offset on the logical block I/O device to write. @param BufferSize The size in bytes of Buffer. The number of bytes to write to the device. @param Buffer A pointer to the buffer containing the data to be written. @retval EFI_SUCCESS The data was written correctly to the device. @retval EFI_WRITE_PROTECTED The device can not be written to. @retval EFI_DEVICE_ERROR The device reported an error while performing the write. @retval EFI_NO_MEDIA There is no media in the device. @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device. @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not valid for the device. **/ EFI_STATUS EFIAPI UserSpaceDiskIoWrite ( IN EFI_DISK_IO_PROTOCOL *This, IN UINT32 MediaId, IN UINT64 Offset, IN UINTN BufferSize, IN VOID *Buffer ); /** Returns the current time and date information, and the time-keeping capabilities of the hardware platform. @param[out] Time A pointer to storage to receive a snapshot of the current time. @param[out] Capabilities An optional pointer to a buffer to receive the real time clock device's capabilities. @retval EFI_SUCCESS The operation completed successfully. @retval EFI_INVALID_PARAMETER Time is NULL. @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error. **/ EFI_STATUS EFIAPI UserSpaceGetTime ( OUT EFI_TIME *Time, OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL ); /** Sets the current local time and date information. @param[in] Time A pointer to the current time. @retval EFI_SUCCESS The operation completed successfully. @retval EFI_INVALID_PARAMETER A time field is out of range. @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error. **/ EFI_STATUS EFIAPI UserSpaceSetTime ( IN EFI_TIME *Time ); /** Returns the current wakeup alarm clock setting. @param[out] Enabled Indicates if the alarm is currently enabled or disabled. @param[out] Pending Indicates if the alarm signal is pending and requires acknowledgement. @param[out] Time The current alarm setting. @retval EFI_SUCCESS The alarm settings were returned. @retval EFI_INVALID_PARAMETER Enabled is NULL. @retval EFI_INVALID_PARAMETER Pending is NULL. @retval EFI_INVALID_PARAMETER Time is NULL. @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error. @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform. **/ EFI_STATUS EFIAPI UserSpaceGetWakeupTime ( OUT BOOLEAN *Enabled, OUT BOOLEAN *Pending, OUT EFI_TIME *Time ); /** Sets the system wakeup alarm clock time. @param[in] Enable Enable or disable the wakeup alarm. @param[in] Time If Enable is TRUE, the time to set the wakeup alarm for. If Enable is FALSE, then this parameter is optional, and may be NULL. @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If Enable is FALSE, then the wakeup alarm was disabled. @retval EFI_INVALID_PARAMETER A time field is out of range. @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error. @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform. **/ EFI_STATUS EFIAPI UserSpaceSetWakeupTime ( IN BOOLEAN Enable, IN EFI_TIME *Time OPTIONAL ); /** Changes the runtime addressing mode of EFI firmware from physical to virtual. @param[in] MemoryMapSize The size in bytes of VirtualMap. @param[in] DescriptorSize The size in bytes of an entry in the VirtualMap. @param[in] DescriptorVersion The version of the structure entries in VirtualMap. @param[in] VirtualMap An array of memory descriptors which contain new virtual address mapping information for all runtime ranges. @retval EFI_SUCCESS The virtual address map has been applied. @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in virtual address mapped mode. @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid. @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory map that requires a mapping. @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found in the memory map. **/ EFI_STATUS EFIAPI UserSpaceSetVirtualAddressMap ( IN UINTN MemoryMapSize, IN UINTN DescriptorSize, IN UINT32 DescriptorVersion, IN EFI_MEMORY_DESCRIPTOR *VirtualMap ); /** Determines the new virtual address that is to be used on subsequent memory accesses. @param[in] DebugDisposition Supplies type information for the pointer being converted. @param[in, out] Address A pointer to a pointer that is to be fixed to be the value needed for the new virtual address mappings being applied. @retval EFI_SUCCESS The pointer pointed to by Address was modified. @retval EFI_INVALID_PARAMETER 1) Address is NULL. 2) *Address is NULL and DebugDisposition does not have the EFI_OPTIONAL_PTR bit set. @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part of the current memory map. This is normally fatal. **/ EFI_STATUS EFIAPI UserSpaceConvertPointer ( IN UINTN DebugDisposition, IN OUT VOID **Address ); /** Returns the value of a variable. @param[in] VariableName A Null-terminated string that is the name of the vendor's variable. @param[in] VendorGuid A unique identifier for the vendor. @param[out] Attributes If not NULL, a pointer to the memory location to return the attributes bitmask for the variable. @param[in, out] DataSize On input, the size in bytes of the return Data buffer. On output the size of data returned in Data. @param[out] Data The buffer to return the contents of the variable. May be NULL with a zero DataSize in order to determine the size buffer needed. @retval EFI_SUCCESS The function completed successfully. @retval EFI_NOT_FOUND The variable was not found. @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. @retval EFI_INVALID_PARAMETER VariableName is NULL. @retval EFI_INVALID_PARAMETER VendorGuid is NULL. @retval EFI_INVALID_PARAMETER DataSize is NULL. @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL. @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error. @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure. **/ EFI_STATUS EFIAPI UserSpaceGetVariable ( IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize, OUT VOID *Data OPTIONAL ); /** Enumerates the current variable names. @param[in, out] VariableNameSize The size of the VariableName buffer. The size must be large enough to fit input string supplied in VariableName buffer. @param[in, out] VariableName On input, supplies the last VariableName that was returned by GetNextVariableName(). On output, returns the Nullterminated string of the current variable. @param[in, out] VendorGuid On input, supplies the last VendorGuid that was returned by GetNextVariableName(). On output, returns the VendorGuid of the current variable. @retval EFI_SUCCESS The function completed successfully. @retval EFI_NOT_FOUND The next variable was not found. @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result. VariableNameSize has been updated with the size needed to complete the request. @retval EFI_INVALID_PARAMETER VariableNameSize is NULL. @retval EFI_INVALID_PARAMETER VariableName is NULL. @retval EFI_INVALID_PARAMETER VendorGuid is NULL. @retval EFI_INVALID_PARAMETER The input values of VariableName and VendorGuid are not a name and GUID of an existing variable. @retval EFI_INVALID_PARAMETER Null-terminator is not found in the first VariableNameSize bytes of the input VariableName buffer. @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error. **/ EFI_STATUS EFIAPI UserSpaceGetNextVariableName ( IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VendorGuid ); /** Sets the value of a variable. @param[in] VariableName A Null-terminated string that is the name of the vendor's variable. Each VariableName is unique for each VendorGuid. VariableName must contain 1 or more characters. If VariableName is an empty string, then EFI_INVALID_PARAMETER is returned. @param[in] VendorGuid A unique identifier for the vendor. @param[in] Attributes Attributes bitmask to set for the variable. @param[in] DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE 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 SetVariable() call with a DataSize 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 DataSize will not be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated). @param[in] Data The contents for the variable. @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as defined by the Attributes. @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the DataSize exceeds the maximum allowed. @retval EFI_INVALID_PARAMETER VariableName is an empty string. @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data. @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error. @retval EFI_WRITE_PROTECTED The variable in question is read-only. @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted. @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo does NOT pass the validation check carried out by the firmware. @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found. **/ EFI_STATUS EFIAPI UserSpaceSetVariable ( IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid, IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data ); /** Returns the next high 32 bits of the platform's monotonic counter. @param[out] HighCount The pointer to returned value. @retval EFI_SUCCESS The next high monotonic count was returned. @retval EFI_INVALID_PARAMETER HighCount is NULL. @retval EFI_DEVICE_ERROR The device is not functioning properly. **/ EFI_STATUS EFIAPI UserSpaceGetNextHighMonotonicCount ( OUT UINT32 *HighCount ); /** Resets the entire platform. @param[in] ResetType The type of reset to perform. @param[in] ResetStatus The status code for the reset. @param[in] DataSize The size, in bytes, of ResetData. @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown the data buffer starts with 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 system reset. For a ResetType of EfiResetPlatformSpecific the data buffer also starts with a Null-terminated string that is followed by an EFI_GUID that describes the specific type of reset to perform. **/ VOID EFIAPI UserSpaceResetSystem ( IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL ); /** 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. @param[in] CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules being passed into update capsule. @param[in] CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in CaspuleHeaderArray. @param[in] ScatterGatherList Physical pointer to a set of EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the location in physical memory of a set of capsules. @retval EFI_SUCCESS Valid capsule was passed. If CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the capsule has been successfully processed by the firmware. @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were set in the capsule header. @retval EFI_INVALID_PARAMETER CapsuleCount is 0. @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error. @retval EFI_UNSUPPORTED The capsule type is not supported on this platform. @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has been previously called this error indicates the capsule is compatible with this platform but is not capable of being submitted or processed in runtime. The caller may resubmit the capsule prior to ExitBootServices(). @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates the capsule is compatible with this platform but there are insufficient resources to process. **/ EFI_STATUS EFIAPI UserSpaceUpdateCapsule ( IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UINTN CapsuleCount, IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL ); /** Returns if the capsule can be supported via UpdateCapsule(). @param[in] CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules being passed into update capsule. @param[in] CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in CaspuleHeaderArray. @param[out] MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can support as an argument to UpdateCapsule() via CapsuleHeaderArray and ScatterGatherList. @param[out] ResetType Returns the type of reset required for the capsule update. @retval EFI_SUCCESS Valid answer returned. @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and MaximumCapsuleSize and ResetType are undefined. @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL. @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has been previously called this error indicates the capsule is compatible with this platform but is not capable of being submitted or processed in runtime. The caller may resubmit the capsule prior to ExitBootServices(). @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates the capsule is compatible with this platform but there are insufficient resources to process. **/ EFI_STATUS EFIAPI UserSpaceQueryCapsuleCapabilities ( IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UINTN CapsuleCount, OUT UINT64 *MaximumCapsuleSize, OUT EFI_RESET_TYPE *ResetType ); /** Returns information about the EFI variables. @param[in] Attributes Attributes bitmask to specify the type of variables on which to return information. @param[out] MaximumVariableStorageSize On output the maximum size of the storage space available for the EFI variables associated with the attributes specified. @param[out] RemainingVariableStorageSize Returns the remaining size of the storage space available for the EFI variables associated with the attributes specified. @param[out] MaximumVariableSize Returns the maximum size of the individual EFI variables associated with the attributes specified. @retval EFI_SUCCESS Valid answer returned. @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the MaximumVariableStorageSize, RemainingVariableStorageSize, MaximumVariableSize are undefined. **/ EFI_STATUS EFIAPI UserSpaceQueryVariableInfo ( IN UINT32 Attributes, OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *RemainingVariableStorageSize, OUT UINT64 *MaximumVariableSize ); /** Performs a case-insensitive comparison of two Null-terminated strings. @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance. @param Str1 A pointer to a Null-terminated string. @param Str2 A pointer to a Null-terminated string. @retval 0 Str1 is equivalent to Str2. @retval >0 Str1 is lexically greater than Str2. @retval <0 Str1 is lexically less than Str2. **/ INTN EFIAPI UserSpaceUnicodeStriColl ( IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *Str1, IN CHAR16 *Str2 ); /** Performs a case-insensitive comparison of a Null-terminated pattern string and a Null-terminated string. @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance. @param String A pointer to a Null-terminated string. @param Pattern A pointer to a Null-terminated pattern string. @retval TRUE Pattern was found in String. @retval FALSE Pattern was not found in String. **/ BOOLEAN EFIAPI UserSpaceUnicodeMetaiMatch ( IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *String, IN CHAR16 *Pattern ); /** Converts all the characters in a Null-terminated string to lower case characters. @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance. @param String A pointer to a Null-terminated string. **/ VOID EFIAPI UserSpaceUnicodeStrLwr ( IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN OUT CHAR16 *Str ); /** Converts all the characters in a Null-terminated string to upper case characters. @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance. @param String A pointer to a Null-terminated string. **/ VOID EFIAPI UserSpaceUnicodeStrUpr ( IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN OUT CHAR16 *Str ); /** Converts an 8.3 FAT file name in an OEM character set to a Null-terminated string. @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance. @param FatSize The size of the string Fat in bytes. @param Fat A pointer to a Null-terminated string that contains an 8.3 file name using an 8-bit OEM character set. @param String A pointer to a Null-terminated string. The string must be allocated in advance to hold FatSize characters. **/ VOID EFIAPI UserSpaceUnicodeFatToStr ( IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN UINTN FatSize, IN CHAR8 *Fat, OUT CHAR16 *String ); /** Converts a Null-terminated string to legal characters in a FAT filename using an OEM character set. @param This A pointer to the EFI_UNICODE_COLLATION_PROTOCOL instance. @param String A pointer to a Null-terminated string. @param FatSize The size of the string Fat in bytes. @param Fat A pointer to a string that contains the converted version of String using legal FAT characters from an OEM character set. @retval TRUE One or more conversions failed and were substituted with '_' @retval FALSE None of the conversions failed. **/ BOOLEAN EFIAPI UserSpaceUnicodeStrToFat ( IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *String, IN UINTN FatSize, OUT CHAR8 *Fat );