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