]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/X64/GccInlinePriv.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / GccInlinePriv.c
index c3feb9f9223544970f99c7db4ae1bd37c3f16346..f63e03e0c50b15e2d61423b90b9475273ccd6565 100644 (file)
@@ -8,7 +8,6 @@
 \r
 **/\r
 \r
-\r
 #include "BaseLibInternals.h"\r
 #include <Library/RegisterFilterLib.h>\r
 \r
@@ -27,7 +26,6 @@ EnableInterrupts (
   __asm__ __volatile__ ("sti"::: "memory");\r
 }\r
 \r
-\r
 /**\r
   Disables CPU interrupts.\r
 \r
@@ -60,13 +58,13 @@ DisableInterrupts (
 UINT64\r
 EFIAPI\r
 AsmReadMsr64 (\r
-  IN      UINT32                    Index\r
+  IN      UINT32  Index\r
   )\r
 {\r
-  UINT32 LowData;\r
-  UINT32 HighData;\r
-  UINT64 Value;\r
-  BOOLEAN Flag;\r
+  UINT32   LowData;\r
+  UINT32   HighData;\r
+  UINT64   Value;\r
+  BOOLEAN  Flag;\r
 \r
   Flag = FilterBeforeMsrRead (Index, &Value);\r
   if (Flag) {\r
@@ -75,9 +73,10 @@ AsmReadMsr64 (
       : "=a" (LowData),   // %0\r
         "=d" (HighData)   // %1\r
       : "c"  (Index)      // %2\r
-      );\r
+    );\r
     Value = (((UINT64)HighData) << 32) | LowData;\r
   }\r
+\r
   FilterAfterMsrRead (Index, &Value);\r
 \r
   return Value;\r
@@ -103,13 +102,13 @@ AsmReadMsr64 (
 UINT64\r
 EFIAPI\r
 AsmWriteMsr64 (\r
-  IN      UINT32                    Index,\r
-  IN      UINT64                    Value\r
+  IN      UINT32  Index,\r
+  IN      UINT64  Value\r
   )\r
 {\r
-  UINT32 LowData;\r
-  UINT32 HighData;\r
-  BOOLEAN Flag;\r
+  UINT32   LowData;\r
+  UINT32   HighData;\r
+  BOOLEAN  Flag;\r
 \r
   Flag = FilterBeforeMsrWrite (Index, &Value);\r
   if (Flag) {\r
@@ -121,8 +120,9 @@ AsmWriteMsr64 (
       : "c" (Index),\r
         "a" (LowData),\r
         "d" (HighData)\r
-      );\r
+    );\r
   }\r
+\r
   FilterAfterMsrWrite (Index, &Value);\r
 \r
   return Value;\r
@@ -144,17 +144,16 @@ AsmReadCr0 (
   VOID\r
   )\r
 {\r
-  UINTN   Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%cr0,%0"\r
     : "=r" (Data)           // %0\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of the Control Register 2 (CR2).\r
 \r
@@ -171,12 +170,12 @@ AsmReadCr2 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%cr2,  %0"\r
     : "=r" (Data)           // %0\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
@@ -197,17 +196,16 @@ AsmReadCr3 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%cr3,  %0"\r
     : "=r" (Data)           // %0\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of the Control Register 4 (CR4).\r
 \r
@@ -224,17 +222,16 @@ AsmReadCr4 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%cr4,  %0"\r
     : "=r" (Data)           // %0\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Control Register 0 (CR0).\r
 \r
@@ -256,11 +253,10 @@ AsmWriteCr0 (
     "mov  %0, %%cr0"\r
     :\r
     : "r" (Cr0)\r
-    );\r
+  );\r
   return Cr0;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Control Register 2 (CR2).\r
 \r
@@ -282,11 +278,10 @@ AsmWriteCr2 (
     "mov  %0, %%cr2"\r
     :\r
     : "r" (Cr2)\r
-    );\r
+  );\r
   return Cr2;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Control Register 3 (CR3).\r
 \r
@@ -308,11 +303,10 @@ AsmWriteCr3 (
     "mov  %0, %%cr3"\r
     :\r
     : "r" (Cr3)\r
-    );\r
+  );\r
   return Cr3;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Control Register 4 (CR4).\r
 \r
@@ -334,11 +328,10 @@ AsmWriteCr4 (
     "mov  %0, %%cr4"\r
     :\r
     : "r" (Cr4)\r
-    );\r
+  );\r
   return Cr4;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 0 (DR0).\r
 \r
@@ -355,17 +348,16 @@ AsmReadDr0 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr0, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 1 (DR1).\r
 \r
@@ -382,17 +374,16 @@ AsmReadDr1 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr1, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 2 (DR2).\r
 \r
@@ -409,17 +400,16 @@ AsmReadDr2 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr2, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 3 (DR3).\r
 \r
@@ -436,17 +426,16 @@ AsmReadDr3 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr3, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 4 (DR4).\r
 \r
@@ -463,17 +452,16 @@ AsmReadDr4 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr4, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 5 (DR5).\r
 \r
@@ -490,17 +478,16 @@ AsmReadDr5 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr5, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 6 (DR6).\r
 \r
@@ -517,17 +504,16 @@ AsmReadDr6 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr6, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Debug Register 7 (DR7).\r
 \r
@@ -544,17 +530,16 @@ AsmReadDr7 (
   VOID\r
   )\r
 {\r
-  UINTN Data;\r
+  UINTN  Data;\r
 \r
   __asm__ __volatile__ (\r
     "mov  %%dr7, %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 0 (DR0).\r
 \r
@@ -576,11 +561,10 @@ AsmWriteDr0 (
     "mov  %0, %%dr0"\r
     :\r
     : "r" (Dr0)\r
-    );\r
+  );\r
   return Dr0;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 1 (DR1).\r
 \r
@@ -602,11 +586,10 @@ AsmWriteDr1 (
     "mov  %0, %%dr1"\r
     :\r
     : "r" (Dr1)\r
-    );\r
+  );\r
   return Dr1;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 2 (DR2).\r
 \r
@@ -628,11 +611,10 @@ AsmWriteDr2 (
     "mov  %0, %%dr2"\r
     :\r
     : "r" (Dr2)\r
-    );\r
+  );\r
   return Dr2;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 3 (DR3).\r
 \r
@@ -654,11 +636,10 @@ AsmWriteDr3 (
     "mov  %0, %%dr3"\r
     :\r
     : "r" (Dr3)\r
-    );\r
+  );\r
   return Dr3;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 4 (DR4).\r
 \r
@@ -680,11 +661,10 @@ AsmWriteDr4 (
     "mov  %0, %%dr4"\r
     :\r
     : "r" (Dr4)\r
-    );\r
+  );\r
   return Dr4;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 5 (DR5).\r
 \r
@@ -706,11 +686,10 @@ AsmWriteDr5 (
     "mov  %0, %%dr5"\r
     :\r
     : "r" (Dr5)\r
-    );\r
+  );\r
   return Dr5;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 6 (DR6).\r
 \r
@@ -732,11 +711,10 @@ AsmWriteDr6 (
     "mov  %0, %%dr6"\r
     :\r
     : "r" (Dr6)\r
-    );\r
+  );\r
   return Dr6;\r
 }\r
 \r
-\r
 /**\r
   Writes a value to Debug Register 7 (DR7).\r
 \r
@@ -758,11 +736,10 @@ AsmWriteDr7 (
     "mov  %0, %%dr7"\r
     :\r
     : "r" (Dr7)\r
-    );\r
+  );\r
   return Dr7;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Code Segment Register (CS).\r
 \r
@@ -783,12 +760,11 @@ AsmReadCs (
   __asm__ __volatile__ (\r
     "mov   %%cs, %0"\r
     :"=a" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Data Segment Register (DS).\r
 \r
@@ -809,12 +785,11 @@ AsmReadDs (
   __asm__ __volatile__ (\r
     "mov  %%ds, %0"\r
     :"=a" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Extra Segment Register (ES).\r
 \r
@@ -835,12 +810,11 @@ AsmReadEs (
   __asm__ __volatile__ (\r
     "mov  %%es, %0"\r
     :"=a" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of FS Data Segment Register (FS).\r
 \r
@@ -861,12 +835,11 @@ AsmReadFs (
   __asm__ __volatile__ (\r
     "mov  %%fs, %0"\r
     :"=a" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of GS Data Segment Register (GS).\r
 \r
@@ -887,12 +860,11 @@ AsmReadGs (
   __asm__ __volatile__ (\r
     "mov  %%gs, %0"\r
     :"=a" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Stack Segment Register (SS).\r
 \r
@@ -913,12 +885,11 @@ AsmReadSs (
   __asm__ __volatile__ (\r
     "mov  %%ss, %0"\r
     :"=a" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current value of Task Register (TR).\r
 \r
@@ -939,12 +910,11 @@ AsmReadTr (
   __asm__ __volatile__ (\r
     "str  %0"\r
     : "=r" (Data)\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Reads the current Global Descriptor Table Register(GDTR) descriptor.\r
 \r
@@ -957,16 +927,15 @@ AsmReadTr (
 VOID\r
 EFIAPI\r
 InternalX86ReadGdtr (\r
-  OUT     IA32_DESCRIPTOR           *Gdtr\r
+  OUT     IA32_DESCRIPTOR  *Gdtr\r
   )\r
 {\r
   __asm__ __volatile__ (\r
     "sgdt %0"\r
     : "=m" (*Gdtr)\r
-    );\r
+  );\r
 }\r
 \r
-\r
 /**\r
   Writes the current Global Descriptor Table Register (GDTR) descriptor.\r
 \r
@@ -979,18 +948,16 @@ InternalX86ReadGdtr (
 VOID\r
 EFIAPI\r
 InternalX86WriteGdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Gdtr\r
+  IN      CONST IA32_DESCRIPTOR  *Gdtr\r
   )\r
 {\r
   __asm__ __volatile__ (\r
     "lgdt %0"\r
     :\r
     : "m" (*Gdtr)\r
-    );\r
-\r
+  );\r
 }\r
 \r
-\r
 /**\r
   Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
 \r
@@ -1003,16 +970,15 @@ InternalX86WriteGdtr (
 VOID\r
 EFIAPI\r
 InternalX86ReadIdtr (\r
-  OUT     IA32_DESCRIPTOR           *Idtr\r
+  OUT     IA32_DESCRIPTOR  *Idtr\r
   )\r
 {\r
   __asm__ __volatile__ (\r
     "sidt  %0"\r
     : "=m" (*Idtr)\r
-    );\r
+  );\r
 }\r
 \r
-\r
 /**\r
   Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
 \r
@@ -1025,17 +991,16 @@ InternalX86ReadIdtr (
 VOID\r
 EFIAPI\r
 InternalX86WriteIdtr (\r
-  IN      CONST IA32_DESCRIPTOR     *Idtr\r
+  IN      CONST IA32_DESCRIPTOR  *Idtr\r
   )\r
 {\r
   __asm__ __volatile__ (\r
     "lidt %0"\r
     :\r
     : "m" (*Idtr)\r
-    );\r
+  );\r
 }\r
 \r
-\r
 /**\r
   Reads the current Local Descriptor Table Register(LDTR) selector.\r
 \r
@@ -1056,12 +1021,11 @@ AsmReadLdtr (
   __asm__ __volatile__ (\r
     "sldt  %0"\r
     : "=g" (Data)   // %0\r
-    );\r
+  );\r
 \r
   return Data;\r
 }\r
 \r
-\r
 /**\r
   Writes the current Local Descriptor Table Register (GDTR) selector.\r
 \r
@@ -1074,14 +1038,14 @@ AsmReadLdtr (
 VOID\r
 EFIAPI\r
 AsmWriteLdtr (\r
-  IN      UINT16                    Ldtr\r
+  IN      UINT16  Ldtr\r
   )\r
 {\r
   __asm__ __volatile__ (\r
     "lldtw  %0"\r
     :\r
     : "g" (Ldtr)   // %0\r
-    );\r
+  );\r
 }\r
 \r
 /**\r
@@ -1098,7 +1062,7 @@ AsmWriteLdtr (
 UINT64\r
 EFIAPI\r
 AsmReadPmc (\r
-  IN      UINT32                    Index\r
+  IN      UINT32  Index\r
   )\r
 {\r
   UINT32  LowData;\r
@@ -1109,7 +1073,7 @@ AsmReadPmc (
     : "=a" (LowData),\r
       "=d" (HiData)\r
     : "c"  (Index)\r
-    );\r
+  );\r
 \r
   return (((UINT64)HiData) << 32) | LowData;\r
 }\r
@@ -1133,9 +1097,9 @@ AsmReadPmc (
 UINTN\r
 EFIAPI\r
 AsmMonitor (\r
-  IN      UINTN                     Eax,\r
-  IN      UINTN                     Ecx,\r
-  IN      UINTN                     Edx\r
+  IN      UINTN  Eax,\r
+  IN      UINTN  Ecx,\r
+  IN      UINTN  Edx\r
   )\r
 {\r
   __asm__ __volatile__ (\r
@@ -1144,7 +1108,7 @@ AsmMonitor (
     : "a" (Eax),\r
       "c" (Ecx),\r
       "d" (Edx)\r
-    );\r
+  );\r
 \r
   return Eax;\r
 }\r
@@ -1166,8 +1130,8 @@ AsmMonitor (
 UINTN\r
 EFIAPI\r
 AsmMwait (\r
-  IN      UINTN                     Eax,\r
-  IN      UINTN                     Ecx\r
+  IN      UINTN  Eax,\r
+  IN      UINTN  Ecx\r
   )\r
 {\r
   __asm__ __volatile__ (\r
@@ -1175,7 +1139,7 @@ AsmMwait (
     :\r
     : "a"  (Eax),\r
       "c"  (Ecx)\r
-    );\r
+  );\r
 \r
   return Eax;\r
 }\r
@@ -1210,10 +1174,8 @@ AsmInvd (
   )\r
 {\r
   __asm__ __volatile__ ("invd":::"memory");\r
-\r
 }\r
 \r
-\r
 /**\r
   Flushes a cache line from all the instruction and data caches within the\r
   coherency domain of the CPU.\r
@@ -1232,7 +1194,7 @@ AsmInvd (
 VOID *\r
 EFIAPI\r
 AsmFlushCacheLine (\r
-  IN      VOID                      *LinearAddress\r
+  IN      VOID  *LinearAddress\r
   )\r
 {\r
   __asm__ __volatile__ (\r
@@ -1240,7 +1202,7 @@ AsmFlushCacheLine (
     :\r
     : "r" (LinearAddress)\r
     : "memory"\r
-    );\r
+  );\r
 \r
-    return LinearAddress;\r
+  return LinearAddress;\r
 }\r