Default exception handler\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2012 - 2021, Arm Ltd. All rights reserved.<BR>\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
CHAR8 Char;\r
} CPSR_CHAR;\r
\r
+STATIC CONST CPSR_CHAR mCpsrChar[] = {\r
+ { 31, 'n' },\r
+ { 30, 'z' },\r
+ { 29, 'c' },\r
+ { 28, 'v' },\r
+\r
+ { 9, 'e' },\r
+ { 8, 'a' },\r
+ { 7, 'i' },\r
+ { 6, 'f' },\r
+ { 5, 't' },\r
+ { 0, '?' }\r
+};\r
+\r
CHAR8 *\r
GetImageName (\r
IN UINTN FaultAddress,\r
Convert the Current Program Status Register (CPSR) to a string. The string is\r
a defacto standard in the ARM world.\r
\r
- It is possible to add extra bits by adding them to CpsrChar array.\r
+ It is possible to add extra bits by adding them to mCpsrChar array.\r
\r
@param Cpsr ARM CPSR register value\r
@param ReturnStr CPSR_STRING_SIZE byte string that contains string\r
UINTN Index;\r
CHAR8* Str;\r
CHAR8* ModeStr;\r
- CPSR_CHAR CpsrChar[] = {\r
- { 31, 'n' },\r
- { 30, 'z' },\r
- { 29, 'c' },\r
- { 28, 'v' },\r
-\r
- { 9, 'e' },\r
- { 8, 'a' },\r
- { 7, 'i' },\r
- { 6, 'f' },\r
- { 5, 't' },\r
- { 0, '?' }\r
- };\r
\r
Str = ReturnStr;\r
\r
- for (Index = 0; CpsrChar[Index].BIT != 0; Index++, Str++) {\r
- *Str = CpsrChar[Index].Char;\r
- if ((Cpsr & (1 << CpsrChar[Index].BIT)) != 0) {\r
+ for (Index = 0; mCpsrChar[Index].BIT != 0; Index++, Str++) {\r
+ *Str = mCpsrChar[Index].Char;\r
+ if ((Cpsr & (1 << mCpsrChar[Index].BIT)) != 0) {\r
// Concert to upper case if bit is set\r
*Str &= ~0x20;\r
}\r
UINT32 DfsrStatus;\r
UINT32 IfsrStatus;\r
BOOLEAN DfsrWrite;\r
- UINT32 PcAdjust = 0;\r
+ UINT32 PcAdjust;\r
+\r
+ PcAdjust = 0;\r
\r
CharCount = AsciiSPrint (Buffer,sizeof (Buffer),"\n%a Exception PC at 0x%08x CPSR 0x%08x ",\r
gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR);\r