]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/PcRtc/X64/RealTimeClock.c
Patch to remove STATIC modifier. This is on longer recommended by EFI Framework codin...
[mirror_edk2.git] / DuetPkg / PcRtc / X64 / RealTimeClock.c
CommitLineData
c69dd9df 1/*++\r
2\r
3Copyright (c) 2005, Intel Corporation \r
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
12Module Name:\r
13 x64PcRtc.c\r
14\r
15Abstract:\r
16\r
17--*/\r
18\r
19#include "RealTimeClock.h"\r
20\r
e56dd2ce 21PC_RTC_MODULE_GLOBALS mModuleGlobal;\r
c69dd9df 22\r
23EFI_STATUS\r
24EFIAPI\r
25PcRtcEfiGetTime (\r
26 OUT EFI_TIME *Time,\r
27 OUT EFI_TIME_CAPABILITIES *Capabilities\r
28 )\r
29/*++\r
30\r
31Routine Description:\r
32\r
33 TODO: Add function description\r
34\r
35Arguments:\r
36\r
37 Time - TODO: add argument description\r
38 Capabilities - TODO: add argument description\r
39\r
40Returns:\r
41\r
42 TODO: add return values\r
43\r
44--*/\r
45{\r
46 return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);\r
47}\r
48\r
49EFI_STATUS\r
50EFIAPI\r
51PcRtcEfiSetTime (\r
52 IN EFI_TIME *Time\r
53 )\r
54/*++\r
55\r
56Routine Description:\r
57\r
58 TODO: Add function description\r
59\r
60Arguments:\r
61\r
62 Time - TODO: add argument description\r
63\r
64Returns:\r
65\r
66 TODO: add return values\r
67\r
68--*/\r
69{\r
70 return PcRtcSetTime (Time, &mModuleGlobal);\r
71}\r
72\r
73EFI_STATUS\r
74EFIAPI\r
75PcRtcEfiGetWakeupTime (\r
76 OUT BOOLEAN *Enabled,\r
77 OUT BOOLEAN *Pending,\r
78 OUT EFI_TIME *Time\r
79 )\r
80/*++\r
81\r
82Routine Description:\r
83\r
84 TODO: Add function description\r
85\r
86Arguments:\r
87\r
88 Enabled - TODO: add argument description\r
89 Pending - TODO: add argument description\r
90 Time - TODO: add argument description\r
91\r
92Returns:\r
93\r
94 TODO: add return values\r
95\r
96--*/\r
97{\r
98 return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);\r
99}\r
100\r
101EFI_STATUS\r
102EFIAPI\r
103PcRtcEfiSetWakeupTime (\r
104 IN BOOLEAN Enabled,\r
105 OUT EFI_TIME *Time\r
106 )\r
107/*++\r
108\r
109Routine Description:\r
110\r
111 TODO: Add function description\r
112\r
113Arguments:\r
114\r
115 Enabled - TODO: add argument description\r
116 Time - TODO: add argument description\r
117\r
118Returns:\r
119\r
120 TODO: add return values\r
121\r
122--*/\r
123{\r
124 return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);\r
125}\r
126\r
127EFI_STATUS\r
128EFIAPI\r
129InitializeRealTimeClock (\r
130 IN EFI_HANDLE ImageHandle,\r
131 IN EFI_SYSTEM_TABLE *SystemTable\r
132 )\r
133/*++\r
134\r
135Routine Description:\r
136\r
137 Arguments:\r
138\r
139 \r
140\r
141Returns: \r
142--*/\r
143// TODO: ImageHandle - add argument and description to function comment\r
144// TODO: SystemTable - add argument and description to function comment\r
145{\r
146 EFI_STATUS Status;\r
147 EFI_HANDLE NewHandle;\r
148\r
149 EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_HIGH_LEVEL);\r
150\r
151 Status = PcRtcInit (&mModuleGlobal);\r
152 if (EFI_ERROR (Status)) {\r
153 return Status;\r
154 }\r
155\r
156 SystemTable->RuntimeServices->GetTime = PcRtcEfiGetTime;\r
157 SystemTable->RuntimeServices->SetTime = PcRtcEfiSetTime;\r
158 SystemTable->RuntimeServices->GetWakeupTime = PcRtcEfiGetWakeupTime;\r
159 SystemTable->RuntimeServices->SetWakeupTime = PcRtcEfiSetWakeupTime;\r
160\r
161 NewHandle = NULL;\r
162 Status = gBS->InstallMultipleProtocolInterfaces (\r
163 &NewHandle,\r
164 &gEfiRealTimeClockArchProtocolGuid,\r
165 NULL,\r
166 NULL\r
167 );\r
168\r
169 return Status;\r
170}\r