]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/SmmPowerButtonDispatch2.h
MdePkg: Reference new definitions for Management Mode.
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmPowerButtonDispatch2.h
index ef4626a693c026e4f0c663c3aea5a4aa922d42c5..fa844cbe6dd43c789a9c239444745b7ec8b1f3bf 100644 (file)
@@ -4,7 +4,7 @@
 \r
   This protocol provides the parent dispatch service for the power button SMI source generator.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2017, 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
 #ifndef _SMM_POWER_BUTTON_DISPATCH2_H_\r
 #define _SMM_POWER_BUTTON_DISPATCH2_H_\r
 \r
-#include <Pi/PiSmmCis.h>\r
+#include <Protocol/MmPowerButtonDispatch.h>\r
 \r
-#define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID \\r
-  { \\r
-    0x1b1183fa, 0x1823, 0x46a7, {0x88, 0x72, 0x9c, 0x57, 0x87, 0x55, 0x40, 0x9d } \\r
-  }\r
-\r
-///\r
-/// Power Button phases.\r
-///\r
-typedef enum {\r
-  EfiPowerButtonEntry,\r
-  EfiPowerButtonExit,\r
-  EfiPowerButtonMax\r
-} EFI_POWER_BUTTON_PHASE;\r
+#define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID\r
 \r
 ///\r
 /// The dispatch function's context.\r
 ///\r
-typedef struct {\r
-  ///\r
-  /// Designates whether this handler should be invoked upon entry or exit.\r
-  ///\r
-  EFI_POWER_BUTTON_PHASE  Phase;\r
-} EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT;\r
-\r
-typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL;\r
+typedef EFI_MM_POWER_BUTTON_REGISTER_CONTEXT EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT;\r
 \r
-/**\r
-  Provides the parent dispatch service for a power button event.\r
-\r
-  This service registers a function (DispatchFunction) which will be called when an SMI is \r
-  generated because the power button was pressed or released, as specified by RegisterContext. \r
-  On return, DispatchHandle contains a unique handle which may be used later to unregister the \r
-  function using UnRegister().\r
-  The DispatchFunction will be called with Context set to the same value as was passed into \r
-  this function in RegisterContext and with CommBuffer and CommBufferSize set to NULL.\r
-\r
-  @param[in]  This               Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL instance.\r
-  @param[in]  DispatchFunction   Function to register for handler when power button is pressed or released.\r
-  @param[in]  RegisterContext    Pointer to the dispatch function's context. The caller fills in this context\r
-                                 before calling the Register() function to indicate to the Register() function\r
-                                 the power button SMI phase for which the dispatch function should be invoked.\r
-  @param[out] DispatchHandle     Handle generated by the dispatcher to track the function instance. \r
-\r
-  @retval EFI_SUCCESS            The dispatch function has been successfully\r
-                                 registered and the SMI source has been enabled.\r
-  @retval EFI_DEVICE_ERROR       The driver was unable to enable the SMI source.\r
-  @retval EFI_INVALID_PARAMETER  RegisterContext is invalid. The power button input value\r
-                                 is not within valid range.\r
-  @retval EFI_OUT_OF_RESOURCES   There is not enough memory (system or SMM) to manage this child.\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER2)(\r
-  IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL  *This,\r
-  IN       EFI_SMM_HANDLER_ENTRY_POINT2             DispatchFunction,\r
-  IN       EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT    *RegisterContext,\r
-  OUT      EFI_HANDLE                               *DispatchHandle\r
-  );\r
+typedef EFI_MM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL;\r
 \r
-/**\r
-  Unregisters a power-button service.\r
+typedef EFI_MM_POWER_BUTTON_REGISTER EFI_SMM_POWER_BUTTON_REGISTER2;\r
 \r
-  This service removes the handler associated with DispatchHandle so that it will no longer be \r
-  called when the standby button is pressed or released. \r
-\r
-  @param[in] This                Pointer to the EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL instance.\r
-  @param[in] DispatchHandle      Handle of the service to remove.\r
-\r
-  @retval EFI_SUCCESS            The service has been successfully removed.\r
-  @retval EFI_INVALID_PARAMETER  The DispatchHandle was not valid.\r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER2)(\r
-  IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL  *This,\r
-  IN       EFI_HANDLE                               DispatchHandle\r
-  );\r
-\r
-///\r
-/// Interface structure for the SMM Power Button Dispatch2 Protocol.\r
-///\r
-/// This protocol provides the parent dispatch service for the power button SMI source generator.\r
-///\r
-struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL {\r
-  EFI_SMM_POWER_BUTTON_REGISTER2    Register;\r
-  EFI_SMM_POWER_BUTTON_UNREGISTER2  UnRegister;\r
-};\r
+typedef EFI_MM_POWER_BUTTON_UNREGISTER EFI_SMM_POWER_BUTTON_UNREGISTER2;\r
 \r
 extern EFI_GUID gEfiSmmPowerButtonDispatch2ProtocolGuid;\r
 \r