8cd4d17c |
1 | /*++\r |
2 | \r |
3 | Copyright (c) 2006, Intel Corporation. All rights reserved. <BR> \r |
4 | This software and associated documentation (if any) is furnished\r |
5 | under a license and may only be used or copied in accordance\r |
6 | with the terms of the license. Except as permitted by such\r |
7 | license, no part of this software or documentation may be\r |
8 | reproduced, stored in a retrieval system, or transmitted in any\r |
9 | form or by any means without the express written consent of\r |
10 | Intel Corporation.\r |
11 | \r |
12 | \r |
13 | \r |
14 | Module Name:\r |
15 | \r |
16 | Ia32PcRtc.c\r |
17 | \r |
18 | Abstract:\r |
19 | \r |
20 | --*/\r |
21 | \r |
22 | #include "PcRtc.h"\r |
23 | \r |
24 | static PC_RTC_MODULE_GLOBALS mModuleGlobal;\r |
25 | \r |
26 | EFI_STATUS\r |
27 | EFIAPI\r |
28 | PcRtcEfiGetTime (\r |
29 | OUT EFI_TIME *Time,\r |
30 | OUT EFI_TIME_CAPABILITIES *Capabilities\r |
31 | )\r |
32 | /*++\r |
33 | \r |
34 | Routine Description:\r |
35 | \r |
36 | GC_TODO: Add function description\r |
37 | \r |
38 | Arguments:\r |
39 | \r |
40 | Time - GC_TODO: add argument description\r |
41 | Capabilities - GC_TODO: add argument description\r |
42 | \r |
43 | Returns:\r |
44 | \r |
45 | GC_TODO: add return values\r |
46 | \r |
47 | --*/\r |
48 | {\r |
49 | return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);\r |
50 | }\r |
51 | \r |
52 | EFI_STATUS\r |
53 | EFIAPI\r |
54 | PcRtcEfiSetTime (\r |
55 | IN EFI_TIME *Time\r |
56 | )\r |
57 | /*++\r |
58 | \r |
59 | Routine Description:\r |
60 | \r |
61 | GC_TODO: Add function description\r |
62 | \r |
63 | Arguments:\r |
64 | \r |
65 | Time - GC_TODO: add argument description\r |
66 | \r |
67 | Returns:\r |
68 | \r |
69 | GC_TODO: add return values\r |
70 | \r |
71 | --*/\r |
72 | {\r |
73 | return PcRtcSetTime (Time, &mModuleGlobal);\r |
74 | }\r |
75 | \r |
76 | EFI_STATUS\r |
77 | EFIAPI\r |
78 | PcRtcEfiGetWakeupTime (\r |
79 | OUT BOOLEAN *Enabled,\r |
80 | OUT BOOLEAN *Pending,\r |
81 | OUT EFI_TIME *Time\r |
82 | )\r |
83 | /*++\r |
84 | \r |
85 | Routine Description:\r |
86 | \r |
87 | GC_TODO: Add function description\r |
88 | \r |
89 | Arguments:\r |
90 | \r |
91 | Enabled - GC_TODO: add argument description\r |
92 | Pending - GC_TODO: add argument description\r |
93 | Time - GC_TODO: add argument description\r |
94 | \r |
95 | Returns:\r |
96 | \r |
97 | GC_TODO: add return values\r |
98 | \r |
99 | --*/\r |
100 | {\r |
101 | return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);\r |
102 | }\r |
103 | \r |
104 | EFI_STATUS\r |
105 | EFIAPI\r |
106 | PcRtcEfiSetWakeupTime (\r |
107 | IN BOOLEAN Enabled,\r |
108 | OUT EFI_TIME *Time\r |
109 | )\r |
110 | /*++\r |
111 | \r |
112 | Routine Description:\r |
113 | \r |
114 | GC_TODO: Add function description\r |
115 | \r |
116 | Arguments:\r |
117 | \r |
118 | Enabled - GC_TODO: add argument description\r |
119 | Time - GC_TODO: add argument description\r |
120 | \r |
121 | Returns:\r |
122 | \r |
123 | GC_TODO: add return values\r |
124 | \r |
125 | --*/\r |
126 | {\r |
127 | return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);\r |
128 | }\r |
129 | \r |
130 | EFI_STATUS\r |
131 | EFIAPI\r |
132 | InitializePcRtc (\r |
133 | IN EFI_HANDLE ImageHandle,\r |
134 | IN EFI_SYSTEM_TABLE *SystemTable\r |
135 | )\r |
136 | /*++\r |
137 | \r |
138 | Routine Description:\r |
139 | \r |
140 | Arguments:\r |
141 | \r |
142 | \r |
143 | \r |
144 | Returns: \r |
145 | --*/\r |
146 | // GC_TODO: ImageHandle - add argument and description to function comment\r |
147 | // GC_TODO: SystemTable - add argument and description to function comment\r |
148 | {\r |
149 | EFI_STATUS Status;\r |
150 | EFI_HANDLE NewHandle;\r |
151 | \r |
152 | EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_HIGH_LEVEL);\r |
153 | \r |
154 | Status = PcRtcInit (&mModuleGlobal);\r |
155 | if (EFI_ERROR (Status)) {\r |
156 | return Status;\r |
157 | }\r |
158 | \r |
159 | gRT->GetTime = PcRtcEfiGetTime;\r |
160 | gRT->SetTime = PcRtcEfiSetTime;\r |
161 | gRT->GetWakeupTime = PcRtcEfiGetWakeupTime;\r |
162 | gRT->SetWakeupTime = PcRtcEfiSetWakeupTime;\r |
163 | \r |
164 | NewHandle = NULL;\r |
165 | Status = gBS->InstallMultipleProtocolInterfaces (\r |
166 | &NewHandle,\r |
167 | &gEfiRealTimeClockArchProtocolGuid,\r |
168 | NULL,\r |
169 | NULL\r |
170 | );\r |
171 | \r |
172 | return Status;\r |
173 | }\r |