]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupport.h
ECC clean up.
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / X64 / PlDebugSupport.h
index b643ec44e2aa17bed34f21ed316c414ac710801a..eb04f1a88c4ecabc2f131540ab262785c6f8e399 100644 (file)
@@ -1,7 +1,7 @@
-/**@file\r
+/** @file\r
   X64 specific debug support macros, typedefs and prototypes.\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
+Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
 All rights reserved. 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
@@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _PLDEBUG_SUPPORT_H\r
-#define _PLDEBUG_SUPPORT_H\r
+#ifndef _PLDEBUG_SUPPORT_H_\r
+#define _PLDEBUG_SUPPORT_H_\r
 \r
 \r
 #include <Uefi.h>\r
@@ -32,11 +32,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define NUM_IDT_ENTRIES                 0x78\r
 #define SYSTEM_TIMER_VECTOR             0x68\r
 #define VECTOR_ENTRY_PAGES              1\r
-#define CopyDescriptor(Dest, Src)       CopyMem ((Dest), (Src), sizeof (DESCRIPTOR))\r
-#define ZeroDescriptor(Dest)            CopyDescriptor ((Dest), &NullDesc)\r
-#define ReadIdt(Vector, Dest)           CopyDescriptor ((Dest), &((GetIdtr ())[(Vector)]))\r
-#define WriteIdt(Vector, Src)           CopyDescriptor (&((GetIdtr ())[(Vector)]), (Src))\r
-#define CompareDescriptor(Desc1, Desc2) CompareMem ((Desc1), (Desc2), sizeof (DESCRIPTOR))\r
+#define COPY_DESCRIPTOR(Dest, Src)       CopyMem ((Dest), (Src), sizeof (DESCRIPTOR))\r
+#define READ_IDT(Vector, Dest)           COPY_DESCRIPTOR ((Dest), &((GetIdtr ())[(Vector)]))\r
+#define WRITE_IDT(Vector, Src)           COPY_DESCRIPTOR (&((GetIdtr ())[(Vector)]), (Src))\r
+#define COMPARE_DESCRIPTOR(Desc1, Desc2) CompareMem ((Desc1), (Desc2), sizeof (DESCRIPTOR))\r
 #define EFI_ISA                         IsaX64\r
 #define FF_FXSR                         (1 << 24)\r
 \r
@@ -64,214 +63,149 @@ extern UINT8              InterruptEntryStub[];
 extern UINT32             StubSize;\r
 extern VOID (*OrigVector) (VOID);\r
 \r
+/**\r
+  Generic IDT entry.\r
+\r
+**/\r
 VOID\r
 CommonIdtEntry (\r
   VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Generic IDT entry\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
-\r
-  None\r
+  );\r
 \r
---*/\r
-;\r
+/**\r
+  Check whether FXSTOR is supported\r
 \r
+  @retval TRUE   FXSTOR is supported.\r
+  @retval FALSE  FXSTOR is not supported.\r
 \r
+**/\r
 BOOLEAN\r
 FxStorSupport (\r
   VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Check whether FXSTOR is supported\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
+  );\r
 \r
-  TRUE  - supported\r
-  FALSE - not supported\r
+/**\r
+  Return the physical address of IDTR.\r
 \r
---*/\r
-;\r
+  @return The physical address of IDTR.\r
 \r
+**/\r
 DESCRIPTOR  *\r
 GetIdtr (\r
   VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Return the physical address of IDTR\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
+  );\r
 \r
-  The physical address of IDTR\r
+/**\r
+  Encodes an IDT descriptor with the given physical address.\r
 \r
---*/\r
-;\r
+  @param  DestDesc    The IDT descriptor address.\r
+  @param  Vecotr      The interrupt vector entry.\r
 \r
+**/\r
 VOID\r
 Vect2Desc (\r
   DESCRIPTOR * DestDesc,\r
   VOID (*Vector) (VOID)\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Encodes an IDT descriptor with the given physical address\r
-\r
-Arguments:\r
-\r
-  DestDesc  - The IDT descriptor address\r
-  Vector    - The interrupt vector entry\r
+  );\r
 \r
-Returns:\r
+/**\r
+  Programs interrupt flag to the requested state and returns previous\r
+  state.\r
 \r
-  None\r
+  @param  NewState    New interrupt status.\r
 \r
---*/\r
-;\r
+  @retval TRUE     Old interrupt status is TRUE.\r
+  @retval FALSE    Old interrupt status is FALSE\r
 \r
+**/\r
 BOOLEAN\r
 WriteInterruptFlag (\r
   BOOLEAN NewState\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Programs interrupt flag to the requested state and returns previous\r
-  state.\r
-\r
-Arguments:\r
-\r
-  NewState  - New interrupt status\r
-\r
-Returns:\r
+  );\r
 \r
-  Old interrupt status\r
+/**\r
+  Initializes driver's handler registration databas. \r
+  \r
+  This code executes in boot services context\r
+  Must be public because it's referenced from DebugSupport.c\r
 \r
---*/\r
-;\r
+  @retval  EFI_UNSUPPORTED      If x64 processor does not support FXSTOR/FXRSTOR instructions,\r
+                                the context save will fail, so these processor's are not supported.\r
+  @retval  EFI_OUT_OF_RESOURCES Fails to allocate memory.\r
+  @retval  EFI_SUCCESS          Initializes successfully.\r
 \r
+**/\r
 EFI_STATUS\r
