]>
Commit | Line | Data |
---|---|---|
c69dd9df | 1 | /*++\r |
2 | \r | |
269c0ba2 | 3 | Copyright (c) 2009, Intel Corporation \r |
c69dd9df | 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 | |
c69dd9df | 12 | \r |
13 | --*/\r | |
14 | \r | |
15 | #include "RealTimeClock.h"\r | |
16 | \r | |
e56dd2ce | 17 | PC_RTC_MODULE_GLOBALS mModuleGlobal;\r |
c69dd9df | 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 | TODO: Add function description\r | |
30 | \r | |
31 | Arguments:\r | |
32 | \r | |
33 | Time - TODO: add argument description\r | |
34 | Capabilities - TODO: add argument description\r | |
35 | \r | |
36 | Returns:\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 | |
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 | TODO: Add function description\r | |
55 | \r | |
56 | Arguments:\r | |
57 | \r | |
58 | Time - TODO: add argument description\r | |
59 | \r | |
60 | Returns:\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 | |
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 | TODO: Add function description\r | |
81 | \r | |
82 | Arguments:\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 | |
88 | Returns:\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 | |
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 | TODO: Add function description\r | |
108 | \r | |
109 | Arguments:\r | |
110 | \r | |
111 | Enabled - TODO: add argument description\r | |
112 | Time - TODO: add argument description\r | |
113 | \r | |
114 | Returns:\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 | |
123 | EFI_STATUS\r | |
124 | EFIAPI\r | |
125 | InitializeRealTimeClock (\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 | |
135 | \r | |
136 | \r | |
137 | Returns: \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 |