]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/BaseSynchronizationLib GCC: fix whitespace and comments
authorLaszlo Ersek <lersek@redhat.com>
Sat, 29 Sep 2018 18:18:34 +0000 (20:18 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 17 Oct 2018 16:44:34 +0000 (18:44 +0200)
The "GccInline.c" files have some inconsistent whitespace, and missing (or
incorrect) operand comments. Fix and unify them.

This patch doesn't change behavior.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c

index fa2be7f4b35cb4df7cabef1864ad8399b977c424..1976720ac63650e8ae15303003f7ac1164ba619c 100644 (file)
@@ -39,7 +39,7 @@ InternalSyncIncrement (
     "movl    $1, %%eax  \n\t"\r
     "lock               \n\t"\r
     "xadd    %%eax, %1  \n\t"\r
-    "inc     %%eax          "\r
+    "inc     %%eax      \n\t"\r
     : "=a" (Result),          // %0\r
       "+m" (*Value)           // %1\r
     :                         // no inputs that aren't also outputs\r
@@ -48,7 +48,6 @@ InternalSyncIncrement (
     );\r
 \r
   return Result;\r
-\r
 }\r
 \r
 \r
@@ -76,10 +75,10 @@ InternalSyncDecrement (
     "movl    $-1, %%eax  \n\t"\r
     "lock                \n\t"\r
     "xadd    %%eax, %1   \n\t"\r
-    "dec     %%eax                  "\r
-    : "=a" (Result),          // %0\r
-      "+m" (*Value)           // %1\r
-    :                         // no inputs that aren't also outputs\r
+    "dec     %%eax       \n\t"\r
+    : "=a" (Result),           // %0\r
+      "+m" (*Value)            // %1\r
+    :                          // no inputs that aren't also outputs\r
     : "memory",\r
       "cc"\r
     );\r
@@ -87,6 +86,7 @@ InternalSyncDecrement (
   return Result;\r
 }\r
 \r
+\r
 /**\r
   Performs an atomic compare exchange operation on a 16-bit unsigned integer.\r
 \r
@@ -113,15 +113,13 @@ InternalSyncCompareExchange16 (
   IN      UINT16                    ExchangeValue\r
   )\r
 {\r
-\r
   __asm__ __volatile__ (\r
-    "                     \n\t"\r
     "lock                 \n\t"\r
     "cmpxchgw    %1, %2   \n\t"\r
-    : "=a" (CompareValue)\r
-    : "q"  (ExchangeValue),\r
-      "m"  (*Value),\r
-      "0"  (CompareValue)\r
+    : "=a" (CompareValue)       // %0\r
+    : "q"  (ExchangeValue),     // %1\r
+      "m"  (*Value),            // %2\r
+      "0"  (CompareValue)       // %3\r
     : "memory",\r
       "cc"\r
     );\r
@@ -129,6 +127,7 @@ InternalSyncCompareExchange16 (
   return CompareValue;\r
 }\r
 \r
+\r
 /**\r
   Performs an atomic compare exchange operation on a 32-bit unsigned integer.\r
 \r
@@ -155,15 +154,13 @@ InternalSyncCompareExchange32 (
   IN      UINT32                    ExchangeValue\r
   )\r
 {\r
-\r
   __asm__ __volatile__ (\r
-    "                     \n\t"\r
     "lock                 \n\t"\r
     "cmpxchgl    %1, %2   \n\t"\r
-    : "=a" (CompareValue)     // %0\r
-    : "q"  (ExchangeValue),   // %1\r
-      "m"  (*Value),          // %2\r
-      "0"  (CompareValue)     // %4\r
+    : "=a" (CompareValue)       // %0\r
+    : "q"  (ExchangeValue),     // %1\r
+      "m"  (*Value),            // %2\r
+      "0"  (CompareValue)       // %3\r
     : "memory",\r
       "cc"\r
     );\r
@@ -171,6 +168,7 @@ InternalSyncCompareExchange32 (
   return CompareValue;\r
 }\r
 \r
+\r
 /**\r
   Performs an atomic compare exchange operation on a 64-bit unsigned integer.\r
 \r
@@ -197,7 +195,6 @@ InternalSyncCompareExchange64 (
   )\r
 {\r
   __asm__ __volatile__ (\r
-    "                       \n\t"\r
     "push        %%ebx      \n\t"\r
     "movl        %2,%%ebx   \n\t"\r
     "lock                   \n\t"\r
index ab7efe23c4db02dd99f9d32386e3b7a4556a0b1a..0212798d7a277fede294941eaa17ac318752cbb6 100644 (file)
@@ -39,7 +39,7 @@ InternalSyncIncrement (
     "movl    $1, %%eax  \n\t"\r
     "lock               \n\t"\r
     "xadd    %%eax, %1  \n\t"\r
-    "inc     %%eax          "\r
+    "inc     %%eax      \n\t"\r
     : "=a" (Result),          // %0\r
       "+m" (*Value)           // %1\r
     :                         // no inputs that aren't also outputs\r
@@ -75,10 +75,10 @@ InternalSyncDecrement (
     "movl    $-1, %%eax  \n\t"\r
     "lock                \n\t"\r
     "xadd    %%eax, %1   \n\t"\r
-    "dec     %%eax                  "\r
-    : "=a" (Result),          // %0\r
-      "+m" (*Value)           // %1\r
-    :                         // no inputs that aren't also outputs\r
+    "dec     %%eax       \n\t"\r
+    : "=a" (Result),           // %0\r
+      "+m" (*Value)            // %1\r
+    :                          // no inputs that aren't also outputs\r
     : "memory",\r
       "cc"\r
     );\r
@@ -113,16 +113,14 @@ InternalSyncCompareExchange16 (
   IN      UINT16                    ExchangeValue\r
   )\r
 {\r
-\r
-\r
   __asm__ __volatile__ (\r
     "lock                 \n\t"\r
-    "cmpxchgw    %3, %1       "\r
-    : "=a" (CompareValue),\r
-      "=m" (*Value)\r
-    : "a"  (CompareValue),\r
-      "r"  (ExchangeValue),\r
-      "m"  (*Value)\r
+    "cmpxchgw    %3, %1   \n\t"\r
+    : "=a" (CompareValue),      // %0\r
+      "=m" (*Value)             // %1\r
+    : "a"  (CompareValue),      // %2\r
+      "r"  (ExchangeValue),     // %3\r
+      "m"  (*Value)             // %4\r
     : "memory",\r
       "cc"\r
     );\r
@@ -157,16 +155,14 @@ InternalSyncCompareExchange32 (
   IN      UINT32                    ExchangeValue\r
   )\r
 {\r
-\r
-\r
   __asm__ __volatile__ (\r
     "lock                 \n\t"\r
-    "cmpxchgl    %3, %1       "\r
-    : "=a" (CompareValue),    // %0\r
-      "=m" (*Value)           // %1\r
-    : "a"  (CompareValue),    // %2\r
-      "r"  (ExchangeValue),   // %3\r
-      "m"  (*Value)\r
+    "cmpxchgl    %3, %1   \n\t"\r
+    : "=a" (CompareValue),      // %0\r
+      "=m" (*Value)             // %1\r
+    : "a"  (CompareValue),      // %2\r
+      "r"  (ExchangeValue),     // %3\r
+      "m"  (*Value)             // %4\r
     : "memory",\r
       "cc"\r
     );\r
@@ -200,20 +196,17 @@ InternalSyncCompareExchange64 (
   IN      UINT64                    ExchangeValue\r
   )\r
 {\r
-\r
   __asm__ __volatile__ (\r
     "lock                 \n\t"\r
-    "cmpxchgq    %3, %1       "\r
-    : "=a" (CompareValue),    // %0\r
-      "=m" (*Value)           // %1\r
-    : "a"  (CompareValue),    // %2\r
-      "r"  (ExchangeValue),   // %3\r
-      "m"  (*Value)\r
+    "cmpxchgq    %3, %1   \n\t"\r
+    : "=a" (CompareValue),      // %0\r
+      "=m" (*Value)             // %1\r
+    : "a"  (CompareValue),      // %2\r
+      "r"  (ExchangeValue),     // %3\r
+      "m"  (*Value)             // %4\r
     : "memory",\r
       "cc"\r
     );\r
 \r
   return CompareValue;\r
 }\r
-\r
-\r