TianoCore EDK2 master
Loading...
Searching...
No Matches
Cmos.c
Go to the documentation of this file.
1
10#include <Library/DebugLib.h>
11#include "Library/IoLib.h"
12
24UINT8
25EFIAPI
27 IN UINTN Index
28 )
29{
30 IoWrite8 (0x70, (UINT8)Index);
31 return IoRead8 (0x71);
32}
33
46UINT8
47EFIAPI
49 IN UINTN Index,
50 IN UINT8 Value
51 )
52{
53 IoWrite8 (0x70, (UINT8)Index);
54 IoWrite8 (0x71, Value);
55 return Value;
56}
57
61VOID
62EFIAPI
64 VOID
65 )
66{
67 UINT32 Loop;
68
69 DEBUG ((DEBUG_INFO, "CMOS:\n"));
70
71 for (Loop = 0; Loop < 0x80; Loop++) {
72 if ((Loop % 0x10) == 0) {
73 DEBUG ((DEBUG_INFO, "%02x:", Loop));
74 }
75
76 DEBUG ((DEBUG_INFO, " %02x", PlatformCmosRead8 (Loop)));
77 if ((Loop % 0x10) == 0xf) {
78 DEBUG ((DEBUG_INFO, "\n"));
79 }
80 }
81}
UINT64 UINTN
UINT8 EFIAPI IoWrite8(IN UINTN Port, IN UINT8 Value)
Definition: IoLibArmVirt.c:200
UINT8 EFIAPI IoRead8(IN UINTN Port)
Definition: IoLibArmVirt.c:175
UINT8 EFIAPI PlatformCmosRead8(IN UINTN Index)
Definition: Cmos.c:26
VOID EFIAPI PlatformDebugDumpCmos(VOID)
Definition: Cmos.c:63
UINT8 EFIAPI PlatformCmosWrite8(IN UINTN Index, IN UINT8 Value)
Definition: Cmos.c:48
#define IN
Definition: Base.h:279
#define DEBUG(Expression)
Definition: DebugLib.h:434