mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
Ring3: Added SysCallAllocatePool.
This commit is contained in:
parent
2090f6ef7e
commit
b08d7cbb16
@ -77,7 +77,19 @@ Ring3AllocatePool (
|
||||
OUT VOID **Buffer
|
||||
)
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
EFI_STATUS Status;
|
||||
|
||||
Status = SysCall (
|
||||
SysCallAllocatePool,
|
||||
PoolType,
|
||||
Size,
|
||||
Buffer
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "Ring3: Failed to allocate %d bytes.\n", Size));
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
|
@ -310,6 +310,9 @@ GetPermissionAttributeForMemoryType (
|
||||
)
|
||||
{
|
||||
UINT64 TestBit;
|
||||
UINT64 Attributes;
|
||||
|
||||
Attributes = 0;
|
||||
|
||||
if ((UINT32)MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
|
||||
TestBit = BIT63;
|
||||
@ -320,10 +323,14 @@ GetPermissionAttributeForMemoryType (
|
||||
}
|
||||
|
||||
if ((PcdGet64 (PcdDxeNxMemoryProtectionPolicy) & TestBit) != 0) {
|
||||
return EFI_MEMORY_XP;
|
||||
} else {
|
||||
return 0;
|
||||
Attributes |= EFI_MEMORY_XP;
|
||||
}
|
||||
|
||||
if (MemoryType == EfiRing3MemoryType) {
|
||||
Attributes |= EFI_MEMORY_USER;
|
||||
}
|
||||
|
||||
return Attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -203,6 +203,21 @@ CallBootService (
|
||||
|
||||
return Status;
|
||||
|
||||
case SysCallAllocatePool:
|
||||
//
|
||||
// Argument 1: EFI_MEMORY_TYPE PoolType
|
||||
// Argument 2: UINTN Size
|
||||
// Argument 3: VOID **Buffer
|
||||
//
|
||||
DisableSMAP ();
|
||||
Status = gBS->AllocatePool (
|
||||
EfiRing3MemoryType,
|
||||
CoreRbp->Argument2,
|
||||
(VOID **)CoreRbp->Argument3
|
||||
);
|
||||
EnableSMAP ();
|
||||
|
||||
return Status;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -108,6 +108,10 @@ typedef enum {
|
||||
/// by a corresponding call to the underlying isolation architecture.
|
||||
///
|
||||
EfiUnacceptedMemoryType,
|
||||
///
|
||||
/// Memory allocated for (by) Ring3 Images.
|
||||
///
|
||||
EfiRing3MemoryType,
|
||||
EfiMaxMemoryType
|
||||
} EFI_MEMORY_TYPE;
|
||||
|
||||
|
@ -2014,10 +2014,11 @@ typedef struct {
|
||||
} EFI_BOOT_SERVICES;
|
||||
|
||||
typedef enum {
|
||||
SysCallReturnToCore = 0,
|
||||
SysCallLocateProtocol = 1,
|
||||
SysCallOpenProtocol = 2,
|
||||
SysCallInstallMultipleProtocolInterfaces = 3,
|
||||
SysCallReturnToCore, // Must always be zero for CoreBootServices.nasm.
|
||||
SysCallLocateProtocol,
|
||||
SysCallOpenProtocol,
|
||||
SysCallInstallMultipleProtocolInterfaces,
|
||||
SysCallAllocatePool,
|
||||
SysCallMax
|
||||
} SYS_CALL_TYPE;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user