From fb47559347a32fc84213f1f172cf34ac8ff33dff Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Fri, 28 Sep 2012 09:54:13 +0000 Subject: ArmPlatformPkg/PrePi: Moved Exception Vector Table to ArmPkg/DebugAgentBaseLib In case a DebugAgent library is supported for a specific debugger, we would expect the exception be caught by DebugAgentLib. The DebugAgentBaseLib exposes the cause of the exception to the user in the Serial Terminal. Signed-off-by: Olivier Martin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13766 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/PrePi/Exception.S | 101 ------------------------------------ ArmPlatformPkg/PrePi/Exception.asm | 91 -------------------------------- ArmPlatformPkg/PrePi/PeiMPCore.inf | 2 - ArmPlatformPkg/PrePi/PeiUniCore.inf | 2 - ArmPlatformPkg/PrePi/PrePi.c | 51 ------------------ ArmPlatformPkg/PrePi/PrePi.h | 8 +-- 6 files changed, 1 insertion(+), 254 deletions(-) delete mode 100755 ArmPlatformPkg/PrePi/Exception.S delete mode 100644 ArmPlatformPkg/PrePi/Exception.asm (limited to 'ArmPlatformPkg/PrePi') diff --git a/ArmPlatformPkg/PrePi/Exception.S b/ArmPlatformPkg/PrePi/Exception.S deleted file mode 100755 index bd59682237..0000000000 --- a/ArmPlatformPkg/PrePi/Exception.S +++ /dev/null @@ -1,101 +0,0 @@ -// -// Copyright (c) 2011, ARM Limited. All rights reserved. -// -# This program and the accompanying materials -# are licensed and made available under the terms and conditions of the BSD License -# which accompanies this distribution. The full text of the license may be found at -# http://opensource.org/licenses/bsd-license.php -# -# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -# -# - -#include -#include -#include - -#start of the code section -.text -.align 5 - -# IMPORT -GCC_ASM_IMPORT(PrePiCommonExceptionEntry) - -# EXPORT -GCC_ASM_EXPORT(PrePiVectorTable) - -//============================================================ -//Default Exception Handlers -//============================================================ - -ASM_PFX(PrePiVectorTable): - b _DefaultResetHandler - b _DefaultUndefined - b _DefaultSWI - b _DefaultPrefetchAbort - b _DefaultDataAbort - b _DefaultReserved - b _DefaultIrq - b _DefaultFiq - -// -// Default Exception handlers: There is no plan to return from any of these exceptions. -// No context saving at all. -// -_DefaultResetHandler: - mov r1, lr - # Switch to SVC for common stack - cps #0x13 - mov r0, #0 - blx ASM_PFX(PrePiCommonExceptionEntry) - -_DefaultUndefined: - sub r1, LR, #4 - # Switch to SVC for common stack - cps #0x13 - mov r0, #1 - blx ASM_PFX(PrePiCommonExceptionEntry) - -_DefaultSWI: - sub r1, LR, #4 - # Switch to SVC for common stack - cps #0x13 - mov r0, #2 - blx ASM_PFX(PrePiCommonExceptionEntry) - -_DefaultPrefetchAbort: - sub r1, LR, #4 - # Switch to SVC for common stack - cps #0x13 - mov r0, #3 - blx ASM_PFX(PrePiCommonExceptionEntry) - -_DefaultDataAbort: - sub r1, LR, #8 - # Switch to SVC for common stack - cps #0x13 - mov r0, #4 - blx ASM_PFX(PrePiCommonExceptionEntry) - -_DefaultReserved: - mov r1, lr - # Switch to SVC for common stack - cps #0x13 - mov r0, #5 - blx ASM_PFX(PrePiCommonExceptionEntry) - -_DefaultIrq: - sub r1, LR, #4 - # Switch to SVC for common stack - cps #0x13 - mov r0, #6 - blx ASM_PFX(PrePiCommonExceptionEntry) - -_DefaultFiq: - sub r1, LR, #4 - # Switch to SVC for common stack - cps #0x13 - mov r0, #7 - blx ASM_PFX(PrePiCommonExceptionEntry) - diff --git a/ArmPlatformPkg/PrePi/Exception.asm b/ArmPlatformPkg/PrePi/Exception.asm deleted file mode 100644 index 26f41d19e0..0000000000 --- a/ArmPlatformPkg/PrePi/Exception.asm +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) 2011, ARM Limited. All rights reserved. -// -// This program and the accompanying materials -// are licensed and made available under the terms and conditions of the BSD License -// which accompanies this distribution. The full text of the license may be found at -// http://opensource.org/licenses/bsd-license.php -// -// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -// -// - -#include -#include -#include - - IMPORT PrePiCommonExceptionEntry - EXPORT PrePiVectorTable - - PRESERVE8 - AREA PrePeiCoreException, CODE, READONLY, CODEALIGN, ALIGN=5 - -//============================================================ -//Default Exception Handlers -//============================================================ -//TODO: there should be better way to handle the exceptions during the early stage. At the moment they are spinning in infinite loop - -PrePiVectorTable - b _DefaultResetHandler - b _DefaultUndefined - b _DefaultSWI - b _DefaultPrefetchAbort - b _DefaultDataAbort - b _DefaultReserved - b _DefaultIrq - b _DefaultFiq - -// -// Default Exception handlers: There is no plan to return from any of these exceptions. -// No context saving at all. -// -_DefaultResetHandler - mov r1, lr - cps #0x13 ; Switch to SVC for common stack - mov r0, #0 - blx PrePiCommonExceptionEntry - -_DefaultUndefined - sub r1, LR, #4 - cps #0x13 ; Switch to SVC for common stack - mov r0, #1 - blx PrePiCommonExceptionEntry - -_DefaultSWI - sub r1, LR, #4 - cps #0x13 ; Switch to SVC for common stack - mov r0, #2 - blx PrePiCommonExceptionEntry - -_DefaultPrefetchAbort - sub r1, LR, #4 - cps #0x13 ; Switch to SVC for common stack - mov r0, #3 - blx PrePiCommonExceptionEntry - -_DefaultDataAbort - sub r1, LR, #8 - cps #0x13 ; Switch to SVC for common stack - mov r0, #4 - blx PrePiCommonExceptionEntry - -_DefaultReserved - mov r1, lr - cps #0x13 ; Switch to SVC for common stack - mov r0, #5 - blx PrePiCommonExceptionEntry - -_DefaultIrq - sub r1, LR, #4 - cps #0x13 ; Switch to SVC for common stack - mov r0, #6 - blx PrePiCommonExceptionEntry - -_DefaultFiq - sub r1, LR, #4 - cps #0x13 ; Switch to SVC for common stack - mov r0, #7 - blx PrePiCommonExceptionEntry - - END diff --git a/ArmPlatformPkg/PrePi/PeiMPCore.inf b/ArmPlatformPkg/PrePi/PeiMPCore.inf index df89dfd3a7..cd61b7a2fc 100755 --- a/ArmPlatformPkg/PrePi/PeiMPCore.inf +++ b/ArmPlatformPkg/PrePi/PeiMPCore.inf @@ -23,8 +23,6 @@ PrePi.c ModuleEntryPoint.S | GCC ModuleEntryPoint.asm | RVCT - Exception.S | GCC - Exception.asm | RVCT MainMPCore.c [Packages] diff --git a/ArmPlatformPkg/PrePi/PeiUniCore.inf b/ArmPlatformPkg/PrePi/PeiUniCore.inf index 1a59fdc086..f28768ecf8 100755 --- a/ArmPlatformPkg/PrePi/PeiUniCore.inf +++ b/ArmPlatformPkg/PrePi/PeiUniCore.inf @@ -23,8 +23,6 @@ PrePi.c ModuleEntryPoint.S | GCC ModuleEntryPoint.asm | RVCT - Exception.asm | RVCT - Exception.S | GCC MainUniCore.c [Packages] diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c index c393812439..c3fca90ca9 100755 --- a/ArmPlatformPkg/PrePi/PrePi.c +++ b/ArmPlatformPkg/PrePi/PrePi.c @@ -36,12 +36,6 @@ // Not used when PrePi in run in XIP mode UINTN mGlobalVariableBase = 0; -VOID -PrePiCommonExceptionEntry ( - IN UINT32 Entry, - IN UINT32 LR - ); - EFI_STATUS EFIAPI ExtractGuidedSectionLibConstructor ( @@ -256,10 +250,6 @@ CEntryPoint ( } } - // Write VBAR - The Vector table must be 32-byte aligned - ASSERT (((UINT32)PrePiVectorTable & ((1 << 5)-1)) == 0); - ArmWriteVBar ((UINT32)PrePiVectorTable); - // If not primary Jump to Secondary Main if (IS_PRIMARY_CORE(MpId)) { // Goto primary Main. @@ -272,44 +262,3 @@ CEntryPoint ( ASSERT (FALSE); } -VOID -PrePiCommonExceptionEntry ( - IN UINT32 Entry, - IN UINT32 LR - ) -{ - CHAR8 Buffer[100]; - UINTN CharCount; - - switch (Entry) { - case 0: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Reset Exception at 0x%X\n\r",LR); - break; - case 1: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Undefined Exception at 0x%X\n\r",LR); - break; - case 2: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"SWI Exception at 0x%X\n\r",LR); - break; - case 3: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"PrefetchAbort Exception at 0x%X\n\r",LR); - break; - case 4: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"DataAbort Exception at 0x%X\n\r",LR); - break; - case 5: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Reserved Exception at 0x%X\n\r",LR); - break; - case 6: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"IRQ Exception at 0x%X\n\r",LR); - break; - case 7: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"FIQ Exception at 0x%X\n\r",LR); - break; - default: - CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"Unknown Exception at 0x%X\n\r",LR); - break; - } - SerialPortWrite ((UINT8 *) Buffer, CharCount); - while(1); -} diff --git a/ArmPlatformPkg/PrePi/PrePi.h b/ArmPlatformPkg/PrePi/PrePi.h index 3e976fadfb..deb8851688 100644 --- a/ArmPlatformPkg/PrePi/PrePi.h +++ b/ArmPlatformPkg/PrePi/PrePi.h @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011, ARM Limited. All rights reserved. +* Copyright (c) 2011-2012, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -29,12 +29,6 @@ #define SerialPrint(txt) SerialPortWrite (txt, AsciiStrLen(txt)+1); -// Vector Table for PrePi Phase -VOID -PrePiVectorTable ( - VOID - ); - RETURN_STATUS EFIAPI TimerConstructor ( -- cgit v1.2.3