]> git.proxmox.com Git - mirror_edk2.git/blob - PcAtChipsetPkg/PcRtc/RealTimeClockEntry.c
Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[mirror_edk2.git] / PcAtChipsetPkg / PcRtc / RealTimeClockEntry.c
1 /*++
2
3 Copyright (c) 2009, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13 --*/
14
15 #include "RealTimeClock.h"
16
17 PC_RTC_MODULE_GLOBALS mModuleGlobal;
18
19 EFI_STATUS
20 EFIAPI
21 PcRtcEfiGetTime (
22 OUT EFI_TIME *Time,
23 OUT EFI_TIME_CAPABILITIES *Capabilities
24 )
25 /*++
26
27 Routine Description:
28
29 TODO: Add function description
30
31 Arguments:
32
33 Time - TODO: add argument description
34 Capabilities - TODO: add argument description
35
36 Returns:
37
38 TODO: add return values
39
40 --*/
41 {
42 return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);
43 }
44
45 EFI_STATUS
46 EFIAPI
47 PcRtcEfiSetTime (
48 IN EFI_TIME *Time
49 )
50 /*++
51
52 Routine Description:
53
54 TODO: Add function description
55
56 Arguments:
57
58 Time - TODO: add argument description
59
60 Returns:
61
62 TODO: add return values
63
64 --*/
65 {
66 return PcRtcSetTime (Time, &mModuleGlobal);
67 }
68
69 EFI_STATUS
70 EFIAPI
71 PcRtcEfiGetWakeupTime (
72 OUT BOOLEAN *Enabled,
73 OUT BOOLEAN *Pending,
74 OUT EFI_TIME *Time
75 )
76 /*++
77
78 Routine Description:
79
80 TODO: Add function description
81
82 Arguments:
83
84 Enabled - TODO: add argument description
85 Pending - TODO: add argument description
86 Time - TODO: add argument description
87
88 Returns:
89
90 TODO: add return values
91
92 --*/
93 {
94 return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);
95 }
96
97 EFI_STATUS
98 EFIAPI
99 PcRtcEfiSetWakeupTime (
100 IN BOOLEAN Enabled,
101 OUT EFI_TIME *Time
102 )
103 /*++
104
105 Routine Description:
106
107 TODO: Add function description
108
109 Arguments:
110
111 Enabled - TODO: add argument description
112 Time - TODO: add argument description
113
114 Returns:
115
116 TODO: add return values
117
118 --*/
119 {
120 return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);
121 }
122
123 EFI_STATUS
124 EFIAPI
125 InitializeRealTimeClock (
126 IN EFI_HANDLE ImageHandle,
127 IN EFI_SYSTEM_TABLE *SystemTable
128 )
129 /*++
130
131 Routine Description:
132
133 Arguments:
134
135
136
137 Returns:
138 --*/
139 // TODO: ImageHandle - add argument and description to function comment
140 // TODO: SystemTable - add argument and description to function comment
141 {
142 EFI_STATUS Status;
143 EFI_HANDLE NewHandle;
144
145 EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_HIGH_LEVEL);
146
147 Status = PcRtcInit (&mModuleGlobal);
148 if (EFI_ERROR (Status)) {
149 return Status;
150 }
151
152 SystemTable->RuntimeServices->GetTime = PcRtcEfiGetTime;
153 SystemTable->RuntimeServices->SetTime = PcRtcEfiSetTime;
154 SystemTable->RuntimeServices->GetWakeupTime = PcRtcEfiGetWakeupTime;
155 SystemTable->RuntimeServices->SetWakeupTime = PcRtcEfiSetWakeupTime;
156
157 NewHandle = NULL;
158 Status = gBS->InstallMultipleProtocolInterfaces (
159 &NewHandle,
160 &gEfiRealTimeClockArchProtocolGuid,
161 NULL,
162 NULL
163 );
164
165 return Status;
166 }