]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Pei/Reset/Reset.c
b0c4b24370de2b252832a2ce432551d9c3f073b2
[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 //
25 // Include common header file for this module.
26 //
27 #include "CommonHeader.h"
28
29 #include <PeiMain.h>
30
31 EFI_STATUS
32 EFIAPI
33 PeiResetSystem (
34 IN EFI_PEI_SERVICES **PeiServices
35 )
36 /*++
37
38 Routine Description:
39
40 Core version of the Reset System
41
42 Arguments:
43
44 PeiServices - The PEI core services table.
45
46 Returns:
47
48 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
49 - EFI_DEVICE_ERROR. Did not reset system.
50
51 Otherwise, resets the system.
52
53 --*/
54 {
55 EFI_STATUS Status;
56 EFI_PEI_RESET_PPI *ResetPpi;
57
58 Status = PeiServicesLocatePpi (
59 &gEfiPeiResetPpiGuid,
60 0,
61 NULL,
62 (VOID **)&ResetPpi
63 );
64
65 //
66 // LocatePpi returns EFI_NOT_FOUND on error
67 //
68 if (!EFI_ERROR (Status)) {
69 return ResetPpi->ResetSystem (PeiServices);
70 }
71 return EFI_NOT_AVAILABLE_YET;
72 }
73