mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 13:44:33 +02:00
Ring3: Added debug printings and some fixes for FAT wrappers.
This commit is contained in:
parent
38e92b2072
commit
d4bdb042e1
@ -158,6 +158,8 @@ Ring3GetMemoryMap (
|
|||||||
OUT UINT32 *DescriptorVersion
|
OUT UINT32 *DescriptorVersion
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: GetMemoryMap is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,6 +173,8 @@ Ring3CreateEvent (
|
|||||||
OUT EFI_EVENT *Event
|
OUT EFI_EVENT *Event
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: CreateEvent is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,6 +186,8 @@ Ring3SetTimer (
|
|||||||
IN UINT64 TriggerTime
|
IN UINT64 TriggerTime
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: SetTimer is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,6 +199,8 @@ Ring3WaitForEvent (
|
|||||||
OUT UINTN *UserIndex
|
OUT UINTN *UserIndex
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: WaitForEvent is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,6 +210,8 @@ Ring3SignalEvent (
|
|||||||
IN EFI_EVENT UserEvent
|
IN EFI_EVENT UserEvent
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: SignalEvent is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +221,8 @@ Ring3CloseEvent (
|
|||||||
IN EFI_EVENT UserEvent
|
IN EFI_EVENT UserEvent
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: CloseEvent is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,6 +232,8 @@ Ring3CheckEvent (
|
|||||||
IN EFI_EVENT UserEvent
|
IN EFI_EVENT UserEvent
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: CheckEvent is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,6 +246,8 @@ Ring3InstallProtocolInterface (
|
|||||||
IN VOID *Interface
|
IN VOID *Interface
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: InstallProtocolInterface is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,6 +260,8 @@ Ring3ReinstallProtocolInterface (
|
|||||||
IN VOID *NewInterface
|
IN VOID *NewInterface
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: ReinstallProtocolInterface is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,6 +273,8 @@ Ring3UninstallProtocolInterface (
|
|||||||
IN VOID *Interface
|
IN VOID *Interface
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: UninstallProtocolInterface is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,6 +310,8 @@ Ring3RegisterProtocolNotify (
|
|||||||
OUT VOID **Registration
|
OUT VOID **Registration
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: RegisterProtocolNotify is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,6 +325,8 @@ Ring3LocateHandle (
|
|||||||
OUT EFI_HANDLE *Buffer
|
OUT EFI_HANDLE *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: LocateHandle is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,6 +338,8 @@ Ring3LocateDevicePath (
|
|||||||
OUT EFI_HANDLE *Device
|
OUT EFI_HANDLE *Device
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: LocateDevicePath is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,6 +350,8 @@ Ring3InstallConfigurationTable (
|
|||||||
IN VOID *Table
|
IN VOID *Table
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: InstallConfigurationTable is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,6 +366,8 @@ Ring3LoadImage (
|
|||||||
OUT EFI_HANDLE *ImageHandle
|
OUT EFI_HANDLE *ImageHandle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: LoadImage is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,6 +379,8 @@ Ring3StartImage (
|
|||||||
OUT CHAR16 **ExitData OPTIONAL
|
OUT CHAR16 **ExitData OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: StartImage is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,6 +393,8 @@ Ring3Exit (
|
|||||||
IN CHAR16 *ExitData OPTIONAL
|
IN CHAR16 *ExitData OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: Exit is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,6 +404,8 @@ Ring3UnloadImage (
|
|||||||
IN EFI_HANDLE ImageHandle
|
IN EFI_HANDLE ImageHandle
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: UnloadImage is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,6 +416,8 @@ Ring3ExitBootServices (
|
|||||||
IN UINTN MapKey
|
IN UINTN MapKey
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: ExitBootServices is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,6 +427,8 @@ Ring3GetNextMonotonicCount (
|
|||||||
OUT UINT64 *Count
|
OUT UINT64 *Count
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: GetNextMonotonicCount is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,6 +438,8 @@ Ring3Stall (
|
|||||||
IN UINTN Microseconds
|
IN UINTN Microseconds
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: Stall is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,6 +452,8 @@ Ring3SetWatchdogTimer (
|
|||||||
IN CHAR16 *WatchdogData OPTIONAL
|
IN CHAR16 *WatchdogData OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: SetWatchdogTimer is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -422,6 +466,8 @@ Ring3ConnectController (
|
|||||||
IN BOOLEAN Recursive
|
IN BOOLEAN Recursive
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: ConnectController is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,6 +479,8 @@ Ring3DisconnectController (
|
|||||||
IN EFI_HANDLE ChildHandle OPTIONAL
|
IN EFI_HANDLE ChildHandle OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: DisconnectController is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,7 +510,7 @@ Ring3OpenProtocol (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FixInterface (Protocol, Interface);
|
return (Interface != NULL) ? FixInterface (Protocol, Interface) : Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -492,6 +540,8 @@ Ring3OpenProtocolInformation (
|
|||||||
OUT UINTN *EntryCount
|
OUT UINTN *EntryCount
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: OpenProtocolInformation is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,6 +553,8 @@ Ring3ProtocolsPerHandle (
|
|||||||
OUT UINTN *ProtocolBufferCount
|
OUT UINTN *ProtocolBufferCount
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: ProtocolsPerHandle is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,6 +568,8 @@ Ring3LocateHandleBuffer (
|
|||||||
OUT EFI_HANDLE **Buffer
|
OUT EFI_HANDLE **Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: LocateHandleBuffer is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,6 +639,8 @@ Ring3UninstallMultipleProtocolInterfaces (
|
|||||||
...
|
...
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: UninstallMultipleProtocolInterfaces is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,6 +652,8 @@ Ring3CalculateCrc32 (
|
|||||||
OUT UINT32 *Crc32
|
OUT UINT32 *Crc32
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: CalculateCrc32 is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,6 +668,8 @@ Ring3CreateEventEx (
|
|||||||
OUT EFI_EVENT *Event
|
OUT EFI_EVENT *Event
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DEBUG ((DEBUG_ERROR, "Ring3: CreateEventEx is not supported\n"));
|
||||||
|
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ ProtectUefiImage (
|
|||||||
//
|
//
|
||||||
// CPU ARCH present. Update memory attribute directly.
|
// CPU ARCH present. Update memory attribute directly.
|
||||||
//
|
//
|
||||||
if (AsciiStrStr (PdbPointer, "Ntfs") != NULL) {
|
if (AsciiStrStr (PdbPointer, "Fat") != NULL) {
|
||||||
SetUefiImageProtectionAttributes (ImageRecord, TRUE);
|
SetUefiImageProtectionAttributes (ImageRecord, TRUE);
|
||||||
*IsUserImage = TRUE;
|
*IsUserImage = TRUE;
|
||||||
} else if (AsciiStrStr (PdbPointer, "Ring3") != NULL) {
|
} else if (AsciiStrStr (PdbPointer, "Ring3") != NULL) {
|
||||||
|
@ -63,6 +63,11 @@ FindGuid (
|
|||||||
*Core = &gEfiComponentNameProtocolGuid;
|
*Core = &gEfiComponentNameProtocolGuid;
|
||||||
*CoreSize = sizeof (EFI_COMPONENT_NAME_PROTOCOL);
|
*CoreSize = sizeof (EFI_COMPONENT_NAME_PROTOCOL);
|
||||||
|
|
||||||
|
} else if (CompareGuid (Ring3, &gEfiComponentName2ProtocolGuid)) {
|
||||||
|
|
||||||
|
*Core = &gEfiComponentName2ProtocolGuid;
|
||||||
|
*CoreSize = sizeof (EFI_COMPONENT_NAME2_PROTOCOL);
|
||||||
|
|
||||||
} else if (CompareGuid (Ring3, &gEfiDevicePathProtocolGuid)) {
|
} else if (CompareGuid (Ring3, &gEfiDevicePathProtocolGuid)) {
|
||||||
|
|
||||||
*Core = &gEfiDevicePathProtocolGuid;
|
*Core = &gEfiDevicePathProtocolGuid;
|
||||||
@ -74,7 +79,7 @@ FindGuid (
|
|||||||
*CoreSize = sizeof (EFI_SIMPLE_FILE_SYSTEM_PROTOCOL);
|
*CoreSize = sizeof (EFI_SIMPLE_FILE_SYSTEM_PROTOCOL);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG ((DEBUG_ERROR, "Ring0: Unknown protocol.\n"));
|
DEBUG ((DEBUG_ERROR, "Ring0: Unknown protocol - %g.\n", Ring3));
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +227,7 @@ CallBootService (
|
|||||||
//
|
//
|
||||||
// Argument 1: EFI_HANDLE CoreUserHandle
|
// Argument 1: EFI_HANDLE CoreUserHandle
|
||||||
// Argument 2: EFI_GUID *Protocol
|
// Argument 2: EFI_GUID *Protocol
|
||||||
// Argument 3: VOID **Interface
|
// Argument 3: VOID **Interface OPTIONAL
|
||||||
// Argument 4: EFI_HANDLE CoreImageHandle
|
// Argument 4: EFI_HANDLE CoreImageHandle
|
||||||
// Argument 5: EFI_HANDLE CoreControllerHandle
|
// Argument 5: EFI_HANDLE CoreControllerHandle
|
||||||
// Argument 6: UINT32 Attributes
|
// Argument 6: UINT32 Attributes
|
||||||
@ -231,10 +236,12 @@ CallBootService (
|
|||||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)(CoreRbp->Argument2 + sizeof (EFI_GUID) - 1), &Attributes);
|
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)(CoreRbp->Argument2 + sizeof (EFI_GUID) - 1), &Attributes);
|
||||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)CoreRbp->Argument3, &Attributes);
|
if ((VOID **)CoreRbp->Argument3 != NULL) {
|
||||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)CoreRbp->Argument3, &Attributes);
|
||||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)(CoreRbp->Argument3 + sizeof (VOID *) - 1), &Attributes);
|
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)(CoreRbp->Argument3 + sizeof (VOID *) - 1), &Attributes);
|
||||||
|
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||||
|
}
|
||||||
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)((UINTN)UserRsp + 8 * sizeof (UINTN) - 1), &Attributes);
|
gCpu->GetMemoryAttributes (gCpu, (EFI_PHYSICAL_ADDRESS)((UINTN)UserRsp + 8 * sizeof (UINTN) - 1), &Attributes);
|
||||||
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
ASSERT ((Attributes & EFI_MEMORY_USER) != 0);
|
||||||
|
|
||||||
@ -253,7 +260,7 @@ CallBootService (
|
|||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
(EFI_HANDLE)CoreRbp->Argument1,
|
(EFI_HANDLE)CoreRbp->Argument1,
|
||||||
CoreProtocol,
|
CoreProtocol,
|
||||||
&Interface,
|
((VOID **)CoreRbp->Argument3 != NULL) ? &Interface : NULL,
|
||||||
(EFI_HANDLE)Argument4,
|
(EFI_HANDLE)Argument4,
|
||||||
(EFI_HANDLE)Argument5,
|
(EFI_HANDLE)Argument5,
|
||||||
(UINT32)Argument6
|
(UINT32)Argument6
|
||||||
@ -264,7 +271,9 @@ CallBootService (
|
|||||||
Interface = PrepareRing3Interface (CoreProtocol, Interface, MemoryCoreSize);
|
Interface = PrepareRing3Interface (CoreProtocol, Interface, MemoryCoreSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
*(VOID **)CoreRbp->Argument3 = Interface;
|
if ((VOID **)CoreRbp->Argument3 != NULL) {
|
||||||
|
*(VOID **)CoreRbp->Argument3 = Interface;
|
||||||
|
}
|
||||||
EnableSMAP ();
|
EnableSMAP ();
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user