]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
UefiCpuPkg/CpuExceptionHandlerLib: Fix spelling issue
[mirror_edk2.git] / UefiCpuPkg / Library / CpuExceptionHandlerLib / CpuExceptionCommon.h
index e66a5df86423365df055225a015c0f8edf8415f8..83e55ab828362fc40876c2ac9b8381f15e989422 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Common header file for CPU Exception Handler Library.\r
 \r
-  Copyright (c) 2012 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>\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
 \r
 #include "ArchInterruptDefs.h"\r
 \r
-#define CPU_EXCEPTION_HANDLER_LIB_HOB_GUID \\r
-  { \\r
-    0xb21d9148, 0x9211, 0x4d8f, { 0xad, 0xd3, 0x66, 0xb1, 0x89, 0xc9, 0x2c, 0x83 } \\r
-  }\r
+#define CPU_STACK_SWITCH_EXCEPTION_NUMBER \\r
+  FixedPcdGetSize (PcdCpuStackSwitchExceptionList)\r
+\r
+#define CPU_STACK_SWITCH_EXCEPTION_LIST \\r
+  FixedPcdGetPtr (PcdCpuStackSwitchExceptionList)\r
+\r
+#define CPU_KNOWN_GOOD_STACK_SIZE \\r
+  FixedPcdGet32 (PcdCpuKnownGoodStackSize)\r
+\r
+#define CPU_TSS_GDT_SIZE (SIZE_2KB + CPU_TSS_DESC_SIZE + CPU_TSS_SIZE)\r
 \r
 //\r
 // Record exception handler information\r
@@ -108,7 +114,7 @@ ArchGetIdtHandler (
   Prints a message to the serial port.\r
 \r
   @param  Format      Format string for the message to print.\r
-  @param  ...         Variable argument list whose contents are accessed \r
+  @param  ...         Variable argument list whose contents are accessed\r
                       based on the format string specified by Format.\r
 \r
 **/\r
@@ -121,11 +127,11 @@ InternalPrintMessage (
 \r
 /**\r
   Find and display image base address and return image base and its entry point.\r
-  \r
+\r
   @param CurrentEip      Current instruction pointer.\r
-  \r
+\r
 **/\r
-VOID \r
+VOID\r
 DumpModuleImageInfo (\r
   IN  UINTN              CurrentEip\r
   );\r
@@ -147,8 +153,8 @@ DumpImageAndCpuContent (
 \r
   @param[in]      VectorInfo            Pointer to reserved vector list.\r
   @param[in, out] ExceptionHandlerData  Pointer to exception handler data.\r
-  \r
-  @retval EFI_SUCCESS           CPU Exception Entries have been successfully initialized \r
+\r
+  @retval EFI_SUCCESS           CPU Exception Entries have been successfully initialized\r
                                 with default exception handlers.\r
   @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r
   @retval EFI_UNSUPPORTED       This function is not supported.\r
@@ -230,7 +236,7 @@ ArchRestoreExceptionContext (
 \r
 /**\r
   Fix up the vector number and function address in the vector code.\r
\r
+\r
   @param[in] NewVectorAddr   New vector handler address.\r
   @param[in] VectorNum       Index of vector.\r
   @param[in] OldVectorAddr   Old vector handler address.\r
@@ -246,11 +252,11 @@ AsmVectorNumFixup (
 \r
 /**\r
   Read and save reserved vector information\r
-  \r
+\r
   @param[in]  VectorInfo        Pointer to reserved vector list.\r
   @param[out] ReservedVector    Pointer to reserved vector data buffer.\r
   @param[in]  VectorCount       Vector number to be updated.\r
-  \r
+\r
   @return EFI_SUCCESS           Read and save vector info successfully.\r
   @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL.\r
 \r
@@ -283,10 +289,38 @@ GetExceptionNameStr (
 **/\r
 VOID\r
 CommonExceptionHandlerWorker (\r
-  IN EFI_EXCEPTION_TYPE          ExceptionType, \r
+  IN EFI_EXCEPTION_TYPE          ExceptionType,\r
   IN EFI_SYSTEM_CONTEXT          SystemContext,\r
   IN EXCEPTION_HANDLER_DATA      *ExceptionHandlerData\r
   );\r
 \r
+/**\r
+  Setup separate stack for specific exceptions.\r
+\r
+  @param[in] StackSwitchData      Pointer to data required for setuping up\r
+                                  stack switch.\r
+\r
+  @retval EFI_SUCCESS             The exceptions have been successfully\r
+                                  initialized with new stack.\r
+  @retval EFI_INVALID_PARAMETER   StackSwitchData contains invalid content.\r
+**/\r
+EFI_STATUS\r
+ArchSetupExceptionStack (\r
+  IN CPU_EXCEPTION_INIT_DATA        *StackSwitchData\r
+  );\r
+\r
+/**\r
+  Return address map of exception handler template so that C code can generate\r
+  exception tables. The template is only for exceptions using task gate instead\r
+  of interrupt gate.\r
+\r
+  @param AddressMap  Pointer to a buffer where the address map is returned.\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmGetTssTemplateMap (\r
+  OUT EXCEPTION_HANDLER_TEMPLATE_MAP  *AddressMap\r
+  );\r
+\r
 #endif\r
 \r