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