]>
Commit | Line | Data |
---|---|---|
49ba9447 | 1 | /** @file\r |
2 | PC/AT CMOS access routines\r | |
3 | \r | |
56d7640a HT |
4 | Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
49ba9447 | 6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | \r | |
16 | #include "Cmos.h"\r | |
17 | #include "Library/IoLib.h"\r | |
18 | \r | |
19 | /**\r | |
20 | Reads 8-bits of CMOS data.\r | |
21 | \r | |
22 | Reads the 8-bits of CMOS data at the location specified by Index.\r | |
23 | The 8-bit read value is returned.\r | |
24 | \r | |
25 | @param Index The CMOS location to read.\r | |
26 | \r | |
27 | @return The value read.\r | |
28 | \r | |
29 | **/\r | |
30 | UINT8\r | |
31 | EFIAPI\r | |
32 | CmosRead8 (\r | |
33 | IN UINTN Index\r | |
34 | )\r | |
35 | {\r | |
36 | IoWrite8 (0x70, (UINT8) Index);\r | |
37 | return IoRead8 (0x71);\r | |
38 | }\r | |
39 | \r | |
40 | \r | |
41 | /**\r | |
42 | Writes 8-bits of CMOS data.\r | |
43 | \r | |
44 | Writes 8-bits of CMOS data to the location specified by Index\r | |
45 | with the value specified by Value and returns Value.\r | |
46 | \r | |
47 | @param Index The CMOS location to write.\r | |
48 | @param Value The value to write to CMOS.\r | |
49 | \r | |
50 | @return The value written to CMOS.\r | |
51 | \r | |
52 | **/\r | |
53 | UINT8\r | |
54 | EFIAPI\r | |
55 | CmosWrite8 (\r | |
56 | IN UINTN Index,\r | |
57 | IN UINT8 Value\r | |
58 | )\r | |
59 | {\r | |
60 | IoWrite8 (0x70, (UINT8) Index);\r | |
61 | IoWrite8 (0x71, Value);\r | |
62 | return Value;\r | |
63 | }\r | |
64 | \r |