]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/DebugSupport/Dxe/Ia32/plDebugSupport.c
Add X64 support for DebugSupport driver.
[mirror_edk2.git] / EdkModulePkg / Universal / DebugSupport / Dxe / Ia32 / plDebugSupport.c
index 2198192a0402cd0de8086b78b0312ca83bb8efcd..289158216cbd403703a64dc7a9d8722017446808 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation                                                         \r
+/**@file\r
+  IA32 specific debug support functions\r
+  \r
+Copyright (c) 2006 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
@@ -9,17 +10,7 @@ http://opensource.org/licenses/bsd-license.php
 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
 \r
-Module Name:\r
-\r
-    plDebugSupport.c\r
-\r
-Abstract:\r
-\r
-    IA32 specific debug support functions\r
-\r
-Revision History\r
-\r
---*/\r
+**/\r
 \r
 //\r
 // private header files\r
@@ -117,7 +108,6 @@ Returns:
   Other possibilities are passed through by CreateEntryStub\r
 \r
 --*/\r
-// TODO:    ) - add argument and description to function comment\r
 {\r
   BOOLEAN     OldIntFlagState;\r
   EFI_STATUS  Status;\r
@@ -199,7 +189,6 @@ Returns:
   Other possible return values are passed through from UnHookEntry and HookEntry.\r
 \r
 --*/\r
-// TODO:    ) - add argument and description to function comment\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -246,12 +235,13 @@ GetMaximumProcessorIndex (
 Routine Description: This is a DebugSupport protocol member function.\r
 \r
 Arguments:\r
+  This              - The DebugSupport instance\r
+  MaxProcessorIndex - The maximuim supported processor index\r
 \r
-Returns: Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0\r
+Returns:\r
+  Always returns EFI_SUCCESS with *MaxProcessorIndex set to 0\r
 \r
 --*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    MaxProcessorIndex - add argument and description to function comment\r
 {\r
   *MaxProcessorIndex = 0;\r
   return (EFI_SUCCESS);\r
@@ -269,13 +259,20 @@ RegisterPeriodicCallback (
 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
 Returns:\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
+  Other possible return values are passed through from UnHookEntry and HookEntry.\r
+\r
 --*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    ProcessorIndex - add argument and description to function comment\r
-// TODO:    PeriodicCallback - add argument and description to function comment\r
 {\r
   return ManageIdtEntryTable (PeriodicCallback, SYSTEM_TIMER_VECTOR);\r
 }\r
@@ -296,16 +293,21 @@ Routine Description:
   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
-  None\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
+  Other possible return values are passed through from UnHookEntry and HookEntry.\r
 \r
 --*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    ProcessorIndex - add argument and description to function comment\r
-// TODO:    NewCallback - add argument and description to function comment\r
-// TODO:    ExceptionType - add argument and description to function comment\r
 {\r
   return ManageIdtEntryTable (NewCallback, ExceptionType);\r
 }\r
@@ -322,21 +324,21 @@ InvalidateInstructionCache (
 \r
 Routine Description:\r
   This is a DebugSupport protocol member function.\r
-  For IA32, this is a no-op since the instruction and data caches are coherent.\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
-  None\r
+  EFI_SUCCESS - always return success\r
 \r
 --*/\r
-// TODO:    This - add argument and description to function comment\r
-// TODO:    ProcessorIndex - add argument and description to function comment\r
-// TODO:    Start - add argument and description to function comment\r
-// TODO:    Length - add argument and description to function comment\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
+  AsmWbinvd ();\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -358,9 +360,9 @@ Returns:
   EFI_SUCCESS\r
   EFI_UNSUPPORTED - if IA32 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
 \r
 --*/\r
-// TODO:    EFI_OUT_OF_RESOURCES - add return value to function comment\r
 {\r
   if (!FxStorSupport ()) {\r
     return EFI_UNSUPPORTED;\r
@@ -393,10 +395,9 @@ Arguments:
 \r
 Returns:\r
 \r
-  None\r
+  EFI_SUCCESS - always return success\r
 \r
 --*/\r
-// TODO:    EFI_SUCCESS - add return value to function comment\r
 {\r
   EFI_EXCEPTION_TYPE  ExceptionType;\r
 \r
@@ -420,14 +421,14 @@ Routine Description: Common piece of code that invokes the registered handlers.
   This code executes in exception context so no efi calls are allowed.\r
 \r
 Arguments:\r
+  ExceptionType - exception type\r
+  ContextRecord - system context\r
 \r
 Returns:\r
 \r
   None\r
 \r
 --*/\r
-// TODO:    ExceptionType - add argument and description to function comment\r
-// TODO:    ContextRecord - add argument and description to function comment\r
 {\r
   if (IdtEntryTable[ExceptionType].RegisteredCallback != NULL) {\r
     if (ExceptionType != SYSTEM_TIMER_VECTOR) {\r