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