mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
SysCall: Fixed page fault for ARM.
This commit is contained in:
parent
0dd56c8dae
commit
760614b0c5
@ -11,6 +11,7 @@
|
|||||||
#include "DxeMain.h"
|
#include "DxeMain.h"
|
||||||
|
|
||||||
STATIC UINTN mCoreSp;
|
STATIC UINTN mCoreSp;
|
||||||
|
extern UINTN gUartBaseAddress;
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -64,6 +65,12 @@ SysCallBootService (
|
|||||||
// All remaining arguments are on User Stack.
|
// All remaining arguments are on User Stack.
|
||||||
//
|
//
|
||||||
CopyMem ((VOID *)((UINTN)Physical + 5 * sizeof (UINTN)), (VOID *)UserRsp, 4 * sizeof (UINTN));
|
CopyMem ((VOID *)((UINTN)Physical + 5 * sizeof (UINTN)), (VOID *)UserRsp, 4 * sizeof (UINTN));
|
||||||
|
|
||||||
|
SetUefiImageMemoryAttributes (
|
||||||
|
gUartBaseAddress,
|
||||||
|
EFI_PAGE_SIZE,
|
||||||
|
EFI_MEMORY_XP
|
||||||
|
);
|
||||||
ForbidSupervisorAccessToUserMemory ();
|
ForbidSupervisorAccessToUserMemory ();
|
||||||
|
|
||||||
Status = CallBootService (
|
Status = CallBootService (
|
||||||
@ -72,6 +79,12 @@ SysCallBootService (
|
|||||||
(RING3_STACK *)(UINTN)Physical
|
(RING3_STACK *)(UINTN)Physical
|
||||||
);
|
);
|
||||||
|
|
||||||
|
SetUefiImageMemoryAttributes (
|
||||||
|
gUartBaseAddress,
|
||||||
|
EFI_PAGE_SIZE,
|
||||||
|
EFI_MEMORY_XP | EFI_MEMORY_USER
|
||||||
|
);
|
||||||
|
|
||||||
CoreFreePages (Physical, EFI_SIZE_TO_PAGES (9 * sizeof (UINTN)));
|
CoreFreePages (Physical, EFI_SIZE_TO_PAGES (9 * sizeof (UINTN)));
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
@ -84,10 +97,6 @@ InitializeMsr (
|
|||||||
IN UINTN NumberOfEntries
|
IN UINTN NumberOfEntries
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// TODO: EFI_CONFIGURATION_TABLE, HOB_DATA, Uart are accessible to User.
|
|
||||||
// Fix PageTable initialization.
|
|
||||||
//
|
|
||||||
if (ArmHasPan ()) {
|
if (ArmHasPan ()) {
|
||||||
//
|
//
|
||||||
// Enable Privileged Access Never feature.
|
// Enable Privileged Access Never feature.
|
||||||
|
@ -13,7 +13,7 @@ EFI_FILE_PROTOCOL mRing3FileProtocol;
|
|||||||
|
|
||||||
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *mRing3SimpleFileSystemPointer;
|
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *mRing3SimpleFileSystemPointer;
|
||||||
|
|
||||||
#if defined (MDE_CPU_AARCH64)
|
#if defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)
|
||||||
extern UINTN gUartBaseAddress;
|
extern UINTN gUartBaseAddress;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ GoToRing3 (
|
|||||||
EFI_MEMORY_XP | EFI_MEMORY_USER
|
EFI_MEMORY_XP | EFI_MEMORY_USER
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#elif defined (MDE_CPU_AARCH64)
|
#elif defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)
|
||||||
//
|
//
|
||||||
// Necessary fix for DEBUG printings.
|
// Necessary fix for DEBUG printings.
|
||||||
//
|
//
|
||||||
@ -93,7 +93,7 @@ GoToRing3 (
|
|||||||
EFI_MEMORY_XP
|
EFI_MEMORY_XP
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
#elif defined (MDE_CPU_AARCH64)
|
#elif defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)
|
||||||
//
|
//
|
||||||
// Problem 2: Uart memory maped page is not allocated at the very beginnig
|
// Problem 2: Uart memory maped page is not allocated at the very beginnig
|
||||||
// and can be used for translation table later.
|
// and can be used for translation table later.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user