Remove autogen.h from all dxs files, because autogen.h file has been included by...
[mirror_edk2.git] / EdkModulePkg / Core / Pei / BootMode / BootMode.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 BootMode.c
15
16 Abstract:
17
18 EFI PEI Core Boot Mode services
19
20
21
22 Revision History
23
24 --*/
25
26 #include <PeiMain.h>
27
28 EFI_STATUS
29 EFIAPI
30 PeiGetBootMode (
31 IN EFI_PEI_SERVICES **PeiServices,
32 OUT EFI_BOOT_MODE *BootMode
33 )
34 /*++
35
36 Routine Description:
37
38 This service enables PEIMs to ascertain the present value of the boot mode.
39
40 Arguments:
41
42 PeiServices - The PEI core services table.
43 BootMode - A pointer to contain the value of the boot mode.
44
45 Returns:
46
47 EFI_SUCCESS - The boot mode was returned successfully.
48 EFI_INVALID_PARAMETER - BootMode is NULL.
49
50 --*/
51 {
52 PEI_CORE_INSTANCE *PrivateData;
53 EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
54
55
56 if (BootMode == NULL) {
57 return EFI_INVALID_PARAMETER;
58 }
59
60 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
61
62 HandOffHob = (PrivateData->HobList.HandoffInformationTable);
63
64 *BootMode = HandOffHob->BootMode;
65
66
67 return EFI_SUCCESS;
68 }
69
70
71 EFI_STATUS
72 EFIAPI
73 PeiSetBootMode (
74 IN EFI_PEI_SERVICES **PeiServices,
75 IN EFI_BOOT_MODE BootMode
76 )
77 /*++
78
79 Routine Description:
80
81 This service enables PEIMs to update the boot mode variable.
82
83 Arguments:
84
85 PeiServices - The PEI core services table.
86 BootMode - The value of the boot mode to set.
87
88 Returns:
89
90 EFI_SUCCESS - The value was successfully updated
91
92 --*/
93 {
94 PEI_CORE_INSTANCE *PrivateData;
95 EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
96
97
98 PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);
99
100 HandOffHob = (PrivateData->HobList.HandoffInformationTable);
101
102 HandOffHob->BootMode = BootMode;
103
104
105 return EFI_SUCCESS;
106 }