> v2:
>    Add prototype definition of InitializeCpuExceptionStackSwitchHandlers()

A new API InitializeCpuExceptionStackSwitchHandlers() is introduced to support
initializing exception handlers being able to switch stack. StackSwitchData is
arch dependent and required by IA32 processor to convey resources reserved in
advance. This is necessary because the CpuExceptionHandlerLib will be linked
in different phases, in which there's no common way to reserve resources.

EFI_STATUS
EFIAPI
InitializeCpuExceptionStackSwitchHandlers (
  IN VOID       *StackSwitchData  OPTIONAL
  );

Cc: Star Zeng <star.z...@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Cc: Jiewen Yao <jiewen....@intel.com>
Suggested-by: Ayellet Wolman <ayellet.wol...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.w...@intel.com>
---
 MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h 
b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
index 6cd8230127..68de4850e1 100644
--- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
+++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
@@ -41,6 +41,24 @@ InitializeCpuExceptionHandlers (
   IN EFI_VECTOR_HANDOFF_INFO       *VectorInfo OPTIONAL
   );
 
+/**
+  Setup separate stack for given exceptions. StackSwitchData is optional and 
its
+  content depends one the specific arch of CPU.
+
+  @param[in] StackSwitchData      Pointer to data required for setuping up
+                                  stack switch.
+
+  @retval EFI_SUCCESS             The exceptions have been successfully
+                                  initialized.
+  @retval EFI_INVALID_PARAMETER   StackSwitchData contains invalid content.
+
+**/
+EFI_STATUS
+EFIAPI
+InitializeCpuExceptionStackSwitchHandlers (
+  IN VOID       *StackSwitchData  OPTIONAL
+  );
+
 /**
   Initializes all CPU interrupt/exceptions entries and provides the default 
interrupt/exception handlers.
   
-- 
2.14.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to