]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/ResetNotification.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / ResetNotification.h
CommitLineData
342470a6
RN
1/** @file\r
2 EFI Reset Notification Protocol as defined in UEFI 2.7.\r
3 This protocol provides services to register for a notification when ResetSystem is called.\r
4\r
5 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
9344f092 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
342470a6
RN
7\r
8 @par Revision Reference:\r
9 This Protocol is introduced in UEFI Specification 2.7\r
10\r
11**/\r
12\r
13#ifndef __EFI_RESET_NOTIFICATION_H__\r
14#define __EFI_RESET_NOTIFICATION_H__\r
15\r
16#define EFI_RESET_NOTIFICATION_PROTOCOL_GUID \\r
17 { 0x9da34ae0, 0xeaf9, 0x4bbf, { 0x8e, 0xc3, 0xfd, 0x60, 0x22, 0x6c, 0x44, 0xbe } }\r
18\r
19typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL EFI_RESET_NOTIFICATION_PROTOCOL;\r
20\r
21/**\r
22 Register a notification function to be called when ResetSystem() is called.\r
23\r
24 The RegisterResetNotify() function registers a notification function that is called when\r
25 ResetSystem()is called and prior to completing the reset of the platform.\r
26 The registered functions must not perform a platform reset themselves. These\r
27 notifications are intended only for the notification of components which may need some\r
28 special-purpose maintenance prior to the platform resetting.\r
29 The list of registered reset notification functions are processed if ResetSystem()is called\r
30 before ExitBootServices(). The list of registered reset notification functions is ignored if\r
31 ResetSystem()is called after ExitBootServices().\r
32\r
33 @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.\r
34 @param[in] ResetFunction Points to the function to be called when a ResetSystem() is executed.\r
35\r
36 @retval EFI_SUCCESS The reset notification function was successfully registered.\r
37 @retval EFI_INVALID_PARAMETER ResetFunction is NULL.\r
38 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register the reset notification function.\r
39 @retval EFI_ALREADY_STARTED The reset notification function specified by ResetFunction has already been registered.\r
40\r
41**/\r
42typedef\r
43EFI_STATUS\r
44(EFIAPI *EFI_REGISTER_RESET_NOTIFY) (\r
45 IN EFI_RESET_NOTIFICATION_PROTOCOL *This,\r
46 IN EFI_RESET_SYSTEM ResetFunction\r
47);\r
48\r
49/**\r
50 Unregister a notification function.\r
51\r
52 The UnregisterResetNotify() function removes the previously registered\r
53 notification using RegisterResetNotify().\r
54\r
55 @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.\r
56 @param[in] ResetFunction The pointer to the ResetFunction being unregistered.\r
57\r
58 @retval EFI_SUCCESS The reset notification function was unregistered.\r
59 @retval EFI_INVALID_PARAMETER ResetFunction is NULL.\r
60 @retval EFI_INVALID_PARAMETER The reset notification function specified by ResetFunction was not previously\r
61 registered using RegisterResetNotify().\r
62\r
63**/\r
64typedef\r
65EFI_STATUS\r
66(EFIAPI *EFI_UNREGISTER_RESET_NOTIFY) (\r
67 IN EFI_RESET_NOTIFICATION_PROTOCOL *This,\r
68 IN EFI_RESET_SYSTEM ResetFunction\r
69);\r
70\r
71typedef struct _EFI_RESET_NOTIFICATION_PROTOCOL {\r
72 EFI_REGISTER_RESET_NOTIFY RegisterResetNotify;\r
fcccba37 73 EFI_UNREGISTER_RESET_NOTIFY UnregisterResetNotify;\r
342470a6
RN
74} EFI_RESET_NOTIFICATION_PROTOCOL;\r
75\r
76\r
77extern EFI_GUID gEfiResetNotificationProtocolGuid;\r
78\r
79#endif\r
80\r