]>
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 | |
11 | \r | |
12 | #include "Cmos.h"\r | |
13 | #include "Library/IoLib.h"\r | |
14 | \r | |
15 | /**\r | |
16 | Reads 8-bits of CMOS data.\r | |
17 | \r | |
18 | Reads the 8-bits of CMOS data at the location specified by Index.\r | |
19 | The 8-bit read value is returned.\r | |
20 | \r | |
21 | @param Index The CMOS location to read.\r | |
22 | \r | |
23 | @return The value read.\r | |
24 | \r | |
25 | **/\r | |
26 | UINT8\r | |
27 | EFIAPI\r | |
28 | CmosRead8 (\r | |
29 | IN UINTN Index\r | |
30 | )\r | |
31 | {\r | |
32 | IoWrite8 (0x70, (UINT8) Index);\r | |
33 | return IoRead8 (0x71);\r | |
34 | }\r | |
35 | \r | |
36 | \r | |
37 | /**\r | |
38 | Writes 8-bits of CMOS data.\r | |
39 | \r | |
40 | Writes 8-bits of CMOS data to the location specified by Index\r | |
41 | with the value specified by Value and returns Value.\r | |
42 | \r | |
43 | @param Index The CMOS location to write.\r | |
44 | @param Value The value to write to CMOS.\r | |
45 | \r | |
46 | @return The value written to CMOS.\r | |
47 | \r | |
48 | **/\r | |
49 | UINT8\r | |
50 | EFIAPI\r | |
51 | CmosWrite8 (\r | |
52 | IN UINTN Index,\r | |
53 | IN UINT8 Value\r | |
54 | )\r | |
55 | {\r | |
56 | IoWrite8 (0x70, (UINT8) Index);\r | |
57 | IoWrite8 (0x71, Value);\r | |
58 | return Value;\r | |
59 | }\r | |
60 | \r |