diff --git a/ArmPkg/Library/ArmExceptionLib/Arm/ExceptionSupport.S b/ArmPkg/Library/ArmExceptionLib/Arm/ExceptionSupport.S index 9c5c6398c1..9245a00dfe 100644 --- a/ArmPkg/Library/ArmExceptionLib/Arm/ExceptionSupport.S +++ b/ArmPkg/Library/ArmExceptionLib/Arm/ExceptionSupport.S @@ -101,7 +101,7 @@ ASM_PFX(Fiq): ASM_PFX(ResetEntry): srsdb #0x13! @ Store return state on SVC stack @ We are already in SVC mode - sub SP, SP, #0x8 @ Save space for TTBR0 + sub SP, SP, #0x8 @ Save space for TTBR0 stmfd SP!,{LR} @ Store the link register for the current mode sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR stmfd SP!,{R0-R12} @ Store the register state @@ -128,7 +128,7 @@ ASM_PFX(SoftwareInterruptEntry): isb srsdb #0x13! @ Store return state on SVC stack @ We are already in SVC mode - sub SP, SP, #0x8 @ Save space for TTBR0 + sub SP, SP, #0x8 @ Save space for TTBR0 stmfd SP!,{LR} @ Store the link register for the current mode sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR stmfd SP!,{R0-R12} @ Store the register state @@ -278,9 +278,9 @@ NoAdjustNeeded: NoTTBR0Switch: -#if (FixedPcdGet32(PcdVFPEnabled)) - vpush {d0-d15} @ save vstm registers in case they are used in optimizations -#endif +#if (FixedPcdGet32(PcdVFPEnabled)) + vpush {d0-d15} @ save vstm registers in case they are used in optimizations +#endif mov R4, SP @ Save current SP tst R4, #4 @@ -301,9 +301,9 @@ CommonCExceptionHandler ( mov SP, R4 @ Restore SP -#if (FixedPcdGet32(PcdVFPEnabled)) - vpop {d0-d15} -#endif +#if (FixedPcdGet32(PcdVFPEnabled)) + vpop {d0-d15} +#endif ldr R4, [SP, #0x40] @ Saved Processor Status Register and R4, R4, #0xF diff --git a/MdeModulePkg/Core/Dxe/SysCall/ARM/CoreBootServices.S b/MdeModulePkg/Core/Dxe/SysCall/ARM/CoreBootServices.S index 0fa82094ac..73d968b971 100644 --- a/MdeModulePkg/Core/Dxe/SysCall/ARM/CoreBootServices.S +++ b/MdeModulePkg/Core/Dxe/SysCall/ARM/CoreBootServices.S @@ -139,9 +139,9 @@ ASM_FUNC(ReturnToCore) #endif // Restore old SP_usr and LR_usr. - ldmia SP, {SP, LR}^ - add SP, SP, #0x8 - + ldmia SP, {SP, LR}^ + add SP, SP, #0x8 + pop {R4-R12, LR} // Enable interrupts. diff --git a/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c b/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c index eb4889c4ae..ddfa59a657 100644 --- a/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c +++ b/MdeModulePkg/Core/Dxe/SysCall/SupportedProtocols.c @@ -169,7 +169,7 @@ CoreDriverBindingStart ( RemainingDevicePath ); - gUserPageTable = OldPageTable; + gUserPageTable = OldPageTable; return Status; } @@ -207,7 +207,7 @@ CoreDriverBindingStop ( ChildHandleBuffer ); - gUserPageTable = OldPageTable; + gUserPageTable = OldPageTable; return Status; } @@ -243,7 +243,7 @@ CoreFileClose ( FreePool (UserDriver->CoreWrapper); RemoveEntryList (&UserDriver->Link); - gUserPageTable = OldPageTable; + gUserPageTable = OldPageTable; return Status; } diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c index ce4f32a58f..8490142e8a 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c @@ -205,18 +205,18 @@ GetExceptionAddresses ( return &mAddresses; } -VOID -EFIAPI -SetExceptionAddresses ( - IN VOID *Buffer, - IN UINTN BufferSize - ) -{ - mAddresses.ExceptionStackBase = (UINTN)Buffer; - mAddresses.ExceptionStackSize = BufferSize; - mAddresses.ExceptionHandlerBase = (UINTN)&ExceptionHandlerBase; - mAddresses.ExceptionHandlerSize = (UINTN)&ExceptionHandlerEnd - mAddresses.ExceptionHandlerBase; - mAddresses.ExceptionDataBase = (UINTN)&CorePageTable; - - CorePageTable = AsmReadCr3 (); -} +VOID +EFIAPI +SetExceptionAddresses ( + IN VOID *Buffer, + IN UINTN BufferSize + ) +{ + mAddresses.ExceptionStackBase = (UINTN)Buffer; + mAddresses.ExceptionStackSize = BufferSize; + mAddresses.ExceptionHandlerBase = (UINTN)&ExceptionHandlerBase; + mAddresses.ExceptionHandlerSize = (UINTN)&ExceptionHandlerEnd - mAddresses.ExceptionHandlerBase; + mAddresses.ExceptionDataBase = (UINTN)&CorePageTable; + + CorePageTable = AsmReadCr3 (); +}