]>
Commit | Line | Data |
---|---|---|
49ba9447 | 1 | /** @file\r |
2 | PC/AT CMOS access routines\r | |
3 | \r | |
56d7640a | 4 | Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r |
b26f0cf9 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
49ba9447 | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | \r | |
10 | #include "Cmos.h"\r | |
11 | #include "Library/IoLib.h"\r | |
12 | \r | |
13 | /**\r | |
14 | Reads 8-bits of CMOS data.\r | |
15 | \r | |
16 | Reads the 8-bits of CMOS data at the location specified by Index.\r | |
17 | The 8-bit read value is returned.\r | |
18 | \r | |
19 | @param Index The CMOS location to read.\r | |
20 | \r | |
21 | @return The value read.\r | |
22 | \r | |
23 | **/\r | |
24 | UINT8\r | |
25 | EFIAPI\r | |
26 | CmosRead8 (\r | |
27 | IN UINTN Index\r | |
28 | )\r | |
29 | {\r | |
30 | IoWrite8 (0x70, (UINT8) Index);\r | |
31 | return IoRead8 (0x71);\r | |
32 | }\r | |
33 | \r | |
34 | \r | |
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 | |
50 | IN UINTN Index,\r | |
51 | IN UINT8 Value\r | |
52 | )\r | |
53 | {\r | |
54 | IoWrite8 (0x70, (UINT8) Index);\r | |
55 | IoWrite8 (0x71, Value);\r | |
56 | return Value;\r | |
57 | }\r | |
58 | \r |