]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Bhyve/PlatformPei/Cmos.c
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Bhyve / PlatformPei / Cmos.c
1 /** @file
2 PC/AT CMOS access routines
3
4 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #include "Cmos.h"
10 #include "Library/IoLib.h"
11
12 /**
13 Reads 8-bits of CMOS data.
14
15 Reads the 8-bits of CMOS data at the location specified by Index.
16 The 8-bit read value is returned.
17
18 @param Index The CMOS location to read.
19
20 @return The value read.
21
22 **/
23 UINT8
24 EFIAPI
25 CmosRead8 (
26 IN UINTN Index
27 )
28 {
29 IoWrite8 (0x70, (UINT8)Index);
30 return IoRead8 (0x71);
31 }
32
33 /**
34 Writes 8-bits of CMOS data.
35
36 Writes 8-bits of CMOS data to the location specified by Index
37 with the value specified by Value and returns Value.
38
39 @param Index The CMOS location to write.
40 @param Value The value to write to CMOS.
41
42 @return The value written to CMOS.
43
44 **/
45 UINT8
46 EFIAPI
47 CmosWrite8 (
48 IN UINTN Index,
49 IN UINT8 Value
50 )
51 {
52 IoWrite8 (0x70, (UINT8)Index);
53 IoWrite8 (0x71, Value);
54 return Value;
55 }