From f3b5cea96693287873f624271d3b175af6d92ea9 Mon Sep 17 00:00:00 2001 From: Mikhail Krichanov Date: Thu, 9 Jan 2025 11:51:06 +0300 Subject: [PATCH] SysCall: Fixed line endings. --- .../Core/Dxe/SysCall/Initialization.c | 194 +++++++++--------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/SysCall/Initialization.c b/MdeModulePkg/Core/Dxe/SysCall/Initialization.c index a175d47247..171f70f962 100644 --- a/MdeModulePkg/Core/Dxe/SysCall/Initialization.c +++ b/MdeModulePkg/Core/Dxe/SysCall/Initialization.c @@ -232,36 +232,36 @@ InitializeUserPageTable ( EFI_MEMORY_XP | EFI_MEMORY_USER ); - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - (UINTN)gRing3Interfaces, - EFI_PAGES_TO_SIZE (RING3_INTERFACES_PAGES), - EFI_MEMORY_XP | EFI_MEMORY_USER - ); + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + (UINTN)gRing3Interfaces, + EFI_PAGES_TO_SIZE (RING3_INTERFACES_PAGES), + EFI_MEMORY_XP | EFI_MEMORY_USER + ); - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - (UINTN)gRing3CallStackBase, - EFI_SIZE_TO_PAGES (USER_STACK_SIZE) * EFI_PAGE_SIZE, - EFI_MEMORY_XP | EFI_MEMORY_USER - ); + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + (UINTN)gRing3CallStackBase, + EFI_SIZE_TO_PAGES (USER_STACK_SIZE) * EFI_PAGE_SIZE, + EFI_MEMORY_XP | EFI_MEMORY_USER + ); - SectionAddress = mDxeRing3->StartAddress; - for (Index = 0; Index < mDxeRing3->NumSegments; Index++) { - ImageRecordSegment = &mDxeRing3->Segments[Index]; - - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - SectionAddress, - ImageRecordSegment->Size, - ImageRecordSegment->Attributes | EFI_MEMORY_USER - ); - - SectionAddress += ImageRecordSegment->Size; - } + SectionAddress = mDxeRing3->StartAddress; + for (Index = 0; Index < mDxeRing3->NumSegments; Index++) { + ImageRecordSegment = &mDxeRing3->Segments[Index]; + + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + SectionAddress, + ImageRecordSegment->Size, + ImageRecordSegment->Attributes | EFI_MEMORY_USER + ); + + SectionAddress += ImageRecordSegment->Size; + } // // Map CoreBootServices, gCoreSysCallStackBase @@ -274,61 +274,61 @@ InitializeUserPageTable ( EFI_MEMORY_RO ); - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - (UINTN)gCoreSysCallStackBase, - EFI_SIZE_TO_PAGES (USER_STACK_SIZE) * EFI_PAGE_SIZE, - EFI_MEMORY_XP - ); - + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + (UINTN)gCoreSysCallStackBase, + EFI_SIZE_TO_PAGES (USER_STACK_SIZE) * EFI_PAGE_SIZE, + EFI_MEMORY_XP + ); + // // Map ExceptionHandlers, ExceptionStacks, Idt // - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - mExceptionAddresses->ExceptionHandlerBase, - mExceptionAddresses->ExceptionHandlerSize, - EFI_MEMORY_RO - ); - - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - mExceptionAddresses->ExceptionDataBase, - SIZE_4KB, - EFI_MEMORY_XP - ); - -#if defined (MDE_CPU_X64) || defined (MDE_CPU_IA32) - IA32_DESCRIPTOR IdtDescriptor; - - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - (UINTN)&gCorePageTable, - SIZE_4KB, - EFI_MEMORY_RO | EFI_MEMORY_XP - ); - - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - mExceptionAddresses->ExceptionStackBase, - mExceptionAddresses->ExceptionStackSize, - EFI_MEMORY_XP - ); - - AsmReadIdtr (&IdtDescriptor); - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - IdtDescriptor.Base, - SIZE_4KB, - EFI_MEMORY_RO | EFI_MEMORY_XP - ); - + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + mExceptionAddresses->ExceptionHandlerBase, + mExceptionAddresses->ExceptionHandlerSize, + EFI_MEMORY_RO + ); + + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + mExceptionAddresses->ExceptionDataBase, + SIZE_4KB, + EFI_MEMORY_XP + ); + +#if defined (MDE_CPU_X64) || defined (MDE_CPU_IA32) + IA32_DESCRIPTOR IdtDescriptor; + + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + (UINTN)&gCorePageTable, + SIZE_4KB, + EFI_MEMORY_RO | EFI_MEMORY_XP + ); + + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + mExceptionAddresses->ExceptionStackBase, + mExceptionAddresses->ExceptionStackSize, + EFI_MEMORY_XP + ); + + AsmReadIdtr (&IdtDescriptor); + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + IdtDescriptor.Base, + SIZE_4KB, + EFI_MEMORY_RO | EFI_MEMORY_XP + ); + // // Necessary fix for ProcessLibraryConstructorList() -> DxeCcProbeLibConstructor() // @@ -340,23 +340,23 @@ InitializeUserPageTable ( EFI_MEMORY_XP | EFI_MEMORY_USER ); #elif defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM) - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - mConfigurationTable, - ALIGN_VALUE (mConfigurationTableSize, EFI_PAGE_SIZE), - EFI_MEMORY_XP | EFI_MEMORY_USER - ); - // - // Necessary fix for DEBUG printings. - // - gCpu->SetUserMemoryAttributes ( - gCpu, - UserPageTable, - gUartBaseAddress, - SIZE_4KB, - EFI_MEMORY_XP | EFI_MEMORY_USER - ); + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + mConfigurationTable, + ALIGN_VALUE (mConfigurationTableSize, EFI_PAGE_SIZE), + EFI_MEMORY_XP | EFI_MEMORY_USER + ); + // + // Necessary fix for DEBUG printings. + // + gCpu->SetUserMemoryAttributes ( + gCpu, + UserPageTable, + gUartBaseAddress, + SIZE_4KB, + EFI_MEMORY_XP | EFI_MEMORY_USER + ); #endif //