mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
Ring3: Prevented loading of DxeRing3 driver, when UserSpace is disabled.
This commit is contained in:
parent
b6a7e2b3be
commit
8671f61ca4
@ -29,11 +29,10 @@ DebugLibFdtPL011UartUserConstructor (
|
|||||||
for (Index = 0; Index < SystemTable->NumberOfTableEntries; ++Index) {
|
for (Index = 0; Index < SystemTable->NumberOfTableEntries; ++Index) {
|
||||||
if (CompareGuid (&gEarlyPL011BaseAddressGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {
|
if (CompareGuid (&gEarlyPL011BaseAddressGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {
|
||||||
mDebugLibFdtPL011UartAddress = (UINTN)SystemTable->ConfigurationTable[Index].VendorTable;
|
mDebugLibFdtPL011UartAddress = (UINTN)SystemTable->ConfigurationTable[Index].VendorTable;
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_NOT_FOUND;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,6 +23,7 @@ typedef struct {
|
|||||||
STATIC LIST_ENTRY mAvailableEmulators;
|
STATIC LIST_ENTRY mAvailableEmulators;
|
||||||
STATIC EFI_EVENT mPeCoffEmuProtocolRegistrationEvent;
|
STATIC EFI_EVENT mPeCoffEmuProtocolRegistrationEvent;
|
||||||
STATIC VOID *mPeCoffEmuProtocolNotifyRegistration;
|
STATIC VOID *mPeCoffEmuProtocolNotifyRegistration;
|
||||||
|
STATIC BOOLEAN mDxeRing3 = TRUE;
|
||||||
|
|
||||||
extern BOOLEAN gBdsStarted;
|
extern BOOLEAN gBdsStarted;
|
||||||
|
|
||||||
@ -1348,6 +1349,12 @@ CoreLoadImageCommon (
|
|||||||
Image->Info.ParentHandle = ParentImageHandle;
|
Image->Info.ParentHandle = ParentImageHandle;
|
||||||
Image->IsUserImage = (FileAttributes & EFI_FV_FILE_ATTRIB_USER) != 0;
|
Image->IsUserImage = (FileAttributes & EFI_FV_FILE_ATTRIB_USER) != 0;
|
||||||
|
|
||||||
|
if ((!PcdGetBool (PcdEnableUserSpace)) && Image->IsUserImage && mDxeRing3) {
|
||||||
|
mDxeRing3 = FALSE;
|
||||||
|
Status = EFI_NOT_STARTED;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
if (NumberOfPages != NULL) {
|
if (NumberOfPages != NULL) {
|
||||||
Image->NumberOfPages = *NumberOfPages;
|
Image->NumberOfPages = *NumberOfPages;
|
||||||
} else {
|
} else {
|
||||||
@ -1444,7 +1451,7 @@ CoreLoadImageCommon (
|
|||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
ProtectUefiImage (&Image->Info, ImageOrigin, &ImageContext, Image->IsUserImage);
|
ProtectUefiImage (&Image->Info, ImageOrigin, &ImageContext, Image->IsUserImage);
|
||||||
|
|
||||||
if ((gRing3Data != NULL) && Image->IsUserImage) {
|
if (PcdGetBool (PcdEnableUserSpace) && (gRing3Data != NULL) && Image->IsUserImage) {
|
||||||
Image->UserPageTable = InitializeUserPageTable (Image);
|
Image->UserPageTable = InitializeUserPageTable (Image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user