]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add Report Status Code related PPI/Protocol from PI 1.2 specification.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 19 Aug 2009 07:30:01 +0000 (07:30 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 19 Aug 2009 07:30:01 +0000 (07:30 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9123 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Ppi/ReportStatusCodeHandler.h [new file with mode: 0644]
MdePkg/Include/Protocol/ReportStatusCodeHandler.h [new file with mode: 0644]
MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Ppi/ReportStatusCodeHandler.h b/MdePkg/Include/Ppi/ReportStatusCodeHandler.h
new file mode 100644 (file)
index 0000000..94dd162
--- /dev/null
@@ -0,0 +1,83 @@
+/** @file\r
+  This ppi provide registering and unregistering services to status code consumers.\r
+  \r
+  Copyright (c) 2007 - 2009, 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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  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
+**/\r
+\r
+#ifndef __REPORT_STATUS_CODE_HANDLER_PPI_H__\r
+#define __REPORT_STATUS_CODE_HANDLER_PPI_H__\r
+\r
+#define EFI_PEI_RSC_HANDLER_PPI_GUID \\r
+  { \\r
+    0x65d394, 0x9951, 0x4144, \\r
+    0x82, 0xa3, 0xa, 0xfc, 0x85, 0x79, 0xc2, 0x51 \\r
+  }\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_RSC_HANDLER_CALLBACK)(\r
+  IN CONST  EFI_PEI_SERVICES        **PeiServices,\r
+  IN        EFI_STATUS_CODE_TYPE    Type,\r
+  IN        EFI_STATUS_CODE_VALUE   Value,\r
+  IN        UINT32                  Instance,\r
+  IN CONST  EFI_GUID                *CallerId,\r
+  IN CONST  EFI_STATUS_CODE_DATA    *Data\r
+);\r
+\r
+/**\r
+  Register the callback function for ReportStatusCode() notification.\r
+  \r
+  When this function is called the function pointer is added to an internal list and any future calls to\r
+  ReportStatusCode() will be forwarded to the Callback function.\r
+\r
+  @param[in] Callback           A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called\r
+                                when a call to ReportStatusCode() occurs.\r
+                        \r
+  @retval EFI_SUCCESS           Function was successfully registered.\r
+  @retval EFI_INVALID_PARAMETER The callback function was NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  The internal buffer ran out of space. No more functions can be\r
+                                registered.\r
+  @retval EFI_ALREADY_STARTED   The function was already registered. It can’t be registered again.\r
+                        \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_RSC_HANDLER_REGISTER)(\r
+  IN EFI_PEI_RSC_HANDLER_CALLBACK Callback\r
+);\r
+\r
+/**\r
+  Remove a previously registered callback function from the notification list.\r
+  \r
+  ReportStatusCode() messages will no longer be forwarded to the Callback function.\r
+  \r
+  @param[in] Callback           A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be\r
+                                unregistered.\r
+\r
+  @retval EFI_SUCCESS           The function was successfully unregistered.\r
+  @retval EFI_INVALID_PARAMETER The callback function was NULL.\r
+  @retval EFI_NOT_FOUND         The callback function was not found to be unregistered.\r
+                        \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_RSC_HANDLER_UNREGISTER)(\r
+  IN EFI_PEI_RSC_HANDLER_CALLBACK Callback\r
+);\r
+\r
+typedef struct _EFI_PEI_RSC_HANDLER_PPI {\r
+  EFI_PEI_RSC_HANDLER_REGISTER Register;\r
+  EFI_PEI_RSC_HANDLER_UNREGISTER Unregister;\r
+} EFI_PEI_RSC_HANDLER_PPI;\r
+\r
+extern EFI_GUID gEfiPeiRscHandlerPpiGuid;\r
+\r
+#endif // __REPORT_STATUS_CODE_HANDLER_PPI_H__\r
diff --git a/MdePkg/Include/Protocol/ReportStatusCodeHandler.h b/MdePkg/Include/Protocol/ReportStatusCodeHandler.h
new file mode 100644 (file)
index 0000000..ecf0c29
--- /dev/null
@@ -0,0 +1,95 @@
+/** @file\r
+  This protocol provide registering and unregistering services to status code \r
+  consumers while in DXE.\r
+  \r
+  Copyright (c) 2007 - 2009, 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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  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
+**/\r
+\r
+#ifndef __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__\r
+#define __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__\r
+\r
+#define EFI_RSC_HANDLER_PROTOCOL_GUID \\r
+  { \\r
+    0x86212936, 0xe76, 0x41c8, \\r
+    0xa0, 0x3a, 0x2a, 0xf2, 0xfc, 0x1c, 0x39, 0xe2 \\r
+  }\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RSC_HANDLER_CALLBACK)(\r
+  IN EFI_STATUS_CODE_TYPE   CodeType,\r
+  IN EFI_STATUS_CODE_VALUE  Value,\r
+  IN UINT32                 Instance,\r
+  IN EFI_GUID               *CallerId,\r
+  IN EFI_STATUS_CODE_DATA   *Data\r
+);\r
+\r
+/**\r
+  Register the callback function for ReportStatusCode() notification.\r
+  \r
+  When this function is called the function pointer is added to an internal list and any future calls to\r
+  ReportStatusCode() will be forwarded to the Callback function. During the bootservices,\r
+  this is the callback for which this service can be invoked. The report status code router\r
+  will create an event such that the callback function is only invoked at the TPL for which it was\r
+  registered. The entity that registers for the callback should also register for an event upon\r
+  generation of exit boot services and invoke the unregister service.\r
+  If the handler does not have a TPL dependency, it should register for a callback at TPL high. The\r
+  router infrastructure will support making callbacks at runtime, but the caller for runtime invocation\r
+  must meet the following criteria:\r
+  1. must be a runtime driver type so that its memory is not reclaimed\r
+  2. not unregister at exit boot services so that the router will still have its callback address\r
+  3. the caller must be self-contained (eg. Not call out into any boot-service interfaces) and be\r
+  runtime safe, in general.\r
+  \r
+  @param[in] Callback   A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is called when\r
+                        a call to ReportStatusCode() occurs.\r
+  @param[in] Tpl        TPL at which callback can be safely invoked.   \r
+  \r
+  @retval  EFI_SUCCESS              Function was successfully registered.\r
+  @retval  EFI_INVALID_PARAMETER    The callback function was NULL.\r
+  @retval  EFI_OUT_OF_RESOURCES     The internal buffer ran out of space. No more functions can be\r
+                                    registered.\r
+  @retval  EFI_ALREADY_STARTED      The function was already registered. It can’t be registered again.                              \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RSC_HANDLER_REGISTER)(\r
+  IN EFI_RSC_HANDLER_CALLBACK   Callback,\r
+  IN EFI_TPL                    Tpl\r
+);\r
+\r
+/**\r
+  Remove a previously registered callback function from the notification list.\r
+  \r
+  A callback function must be unregistered before it is deallocated. It is important that any registered\r
+  callbacks that are not runtime complaint be unregistered when ExitBootServices() is called.\r
+  \r
+  @param[in]  Callback  A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is to be\r
+                        unregistered.\r
+                        \r
+  @retval EFI_SUCCESS           The function was successfully unregistered.\r
+  @retval EFI_INVALID_PARAMETER The callback function was NULL.\r
+  @retval EFI_NOT_FOUND         The callback function was not found to be unregistered.                        \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RSC_HANDLER_UNREGISTER)(\r
+  IN EFI_RSC_HANDLER_CALLBACK Callback\r
+);\r
+\r
+typedef struct {\r
+  EFI_RSC_HANDLER_REGISTER Register;\r
+  EFI_RSC_HANDLER_UNREGISTER Unregister;\r
+} EFI_RSC_HANDLER_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiRscHandlerProtocolGuid;\r
+\r
+#endif // __REPORT_STATUS_CODE_HANDLER_H__\r
diff --git a/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h b/MdePkg/Include/Protocol/SmmReportStatusCodeHandler.h
new file mode 100644 (file)
index 0000000..f533ded
--- /dev/null
@@ -0,0 +1,82 @@
+/** @file\r
+  This protocol provides registering and unregistering services to status code consumers while in DXE SMM.\r
+  \r
+  Copyright (c) 2007 - 2009, 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
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  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
+**/\r
+\r
+#ifndef __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__\r
+#define __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__\r
+\r
+#define EFI_SMM_RSC_HANDLER_PROTOCOL_GUID \\r
+  { \\r
+    0x2ff29fa7, 0x5e80, 0x4ed9, 0xb3, 0x80, 0x1, 0x7d, 0x3c, 0x55,\r
+    0x4f, 0xf4\r
+  }\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_RSC_HANDLER_CALLBACK)(\r
+  IN EFI_STATUS_CODE_TYPE   CodeType,\r
+  IN EFI_STATUS_CODE_VALUE  Value,\r
+  IN UINT32                 Instance,\r
+  IN EFI_GUID               *CallerId,\r
+  IN EFI_STATUS_CODE_DATA   *Data\r
+);\r
+\r
+/**\r
+  Register the callback function for ReportStatusCode() notification.\r
+  \r
+  When this function is called the function pointer is added to an internal list and any future calls to\r
+  ReportStatusCode() will be forwarded to the Callback function.\r
+  \r
+  @param[in] Callback               A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is called when\r
+                                    a call to ReportStatusCode() occurs.\r
+\r
+  @retval EFI_SUCCESS               Function was successfully registered.\r
+  @retval EFI_INVALID_PARAMETER     The callback function was NULL.\r
+  @retval EFI_OUT_OF_RESOURCES      The internal buffer ran out of space. No more functions can be\r
+                                    registered.\r
+  @retval EFI_ALREADY_STARTED       The function was already registered. It can’t be registered again.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_RSC_HANDLER_REGISTER)(\r
+  IN EFI_SMM_RSC_HANDLER_CALLBACK Callback\r
+);\r
+\r
+/**\r
+  Remove a previously registered callback function from the notification list.\r
+  \r
+  A callback function must be unregistered before it is deallocated. It is important that any registered\r
+  callbacks that are not runtime complaint be unregistered when ExitBootServices() is called.\r
+\r
+  @param[in] Callback           A pointer to a function of type EFI_SMM_RSC_HANDLER_CALLBACK that is to be\r
+                                unregistered.\r
+                        \r
+  @retval EFI_SUCCESS           The function was successfully unregistered.\r
+  @retval EFI_INVALID_PARAMETER The callback function was NULL.\r
+  @retval EFI_NOT_FOUND         The callback function was not found to be unregistered.\r
+                            \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_RSC_HANDLER_UNREGISTER) (\r
+  IN EFI_SMM_RSC_HANDLER_CALLBACK Callback\r
+);\r
+\r
+typedef struct _EFI_SMM_RSC_HANDLER_PROTOCOL {\r
+  EFI_SMM_RSC_HANDLER_REGISTER  Register;\r
+  SMM_RSC_HANDLER_UNREGISTER    Unregister;\r
+} EFI_SMM_RSC_HANDLER_PROTOCOL;\r
+\r
+extern gEfiSmmRscHandlerProtocolGuid;\r
+\r
+#endif // __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__\r
index b85749a880a9523227e26ce8a7469bedc27a3d68..76c9896b0a1688b18693eb83f9425207917f35f5 100644 (file)
   ## Include/Ppi/S3Resume.h\r
   gEfiPeiS3ResumePpiGuid             = { 0x4426CCB2, 0xE684, 0x4a8a, { 0xae, 0x40, 0x20, 0xd4, 0xb0, 0x25, 0xb7, 0x10 }}\r
 \r
+  ## Include/Ppi/ReportStatusCodeHandler.h\r
+  gEfiPeiRscHandlerPpiGuid           = { 0x65d394, 0x9951, 0x4144, {0x82, 0xa3, 0xa, 0xfc, 0x85, 0x79, 0xc2, 0x51 }}\r
+  \r
 [Protocols]\r
   #\r
   # Protocols defined in PI1.0.\r
   ## Include/Protocol/S3SmmSaveState.h\r
   gEfiS3SmmSaveStateProtocolGuid  = {0x320afe62, 0xe593, 0x49cb, { 0xa9, 0xf1, 0xd4, 0xc2, 0xf4, 0xaf, 0x1, 0x4c}}\r
   \r
+  ## Include/Protocol/ReportStatusCodeHandler.h\r
+  gEfiRscHandlerProtocolGuid      = { 0x86212936, 0xe76, 0x41c8, { 0xa0, 0x3a, 0x2a, 0xf2, 0xfc, 0x1c, 0x39, 0xe2 }}\r
+  \r
+  ## Include/Protocol/SmmReportStatusCodeHandler.h\r
+  gEfiSmmRscHandlerProtocolGuid   = { 0x2ff29fa7, 0x5e80, 0x4ed9, { 0xb3, 0x80, 0x1, 0x7d, 0x3c, 0x55, 0x4f, 0xf4 }}\r
+  \r
   #\r
   # Protocols defined in UEFI2.1/UEFI2.0/EFI1.1\r
   #\r