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