VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h@ 98942

最後變更 在這個檔案從98942是 80721,由 vboxsync 提交於 6 年 前

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 4.3 KB
 
1/** @file
2
3 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef _RESET_SYSTEM2_H_
10#define _RESET_SYSTEM2_H_
11
12
13#include <Uefi.h>
14#include <PiPei.h>
15
16#include <Ppi/Reset2.h>
17#include <Ppi/PlatformSpecificResetFilter.h>
18#include <Ppi/PlatformSpecificResetNotification.h>
19#include <Ppi/PlatformSpecificResetHandler.h>
20
21#include <Library/BaseLib.h>
22#include <Library/BaseMemoryLib.h>
23#include <Library/DebugLib.h>
24#include <Library/PeiServicesLib.h>
25#include <Library/HobLib.h>
26#include <Library/ResetSystemLib.h>
27#include <Library/ReportStatusCodeLib.h>
28
29
30//
31// The maximum recursion depth to ResetSystem() by reset notification handlers
32//
33#define MAX_RESET_NOTIFY_DEPTH 10
34
35//
36// Data to put in GUIDed HOB
37//
38typedef struct {
39 UINT32 Signature;
40 UINT32 Count;
41 EFI_RESET_SYSTEM ResetFilters[0]; // ResetFilters[PcdGet32 (PcdMaximumResetNotifies)]
42} RESET_FILTER_LIST;
43#define RESET_FILTER_LIST_SIGNATURE SIGNATURE_32('r', 's', 't', 'l')
44
45
46typedef struct {
47 EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI ResetFilter;
48 EFI_GUID *Guid;
49} RESET_FILTER_INSTANCE;
50
51/**
52 Resets the entire platform.
53
54 @param[in] ResetType The type of reset to perform.
55 @param[in] ResetStatus The status code for the reset.
56 @param[in] DataSize The size, in bytes, of ResetData.
57 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
58 EfiResetShutdown the data buffer starts with a Null-terminated
59 string, optionally followed by additional binary data.
60 The string is a description that the caller may use to further
61 indicate the reason for the system reset.
62 For a ResetType of EfiResetPlatformSpecific the data buffer
63 also starts with a Null-terminated string that is followed
64 by an EFI_GUID that describes the specific type of reset to perform.
65
66**/
67VOID
68EFIAPI
69ResetSystem2 (
70 IN EFI_RESET_TYPE ResetType,
71 IN EFI_STATUS ResetStatus,
72 IN UINTN DataSize,
73 IN VOID *ResetData OPTIONAL
74 );
75/**
76 Register a notification function to be called when ResetSystem() is called.
77
78 The RegisterResetNotify() function registers a notification function that is called when
79 ResetSystem()is called and prior to completing the reset of the platform.
80 The registered functions must not perform a platform reset themselves. These
81 notifications are intended only for the notification of components which may need some
82 special-purpose maintenance prior to the platform resetting.
83
84 @param[in] This A pointer to the EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI instance.
85 @param[in] ResetFunction Points to the function to be called when a ResetSystem() is executed.
86
87 @retval EFI_SUCCESS The reset notification function was successfully registered.
88 @retval EFI_INVALID_PARAMETER ResetFunction is NULL.
89 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to register the reset notification function.
90 @retval EFI_ALREADY_STARTED The reset notification function specified by ResetFunction has already been registered.
91
92**/
93EFI_STATUS
94EFIAPI
95RegisterResetNotify (
96 IN EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PPI *This,
97 IN EFI_RESET_SYSTEM ResetFunction
98 );
99
100/**
101 Unregister a notification function.
102
103 The UnregisterResetNotify() function removes the previously registered
104 notification using RegisterResetNotify().
105
106 @param[in] This A pointer to the EFI_RESET_NOTIFICATION_PROTOCOL instance.
107 @param[in] ResetFunction The pointer to the ResetFunction being unregistered.
108
109 @retval EFI_SUCCESS The reset notification function was unregistered.
110 @retval EFI_INVALID_PARAMETER ResetFunction is NULL.
111 @retval EFI_INVALID_PARAMETER The reset notification function specified by ResetFunction was not previously
112 registered using RegisterResetNotify().
113
114**/
115EFI_STATUS
116EFIAPI
117UnregisterResetNotify (
118 IN EFI_RESET_NOTIFICATION_PROTOCOL *This,
119 IN EFI_RESET_SYSTEM ResetFunction
120 );
121#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette