mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 13:44:33 +02:00
Ring3: Added Runtime Services wrappers.
This commit is contained in:
parent
d4bdb042e1
commit
a004745232
@ -66,6 +66,30 @@ EFI_BOOT_SERVICES mBootServices = {
|
|||||||
(EFI_CREATE_EVENT_EX)Ring3CreateEventEx, // CreateEventEx
|
(EFI_CREATE_EVENT_EX)Ring3CreateEventEx, // CreateEventEx
|
||||||
};
|
};
|
||||||
|
|
||||||
|
EFI_RUNTIME_SERVICES mRuntimeServices = {
|
||||||
|
{
|
||||||
|
EFI_RUNTIME_SERVICES_SIGNATURE, // Signature
|
||||||
|
EFI_RUNTIME_SERVICES_REVISION, // Revision
|
||||||
|
sizeof (EFI_RUNTIME_SERVICES), // HeaderSize
|
||||||
|
0, // CRC32
|
||||||
|
0 // Reserved
|
||||||
|
},
|
||||||
|
(EFI_GET_TIME)Ring3GetTime, // GetTime
|
||||||
|
(EFI_SET_TIME)Ring3SetTime, // SetTime
|
||||||
|
(EFI_GET_WAKEUP_TIME)Ring3GetWakeupTime, // GetWakeupTime
|
||||||
|
(EFI_SET_WAKEUP_TIME)Ring3SetWakeupTime, // SetWakeupTime
|
||||||
|
(EFI_SET_VIRTUAL_ADDRESS_MAP)Ring3SetVirtualAddressMap, // SetVirtualAddressMap
|
||||||
|
(EFI_CONVERT_POINTER)Ring3ConvertPointer, // ConvertPointer
|
||||||
|
(EFI_GET_VARIABLE)Ring3GetVariable, // GetVariable
|
||||||
|
(EFI_GET_NEXT_VARIABLE_NAME)Ring3GetNextVariableName, // GetNextVariableName
|
||||||
|
(EFI_SET_VARIABLE)Ring3SetVariable, // SetVariable
|
||||||
|
(EFI_GET_NEXT_HIGH_MONO_COUNT)Ring3GetNextHighMonotonicCount, // GetNextHighMonotonicCount
|
||||||
|
(EFI_RESET_SYSTEM)Ring3ResetSystem, // ResetSystem
|
||||||
|
(EFI_UPDATE_CAPSULE)Ring3UpdateCapsule, // UpdateCapsule
|
||||||
|
(EFI_QUERY_CAPSULE_CAPABILITIES)Ring3QueryCapsuleCapabilities, // QueryCapsuleCapabilities
|
||||||
|
(EFI_QUERY_VARIABLE_INFO)Ring3QueryVariableInfo // QueryVariableInfo
|
||||||
|
};
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
Ring3EntryPoint (
|
Ring3EntryPoint (
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
Ring3.h
|
Ring3.h
|
||||||
DxeRing3.c
|
DxeRing3.c
|
||||||
Ring3UefiBootServices.c
|
Ring3UefiBootServices.c
|
||||||
|
Ring3UefiRuntimeServices.c
|
||||||
Ring3Protocols.c
|
Ring3Protocols.c
|
||||||
|
|
||||||
[Sources.X64]
|
[Sources.X64]
|
||||||
|
@ -1164,3 +1164,386 @@ Ring3DiskIoWrite (
|
|||||||
IN UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
IN VOID *Buffer
|
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
|
||||||
|
Ring3GetTime (
|
||||||
|
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
|
||||||
|
Ring3SetTime (
|
||||||
|
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
|
||||||
|
Ring3GetWakeupTime (
|
||||||
|
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
|
||||||
|
Ring3SetWakeupTime (
|
||||||
|
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
|
||||||
|
Ring3SetVirtualAddressMap (
|
||||||
|
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
|
||||||
|
Ring3ConvertPointer (
|
||||||
|
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
|
||||||
|
Ring3GetVariable (
|
||||||
|
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
|
||||||
|
Ring3GetNextVariableName (
|
||||||
|
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
|
||||||
|
Ring3SetVariable (
|
||||||
|
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
|
||||||
|
Ring3GetNextHighMonotonicCount (
|
||||||
|
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
|
||||||
|
Ring3ResetSystem (
|
||||||
|
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
|
||||||
|
Ring3UpdateCapsule (
|
||||||
|
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
|
||||||
|
Ring3QueryCapsuleCapabilities (
|
||||||
|
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
|
||||||
|
Ring3QueryVariableInfo (
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
OUT UINT64 *MaximumVariableStorageSize,
|
||||||
|
OUT UINT64 *RemainingVariableStorageSize,
|
||||||
|
OUT UINT64 *MaximumVariableSize
|
||||||
|
);
|
||||||
|
189
MdeModulePkg/Core/Dxe/DxeRing3/Ring3UefiRuntimeServices.c
Normal file
189
MdeModulePkg/Core/Dxe/DxeRing3/Ring3UefiRuntimeServices.c
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
#include <Uefi.h>
|
||||||
|
|
||||||
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
|
||||||
|
#include "Ring3.h"
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetTime (
|
||||||
|
OUT EFI_TIME *Time,
|
||||||
|
OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: GetTime is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetTime (
|
||||||
|
IN EFI_TIME *Time
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: SetTime is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetWakeupTime (
|
||||||
|
OUT BOOLEAN *Enabled,
|
||||||
|
OUT BOOLEAN *Pending,
|
||||||
|
OUT EFI_TIME *Time
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: GetWakeupTime is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetWakeupTime (
|
||||||
|
IN BOOLEAN Enable,
|
||||||
|
IN EFI_TIME *Time OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: SetWakeupTime is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetVirtualAddressMap (
|
||||||
|
IN UINTN MemoryMapSize,
|
||||||
|
IN UINTN DescriptorSize,
|
||||||
|
IN UINT32 DescriptorVersion,
|
||||||
|
IN EFI_MEMORY_DESCRIPTOR *VirtualMap
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: SetVirtualAddressMap is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3ConvertPointer (
|
||||||
|
IN UINTN DebugDisposition,
|
||||||
|
IN OUT VOID **Address
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: ConvertPointer is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetVariable (
|
||||||
|
IN CHAR16 *VariableName,
|
||||||
|
IN EFI_GUID *VendorGuid,
|
||||||
|
OUT UINT32 *Attributes OPTIONAL,
|
||||||
|
IN OUT UINTN *DataSize,
|
||||||
|
OUT VOID *Data OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: GetVariable is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetNextVariableName (
|
||||||
|
IN OUT UINTN *VariableNameSize,
|
||||||
|
IN OUT CHAR16 *VariableName,
|
||||||
|
IN OUT EFI_GUID *VendorGuid
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: GetNextVariableName is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3SetVariable (
|
||||||
|
IN CHAR16 *VariableName,
|
||||||
|
IN EFI_GUID *VendorGuid,
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN VOID *Data
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: SetVariable is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3GetNextHighMonotonicCount (
|
||||||
|
OUT UINT32 *HighCount
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: GetNextHighMonotonicCount is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
Ring3ResetSystem (
|
||||||
|
IN EFI_RESET_TYPE ResetType,
|
||||||
|
IN EFI_STATUS ResetStatus,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN VOID *ResetData OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: ResetSystem is not supported\n"));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3UpdateCapsule (
|
||||||
|
IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
|
||||||
|
IN UINTN CapsuleCount,
|
||||||
|
IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: UpdateCapsule is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3QueryCapsuleCapabilities (
|
||||||
|
IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
|
||||||
|
IN UINTN CapsuleCount,
|
||||||
|
OUT UINT64 *MaximumCapsuleSize,
|
||||||
|
OUT EFI_RESET_TYPE *ResetType
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: QueryCapsuleCapabilities is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
Ring3QueryVariableInfo (
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
OUT UINT64 *MaximumVariableStorageSize,
|
||||||
|
OUT UINT64 *RemainingVariableStorageSize,
|
||||||
|
OUT UINT64 *MaximumVariableSize
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: QueryVariableInfo is not supported\n"));
|
||||||
|
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
@ -2014,6 +2014,9 @@ typedef struct {
|
|||||||
} EFI_BOOT_SERVICES;
|
} EFI_BOOT_SERVICES;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
//
|
||||||
|
// BootServices
|
||||||
|
//
|
||||||
SysCallReturnToCore, // Must always be zero for CoreBootServices.nasm.
|
SysCallReturnToCore, // Must always be zero for CoreBootServices.nasm.
|
||||||
SysCallLocateProtocol,
|
SysCallLocateProtocol,
|
||||||
SysCallOpenProtocol,
|
SysCallOpenProtocol,
|
||||||
@ -2025,6 +2028,9 @@ typedef enum {
|
|||||||
SysCallRaiseTpl,
|
SysCallRaiseTpl,
|
||||||
SysCallRestoreTpl,
|
SysCallRestoreTpl,
|
||||||
//
|
//
|
||||||
|
// RuntimeServices
|
||||||
|
//
|
||||||
|
//
|
||||||
// Protocols
|
// Protocols
|
||||||
//
|
//
|
||||||
SysCallBlockIoReset,
|
SysCallBlockIoReset,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user