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