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