]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Pei/Reset/Reset.c
Merge branch of PI tree to main trunk
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Reset / Reset.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Reset.c
15
16 Abstract:
17
18 Pei Core Reset System Support
19
20 Revision History
21
22 --*/
23
24 #include <PeiMain.h>
25
26 EFI_STATUS
27 EFIAPI
28 PeiResetSystem (
29 IN CONST EFI_PEI_SERVICES **PeiServices
30 )
31 /*++
32
33 Routine Description:
34
35 Core version of the Reset System
36
37 Arguments:
38
39 PeiServices - The PEI core services table.
40
41 Returns:
42
43 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
44 - EFI_DEVICE_ERROR. Did not reset system.
45
46 Otherwise, resets the system.
47
48 --*/
49 {
50 EFI_STATUS Status;
51 EFI_PEI_RESET_PPI *ResetPpi;
52
53 Status = PeiServicesLocatePpi (
54 &gEfiPeiResetPpiGuid,
55 0,
56 NULL,
57 (VOID **)&ResetPpi
58 );
59
60 //
61 // LocatePpi returns EFI_NOT_FOUND on error
62 //
63 if (!EFI_ERROR (Status)) {
64 return ResetPpi->ResetSystem (PeiServices);
65 }
66 return EFI_NOT_AVAILABLE_YET;
67 }
68