]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add ResetNotification protocol definition
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 15 Jun 2017 07:25:50 +0000 (15:25 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 3 Jul 2017 07:40:57 +0000 (15:40 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdePkg/Include/Protocol/ResetNotification.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/ResetNotification.h b/MdePkg/Include/Protocol/ResetNotification.h
new file mode 100644 (file)
index 0000000..ade0eee
--- /dev/null
@@ -0,0 +1,86 @@
+/** @file\r
+  EFI Reset Notification Protocol as defined in UEFI 2.7.\r
+  This protocol provides services to register for a notification when ResetSystem is called.\r
+\r
+  Copyright (c) 2017, 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
+  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
+  @par Revision Reference:\r
+  This Protocol is introduced in UEFI Specification 2.7\r
+\r
+**/\r
+\r
+#ifndef __EFI_RESET_NOTIFICATION_H__\r
+#define __EFI_RESET_NOTIFICATION_H__\r
+\r
+#define EFI_RESET_NOTIFICATION_PROTOCOL_GUID \\r
+  { 0x9da34ae0, 0xeaf9, 0x4bbf, { 0x8e, 0xc3, 0xfd, 0x60, 0x22, 0x6c, 0x44, 0xbe } }\r
+\r
+typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL EFI_RESET_NOTIFICATION_PROTOCOL;\r
+\r
+/**\r
+  Register a notification function to be called when ResetSystem() is called.\r
+\r
+  The RegisterResetNotify() function registers a notification function that is called when\r
+  ResetSystem()is called and prior to completing the reset of the platform.\r
+  The registered functions must not perform a platform reset themselves. These\r
+  notifications are intended only for the notification of components which may need some\r
+  special-purpose maintenance prior to the platform resetting.\r
+  The list of registered reset notification functions are processed if ResetSystem()is called\r
+  before ExitBootServices(). The list of registered reset notification functions is ignored if\r
+  ResetSystem()is called after ExitBootServices().\r
+\r
+  @param[in]  This              A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.\r
+  @param[in]  ResetFunction     Points to the function to be called when a ResetSystem() is executed.\r
+\r
+  @retval EFI_SUCCESS           The reset notification function was successfully registered.\r
+  @retval EFI_INVALID_PARAMETER ResetFunction is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to register the reset notification function.\r
+  @retval EFI_ALREADY_STARTED   The reset notification function specified by ResetFunction has already been registered.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REGISTER_RESET_NOTIFY) (\r
+  IN EFI_RESET_NOTIFICATION_PROTOCOL *This,\r
+  IN EFI_RESET_SYSTEM                ResetFunction\r
+);\r
+\r
+/**\r
+  Unregister a notification function.\r
+\r
+  The UnregisterResetNotify() function removes the previously registered\r
+  notification using RegisterResetNotify().\r
+\r
+  @param[in]  This              A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.\r
+  @param[in]  ResetFunction     The pointer to the ResetFunction being unregistered.\r
+\r
+  @retval EFI_SUCCESS           The reset notification function was unregistered.\r
+  @retval EFI_INVALID_PARAMETER ResetFunction is NULL.\r
+  @retval EFI_INVALID_PARAMETER The reset notification function specified by ResetFunction was not previously\r
+                                registered using RegisterResetNotify().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UNREGISTER_RESET_NOTIFY) (\r
+  IN EFI_RESET_NOTIFICATION_PROTOCOL *This,\r
+  IN EFI_RESET_SYSTEM                ResetFunction\r
+);\r
+\r
+typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL {\r
+  EFI_REGISTER_RESET_NOTIFY   RegisterResetNotify;\r
+  EFI_UNREGISTER_RESET_NOTIFY UnRegisterResetNotify;\r
+} EFI_RESET_NOTIFICATION_PROTOCOL;\r
+\r
+\r
+extern EFI_GUID gEfiResetNotificationProtocolGuid;\r
+\r
+#endif\r
+\r
index 4abbbd88886772f0528c3d23c9d19ce93986f7bf..2bdfebf36f0ff318492c0bd81c8617937d2dae16 100644 (file)
   ## Include/Protocol/HttpBootCallback.h\r
   gEfiHttpBootCallbackProtocolGuid   = {0xba23b311, 0x343d, 0x11e6, {0x91, 0x85, 0x58, 0x20, 0xb1, 0xd6, 0x52, 0x99}}\r
 \r
+  ## Include/Protocol/ResetNotification.h\r
+  gEfiResetNotificationProtocolGuid         = { 0x9da34ae0, 0xeaf9, 0x4bbf, { 0x8e, 0xc3, 0xfd, 0x60, 0x22, 0x6c, 0x44, 0xbe } }\r
+\r
   #\r
   # Protocols defined in Shell2.0\r
   #\r