]>
Commit | Line | Data |
---|---|---|
3b96221f AP |
1 | /** @file\r |
2 | PC/AT CMOS access routines\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r | |
5 | Copyright (c) 2019, Citrix Systems, Inc.\r | |
6 | \r | |
7 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
8 | \r | |
9 | **/\r | |
10 | \r | |
3b96221f AP |
11 | #include "Cmos.h"\r |
12 | #include "Library/IoLib.h"\r | |
13 | \r | |
14 | /**\r | |
15 | Reads 8-bits of CMOS data.\r | |
16 | \r | |
17 | Reads the 8-bits of CMOS data at the location specified by Index.\r | |
18 | The 8-bit read value is returned.\r | |
19 | \r | |
20 | @param Index The CMOS location to read.\r | |
21 | \r | |
22 | @return The value read.\r | |
23 | \r | |
24 | **/\r | |
25 | UINT8\r | |
26 | EFIAPI\r | |
27 | CmosRead8 (\r | |
ac0a286f | 28 | IN UINTN Index\r |
3b96221f AP |
29 | )\r |
30 | {\r | |
ac0a286f | 31 | IoWrite8 (0x70, (UINT8)Index);\r |
3b96221f AP |
32 | return IoRead8 (0x71);\r |
33 | }\r | |
34 | \r | |
3b96221f AP |
35 | /**\r |
36 | Writes 8-bits of CMOS data.\r | |
37 | \r | |
38 | Writes 8-bits of CMOS data to the location specified by Index\r | |
39 | with the value specified by Value and returns Value.\r | |
40 | \r | |
41 | @param Index The CMOS location to write.\r | |
42 | @param Value The value to write to CMOS.\r | |
43 | \r | |
44 | @return The value written to CMOS.\r | |
45 | \r | |
46 | **/\r | |
47 | UINT8\r | |
48 | EFIAPI\r | |
49 | CmosWrite8 (\r | |
ac0a286f MK |
50 | IN UINTN Index,\r |
51 | IN UINT8 Value\r | |
3b96221f AP |
52 | )\r |
53 | {\r | |
ac0a286f | 54 | IoWrite8 (0x70, (UINT8)Index);\r |
3b96221f AP |
55 | IoWrite8 (0x71, Value);\r |
56 | return Value;\r | |
57 | }\r |