]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/PlatformInitLib/Cmos.c
2 PC/AT CMOS access routines
4 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #include <Library/PlatformInitLib.h>
10 #include <Library/DebugLib.h>
11 #include "Library/IoLib.h"
14 Reads 8-bits of CMOS data.
16 Reads the 8-bits of CMOS data at the location specified by Index.
17 The 8-bit read value is returned.
19 @param Index The CMOS location to read.
21 @return The value read.
30 IoWrite8 (0x70, (UINT8
)Index
);
31 return IoRead8 (0x71);
35 Writes 8-bits of CMOS data.
37 Writes 8-bits of CMOS data to the location specified by Index
38 with the value specified by Value and returns Value.
40 @param Index The CMOS location to write.
41 @param Value The value to write to CMOS.
43 @return The value written to CMOS.
53 IoWrite8 (0x70, (UINT8
)Index
);
54 IoWrite8 (0x71, Value
);
63 PlatformDebugDumpCmos (
69 DEBUG ((DEBUG_INFO
, "CMOS:\n"));
71 for (Loop
= 0; Loop
< 0x80; Loop
++) {
72 if ((Loop
% 0x10) == 0) {
73 DEBUG ((DEBUG_INFO
, "%02x:", Loop
));
76 DEBUG ((DEBUG_INFO
, " %02x", PlatformCmosRead8 (Loop
)));
77 if ((Loop
% 0x10) == 0xf) {
78 DEBUG ((DEBUG_INFO
, "\n"));