]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/Protocol/ActiveBios.h
Vlv2DeviceRefCodePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / ValleyView2Soc / SouthCluster / Include / Protocol / ActiveBios.h
1 /**
2 **/
3 /**
4
5 Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9
10
11 @file
12 ActiveBios.h
13
14 @brief
15 This protocol is used to report and control what BIOS is mapped to the
16 BIOS address space anchored at 4GB boundary.
17
18 This protocol is EFI compatible.
19
20 E.G. For current generation ICH, the 4GB-16MB to 4GB range can be mapped
21 to PCI, SPI, or FWH.
22
23 **/
24 #ifndef _EFI_ACTIVE_BIOS_PROTOCOL_H_
25 #define _EFI_ACTIVE_BIOS_PROTOCOL_H_
26
27
28
29
30 //
31 #define EFI_ACTIVE_BIOS_PROTOCOL_GUID \
32 { \
33 0xebbe2d1b, 0x1647, 0x4bda, 0xab, 0x9a, 0x78, 0x63, 0xe3, 0x96, 0xd4, 0x1a \
34 }
35 extern EFI_GUID gEfiActiveBiosProtocolGuid;
36
37 ///
38 /// Forward reference for ANSI C compatibility
39 ///
40 typedef struct _EFI_ACTIVE_BIOS_PROTOCOL EFI_ACTIVE_BIOS_PROTOCOL;
41
42 ///
43 /// Protocol definitions
44 ///
45 typedef enum {
46 ActiveBiosStateSpi,
47 ActiveBiosStatePci, /// Obsolete since VLV
48 ActiveBiosStateLpc,
49 ActiveBiosStateMax
50 } EFI_ACTIVE_BIOS_STATE;
51
52 typedef
53 EFI_STATUS
54 (EFIAPI *EFI_ACTIVE_BIOS_SET_ACTIVE_BIOS_STATE) (
55 IN EFI_ACTIVE_BIOS_PROTOCOL * This,
56 IN EFI_ACTIVE_BIOS_STATE DesiredState,
57 IN UINTN Key
58 )
59 /**
60
61 @brief
62 Change the current active BIOS settings to the requested state.
63 The caller is responsible for requesting a supported state from
64 the EFI_ACTIVE_BIOS_STATE selections.
65 This will fail if someone has locked the interface and the correct key is
66 not provided.
67
68 @param[in] This Pointer to the EFI_ACTIVE_BIOS_PROTOCOL instance.
69 @param[in] DesiredState The requested state to configure the system for.
70 @param[in] Key If the interface is locked, Key must be the Key
71 returned from the LockState function call.
72
73 @retval EFI_SUCCESS The function completed successfully
74 @retval EFI_ACCESS_DENIED The interface is currently locked.
75
76 **/
77 ;
78
79 typedef
80 EFI_STATUS
81 (EFIAPI *EFI_ACTIVE_BIOS_LOCK_ACTIVE_BIOS_STATE) (
82 IN EFI_ACTIVE_BIOS_PROTOCOL * This,
83 IN BOOLEAN Lock,
84 IN OUT UINTN *Key
85 );
86
87 /**
88
89 @brief
90 Lock the current active BIOS state from further changes. This allows a
91 caller to implement a critical section. This is optionally supported
92 functionality. Size conscious implementations may choose to require
93 callers cooperate without support from this protocol.
94
95 @param[in] This Pointer to the EFI_ACTIVE_BIOS_PROTOCOL instance.
96 @param[in] Lock TRUE to lock the current state, FALSE to unlock.
97 @param[in] Key If Lock is TRUE, then a key will be returned. If
98 Lock is FALSE, the key returned from the prior call
99 to lock the protocol must be provided to unlock the
100 protocol. The value of Key is undefined except that
101 it cannot be 0.
102
103 @retval EFI_SUCCESS Command succeed.
104 @exception EFI_UNSUPPORTED The function is not supported.
105 @retval EFI_ACCESS_DENIED The interface is currently locked.
106 @retval EFI_DEVICE_ERROR Device error, command aborts abnormally.
107
108 **/
109
110 ///
111 /// Protocol definition
112 ///
113 /// Note that some functions are optional. This means that they may be NULL.
114 /// Caller is required to verify that an optional function is defined by checking
115 /// that the value is not NULL.
116 ///
117 struct _EFI_ACTIVE_BIOS_PROTOCOL {
118 EFI_ACTIVE_BIOS_STATE State;
119 EFI_ACTIVE_BIOS_SET_ACTIVE_BIOS_STATE SetState;
120 EFI_ACTIVE_BIOS_LOCK_ACTIVE_BIOS_STATE LockState;
121 };
122
123 #endif