]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
UefiCpuPkg/CpuExceptionHandler: Init serial port before context dump
[mirror_edk2.git] / UefiCpuPkg / Library / CpuExceptionHandlerLib / SecPeiCpuException.c
index af608bffb62284c392a4973bad967c651c45067c..68b159e0abfccd115af807e10e8389620558e955 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   CPU exception handler library implemenation for SEC/PEIM modules.\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 are licensed and made available under\r
 the terms and conditions of the BSD License that accompanies this distribution.\r
 The full text of the license may be found at\r
@@ -30,6 +30,10 @@ CommonExceptionHandler (
   IN EFI_SYSTEM_CONTEXT   SystemContext\r
   )\r
 {\r
+  //\r
+  // Initialize the serial port before dumping.\r
+  //\r
+  SerialPortInitialize ();\r
   //\r
   // Display ExceptionType, CPU information and Image information\r
   //\r
@@ -176,4 +180,36 @@ RegisterCpuInterruptHandler (
   )\r
 {\r
   return EFI_UNSUPPORTED;\r
-}
\ No newline at end of file
+}\r
+\r
+/**\r
+  Initializes all CPU exceptions entries with optional extra initializations.\r
+\r
+  By default, this method should include all functionalities implemented by\r
+  InitializeCpuExceptionHandlers(), plus extra initialization works, if any.\r
+  This could be done by calling InitializeCpuExceptionHandlers() directly\r
+  in this method besides the extra works.\r
+\r
+  InitData is optional and its use and content are processor arch dependent.\r
+  The typical usage of it is to convey resources which have to be reserved\r
+  elsewhere and are necessary for the extra initializations of exception.\r
+\r
+  @param[in]  VectorInfo    Pointer to reserved vector list.\r
+  @param[in]  InitData      Pointer to data optional for extra initializations\r
+                            of exception.\r
+\r
+  @retval EFI_SUCCESS             The exceptions have been successfully\r
+                                  initialized.\r
+  @retval EFI_INVALID_PARAMETER   VectorInfo or InitData contains invalid\r
+                                  content.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeCpuExceptionHandlersEx (\r
+  IN EFI_VECTOR_HANDOFF_INFO            *VectorInfo OPTIONAL,\r
+  IN CPU_EXCEPTION_INIT_DATA            *InitData OPTIONAL\r
+  )\r
+{\r
+  return InitializeCpuExceptionHandlers (VectorInfo);\r
+}\r