]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmDisassemblerLib/ArmDisassembler.c
ArmPkg: Fix various typos
[mirror_edk2.git] / ArmPkg / Library / ArmDisassemblerLib / ArmDisassembler.c
index 29a8d4438622a156680ad857b7b2d86fe8738329..b4f0f8dbbfc99255dee694ea9ad85be3995a733e 100644 (file)
@@ -3,13 +3,7 @@
 \r
   Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
 \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -88,12 +82,10 @@ MRegList (
   )\r
 {\r
   UINTN     Index, Start, End;\r
-  CHAR8     *Str;\r
   BOOLEAN   First;\r
 \r
-  Str = mMregListStr;\r
-  *Str = '\0';\r
-  AsciiStrCat  (Str, "{");\r
+  mMregListStr[0] = '\0';\r
+  AsciiStrCatS (mMregListStr, sizeof mMregListStr, "{");\r
   for (Index = 0, First = TRUE; Index <= 15; Index++) {\r
     if ((OpCode & (1 << Index)) != 0) {\r
       Start = End = Index;\r
@@ -102,25 +94,25 @@ MRegList (
       }\r
 \r
       if (!First) {\r
-        AsciiStrCat  (Str, ",");\r
+        AsciiStrCatS (mMregListStr, sizeof mMregListStr, ",");\r
       } else {\r
         First = FALSE;\r
       }\r
 \r
       if (Start == End) {\r
-        AsciiStrCat  (Str, gReg[Start]);\r
-        AsciiStrCat  (Str, ", ");\r
+        AsciiStrCatS (mMregListStr, sizeof mMregListStr, gReg[Start]);\r
+        AsciiStrCatS (mMregListStr, sizeof mMregListStr, ", ");\r
       } else {\r
-        AsciiStrCat  (Str, gReg[Start]);\r
-        AsciiStrCat  (Str, "-");\r
-        AsciiStrCat  (Str, gReg[End]);\r
+        AsciiStrCatS (mMregListStr, sizeof mMregListStr, gReg[Start]);\r
+        AsciiStrCatS (mMregListStr, sizeof mMregListStr, "-");\r
+        AsciiStrCatS (mMregListStr, sizeof mMregListStr, gReg[End]);\r
       }\r
     }\r
   }\r
   if (First) {\r
-    AsciiStrCat  (Str, "ERROR");\r
+    AsciiStrCatS (mMregListStr, sizeof mMregListStr, "ERROR");\r
   }\r
-  AsciiStrCat  (Str, "}");\r
+  AsciiStrCatS (mMregListStr, sizeof mMregListStr, "}");\r
 \r
   // BugBug: Make caller pass in buffer it is cleaner\r
   return mMregListStr;\r
@@ -145,8 +137,8 @@ RotateRight (
 \r
 \r
 /**\r
-  Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to\r
-  point to next instructin.\r
+  Place a disassembly of **OpCodePtr into buffer, and update OpCodePtr to\r
+  point to next instruction.\r
 \r
   We cheat and only decode instructions that access\r
   memory. If the instruction is not found we dump the instruction in hex.\r
@@ -396,7 +388,7 @@ DisassembleArmInstruction (
   }\r
 \r
 \r
-  if ((OpCode  & 0x0db00000) == 0x03200000) {\r
+  if ((OpCode  & 0x0db00000) == 0x01200000) {\r
     // A4.1.38 MSR{<cond>} CPSR_<fields>, #<immediate> MSR{<cond>} CPSR_<fields>, <Rm>\r
     if (I) {\r
       // MSR{<cond>} CPSR_<fields>, #<immediate>\r