]>
Commit | Line | Data |
---|---|---|
c69dd9df | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2005, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | x64PcRtc.c\r | |
14 | \r | |
15 | Abstract:\r | |
16 | \r | |
17 | --*/\r | |
18 | \r | |
19 | #include "RealTimeClock.h"\r | |
20 | \r | |
e56dd2ce | 21 | PC_RTC_MODULE_GLOBALS mModuleGlobal;\r |
c69dd9df | 22 | \r |
23 | EFI_STATUS\r | |
24 | EFIAPI\r | |
25 | PcRtcEfiGetTime (\r | |
26 | OUT EFI_TIME *Time,\r | |
27 | OUT EFI_TIME_CAPABILITIES *Capabilities\r | |
28 | )\r | |
29 | /*++\r | |
30 | \r | |
31 | Routine Description:\r | |
32 | \r | |
33 | TODO: Add function description\r | |
34 | \r | |
35 | Arguments:\r | |
36 | \r | |
37 | Time - TODO: add argument description\r | |
38 | Capabilities - TODO: add argument description\r | |
39 | \r | |
40 | Returns:\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 | |
49 | EFI_STATUS\r | |
50 | EFIAPI\r | |
51 | PcRtcEfiSetTime (\r | |
52 | IN EFI_TIME *Time\r | |
53 | )\r | |
54 | /*++\r | |
55 | \r | |
56 | Routine Description:\r | |
57 | \r | |
58 | TODO: Add function description\r | |
59 | \r | |
60 | Arguments:\r | |
61 | \r | |
62 | Time - TODO: add argument description\r | |
63 | \r | |
64 | Returns:\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 | |
73 | EFI_STATUS\r | |
74 | EFIAPI\r | |
75 | PcRtcEfiGetWakeupTime (\r | |
76 | OUT BOOLEAN *Enabled,\r | |
77 | OUT BOOLEAN *Pending,\r | |
78 | OUT EFI_TIME *Time\r | |
79 | )\r | |
80 | /*++\r | |
81 | \r | |
82 | Routine Description:\r | |
83 | \r | |
84 | TODO: Add function description\r | |
85 | \r | |
86 | Arguments:\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 | |
92 | Returns:\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 | |
101 | EFI_STATUS\r | |
102 | EFIAPI\r | |
103 | PcRtcEfiSetWakeupTime (\r | |
104 | IN BOOLEAN Enabled,\r | |
105 | OUT EFI_TIME *Time\r | |
106 | )\r | |
107 | /*++\r | |
108 | \r | |
109 | Routine Description:\r | |
110 | \r | |
111 | TODO: Add function description\r | |
112 | \r | |
113 | Arguments:\r | |
114 | \r | |
115 | Enabled - TODO: add argument description\r | |
116 | Time - TODO: add argument description\r | |
117 | \r | |
118 | Returns:\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 | |
127 | EFI_STATUS\r | |
128 | EFIAPI\r | |
129 | InitializeRealTimeClock (\r | |
130 | IN EFI_HANDLE ImageHandle,\r | |
131 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
132 | )\r | |
133 | /*++\r | |
134 | \r | |
135 | Routine Description:\r | |
136 | \r | |
137 | Arguments:\r | |
138 | \r | |
139 | \r | |
140 | \r | |
141 | Returns: \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 |