-plInitializeDebugSupportDriver (\r
+PlInitializeDebugSupportDriver (\r
   VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Initializes driver's handler registration database.\r
-\r
-  This code executes in boot services context.\r
+  );\r
 \r
-Arguments:\r
-  None\r
+/**\r
+  This is the callback that is written to the LoadedImage protocol instance\r
+  on the image handle. It uninstalls all registered handlers and frees all entry\r
+  stub memory.\r
 \r
-Returns:\r
-  EFI_SUCCESS\r
-  EFI_UNSUPPORTED - if X64 processor does not support FXSTOR/FXRSTOR instructions,\r
-                    the context save will fail, so these processor's are not supported.\r
-  EFI_OUT_OF_RESOURCES - not resource to finish initialization\r
+  @param  ImageHandle    The firmware allocated handle for the EFI image.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS    Always.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
-plUnloadDebugSupportDriver (\r
+PlUnloadDebugSupportDriver (\r
   IN EFI_HANDLE                       ImageHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This is the callback that is written to the LoadedImage protocol instance\r
-  on the image handle. It uninstalls all registered handlers and frees all entry\r
-  stub memory.\r
-\r
-  This code executes in boot services context.\r
-\r
-Arguments:\r
-  ImageHandle - The image handle of the unload handler\r
+  );\r
 \r
-Returns:\r
+/**\r
+  This is a DebugSupport protocol member function, hard\r
+  coded to support only 1 processor for now.\r
 \r
-  EFI_SUCCESS - always return success\r
+  @param  This                The DebugSupport instance\r
+  @param  MaxProcessorIndex   The maximuim supported processor index\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS         Always returned with **MaxProcessorIndex set to 0.\r
 \r
-//\r
-// DebugSupport protocol member functions\r
-//\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GetMaximumProcessorIndex (\r
   IN EFI_DEBUG_SUPPORT_PROTOCOL       *This,\r
   OUT UINTN                           *MaxProcessorIndex\r
-  )\r
-/*++\r
-\r
-Routine Description: This is a DebugSupport protocol member function.\r
+  );\r
 \r
-Arguments:\r
-  This              - The DebugSupport instance\r
-  MaxProcessorIndex - The maximuim supported processor index\r
+/**\r
+  DebugSupport protocol member function.\r
 \r
-Returns:\r
-  Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0\r
+  @param  This               The DebugSupport instance\r
+  @param  ProcessorIndex     Which processor the callback applies to.\r
+  @param  PeriodicCallback   Callback function\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS        Indicates the callback was registered.\r
+  @retval others             Callback was not registered.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 RegisterPeriodicCallback (\r
   IN EFI_DEBUG_SUPPORT_PROTOCOL       *This,\r
   IN UINTN                            ProcessorIndex,\r
   IN EFI_PERIODIC_CALLBACK            PeriodicCallback\r
-  )\r
-/*++\r
-\r
-Routine Description: This is a DebugSupport protocol member function.\r
-\r
-Arguments:\r
-  This             - The DebugSupport instance\r
-  ProcessorIndex   - Which processor the callback applies to.\r
-  PeriodicCallback - Callback function\r
+  );\r
 \r
-Returns:\r
+/**\r
+  DebugSupport protocol member function.\r
 \r
-  EFI_SUCCESS\r
-  EFI_INVALID_PARAMETER - requested uninstalling a handler from a vector that has\r
-                          no handler registered for it\r
-  EFI_ALREADY_STARTED   - requested install to a vector that already has a handler registered.\r
+  This code executes in boot services context.\r
 \r
-  Other possible return values are passed through from UnHookEntry and HookEntry.\r
+  @param  This              The DebugSupport instance\r
+  @param  ProcessorIndex    Which processor the callback applies to.\r
+  @param  NewCallback       Callback function\r
+  @param  ExceptionType     Which exception to hook\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS        Indicates the callback was registered.\r
+  @retval others             Callback was not registered.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 RegisterExceptionCallback (\r
@@ -279,32 +213,19 @@ RegisterExceptionCallback (
   IN UINTN                            ProcessorIndex,\r
   IN EFI_EXCEPTION_CALLBACK           NewCallback,\r
   IN EFI_EXCEPTION_TYPE               ExceptionType\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This is a DebugSupport protocol member function.\r
-\r
-  This code executes in boot services context.\r
-\r
-Arguments:\r
-  This             - The DebugSupport instance\r
-  ProcessorIndex   - Which processor the callback applies to.\r
-  NewCallback      - Callback function\r
-  ExceptionType    - Which exception to hook\r
-\r
-Returns:\r
+  );\r
 \r
-  EFI_SUCCESS\r
-  EFI_INVALID_PARAMETER - requested uninstalling a handler from a vector that has\r
-                          no handler registered for it\r
-  EFI_ALREADY_STARTED   - requested install to a vector that already has a handler registered.\r
+/**\r
+  DebugSupport protocol member function.  Calls assembly routine to flush cache.\r
 \r
-  Other possible return values are passed through from UnHookEntry and HookEntry.\r
+  @param  This              The DebugSupport instance\r
+  @param  ProcessorIndex    Which processor the callback applies to.\r
+  @param  Start             Physical base of the memory range to be invalidated\r
+  @param  Length            mininum number of bytes in instruction cache to invalidate\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS       Always returned.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 InvalidateInstructionCache (\r
@@ -312,24 +233,6 @@ InvalidateInstructionCache (
   IN UINTN                            ProcessorIndex,\r
   IN VOID                             *Start,\r
   IN UINT64                           Length\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  This is a DebugSupport protocol member function.\r
-  Calls assembly routine to flush cache.\r
-\r
-Arguments:\r
-  This             - The DebugSupport instance\r
-  ProcessorIndex   - Which processor the callback applies to.\r
-  Start            - Physical base of the memory range to be invalidated\r
-  Length           - mininum number of bytes in instruction cache to invalidate\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - always return success\r
-\r
---*/\r
-;\r
+  );\r
 \r
 #endif\r