fb0b259e |
1 | /** @file\r |
2 | Provides Set/Get time operations.\r |
8cd4d17c |
3 | \r |
fb0b259e |
4 | Copyright (c) 2006 - 2007, Intel Corporation\r |
3cfb790c |
5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r |
8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
8cd4d17c |
12 | \r |
fb0b259e |
13 | **/\r |
8cd4d17c |
14 | \r |
15 | #include "PcRtc.h"\r |
16 | \r |
fe1e36e5 |
17 | PC_RTC_MODULE_GLOBALS mModuleGlobal;\r |
8cd4d17c |
18 | \r |
19 | EFI_STATUS\r |
20 | EFIAPI\r |
21 | PcRtcEfiGetTime (\r |
22 | OUT EFI_TIME *Time,\r |
23 | OUT EFI_TIME_CAPABILITIES *Capabilities\r |
24 | )\r |
25 | /*++\r |
26 | \r |
27 | Routine Description:\r |
28 | \r |
29 | GC_TODO: Add function description\r |
30 | \r |
31 | Arguments:\r |
32 | \r |
33 | Time - GC_TODO: add argument description\r |
34 | Capabilities - GC_TODO: add argument description\r |
35 | \r |
36 | Returns:\r |
37 | \r |
38 | GC_TODO: add return values\r |
39 | \r |
40 | --*/\r |
41 | {\r |
42 | return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);\r |
43 | }\r |
44 | \r |
45 | EFI_STATUS\r |
46 | EFIAPI\r |
47 | PcRtcEfiSetTime (\r |
48 | IN EFI_TIME *Time\r |
49 | )\r |
50 | /*++\r |
51 | \r |
52 | Routine Description:\r |
53 | \r |
54 | GC_TODO: Add function description\r |
55 | \r |
56 | Arguments:\r |
57 | \r |
58 | Time - GC_TODO: add argument description\r |
59 | \r |
60 | Returns:\r |
61 | \r |
62 | GC_TODO: add return values\r |
63 | \r |
64 | --*/\r |
65 | {\r |
66 | return PcRtcSetTime (Time, &mModuleGlobal);\r |
67 | }\r |
68 | \r |
69 | EFI_STATUS\r |
70 | EFIAPI\r |
71 | PcRtcEfiGetWakeupTime (\r |
72 | OUT BOOLEAN *Enabled,\r |
73 | OUT BOOLEAN *Pending,\r |
74 | OUT EFI_TIME *Time\r |
75 | )\r |
76 | /*++\r |
77 | \r |
78 | Routine Description:\r |
79 | \r |
80 | GC_TODO: Add function description\r |
81 | \r |
82 | Arguments:\r |
83 | \r |
84 | Enabled - GC_TODO: add argument description\r |
85 | Pending - GC_TODO: add argument description\r |
86 | Time - GC_TODO: add argument description\r |
87 | \r |
88 | Returns:\r |
89 | \r |
90 | GC_TODO: add return values\r |
91 | \r |
92 | --*/\r |
93 | {\r |
94 | return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);\r |
95 | }\r |
96 | \r |
97 | EFI_STATUS\r |
98 | EFIAPI\r |
99 | PcRtcEfiSetWakeupTime (\r |
100 | IN BOOLEAN Enabled,\r |
101 | OUT EFI_TIME *Time\r |
102 | )\r |
103 | /*++\r |
104 | \r |
105 | Routine Description:\r |
106 | \r |
107 | GC_TODO: Add function description\r |
108 | \r |
109 | Arguments:\r |
110 | \r |
111 | Enabled - GC_TODO: add argument description\r |
112 | Time - GC_TODO: add argument description\r |
113 | \r |
114 | Returns:\r |
115 | \r |
116 | GC_TODO: add return values\r |
117 | \r |
118 | --*/\r |
119 | {\r |
120 | return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);\r |
121 | }\r |
122 | \r |
123 | EFI_STATUS\r |
124 | EFIAPI\r |
125 | InitializePcRtc (\r |
126 | IN EFI_HANDLE ImageHandle,\r |
127 | IN EFI_SYSTEM_TABLE *SystemTable\r |
128 | )\r |
129 | /*++\r |
130 | \r |
131 | Routine Description:\r |
132 | \r |
133 | Arguments:\r |
134 | \r |
8cd4d17c |
135 | \r |
fb0b259e |
136 | \r |
137 | Returns:\r |
8cd4d17c |
138 | --*/\r |
139 | // GC_TODO: ImageHandle - add argument and description to function comment\r |
140 | // GC_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 | gRT->GetTime = PcRtcEfiGetTime;\r |
153 | gRT->SetTime = PcRtcEfiSetTime;\r |
154 | gRT->GetWakeupTime = PcRtcEfiGetWakeupTime;\r |
155 | gRT->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 |