]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/PcatCompatible/RealTimeClockRuntimeDxe/Ia32/Ia32PcRtc.c
Remove PciHotPlugInit protocol from IntelFrameworkModulePkg because it is defined...
[mirror_edk2.git] / IntelFrameworkModulePkg / PcatCompatible / RealTimeClockRuntimeDxe / Ia32 / Ia32PcRtc.c
CommitLineData
9ba7440c 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation. All rights reserved. <BR> \r
4This software and associated documentation (if any) is furnished\r
5under a license and may only be used or copied in accordance\r
6with the terms of the license. Except as permitted by such\r
7license, no part of this software or documentation may be\r
8reproduced, stored in a retrieval system, or transmitted in any\r
9form or by any means without the express written consent of\r
10Intel Corporation.\r
11\r
12\r
13\r
14Module Name:\r
15\r
16 Ia32PcRtc.c\r
17\r
18Abstract:\r
19\r
20--*/\r
21\r
22#include "PcRtc.h"\r
23\r
24static PC_RTC_MODULE_GLOBALS mModuleGlobal;\r
25\r
26EFI_STATUS\r
27EFIAPI\r
28PcRtcEfiGetTime (\r
29 OUT EFI_TIME *Time,\r
30 OUT EFI_TIME_CAPABILITIES *Capabilities\r
31 )\r
32/*++\r
33\r
34Routine Description:\r
35\r
36 GC_TODO: Add function description\r
37\r
38Arguments:\r
39\r
40 Time - GC_TODO: add argument description\r
41 Capabilities - GC_TODO: add argument description\r
42\r
43Returns:\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
52EFI_STATUS\r
53EFIAPI\r
54PcRtcEfiSetTime (\r
55 IN EFI_TIME *Time\r
56 )\r
57/*++\r
58\r
59Routine Description:\r
60\r
61 GC_TODO: Add function description\r
62\r
63Arguments:\r
64\r
65 Time - GC_TODO: add argument description\r
66\r
67Returns:\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
76EFI_STATUS\r
77EFIAPI\r
78PcRtcEfiGetWakeupTime (\r
79 OUT BOOLEAN *Enabled,\r
80 OUT BOOLEAN *Pending,\r
81 OUT EFI_TIME *Time\r
82 )\r
83/*++\r
84\r
85Routine Description:\r
86\r
87 GC_TODO: Add function description\r
88\r
89Arguments:\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
95Returns:\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
104EFI_STATUS\r
105EFIAPI\r
106PcRtcEfiSetWakeupTime (\r
107 IN BOOLEAN Enabled,\r
108 OUT EFI_TIME *Time\r
109 )\r
110/*++\r
111\r
112Routine Description:\r
113\r
114 GC_TODO: Add function description\r
115\r
116Arguments:\r
117\r
118 Enabled - GC_TODO: add argument description\r
119 Time - GC_TODO: add argument description\r
120\r
121Returns:\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
130EFI_STATUS\r
131EFIAPI\r
132InitializePcRtc (\r
133 IN EFI_HANDLE ImageHandle,\r
134 IN EFI_SYSTEM_TABLE *SystemTable\r
135 )\r
136/*++\r
137\r
138Routine Description:\r
139\r
140 Arguments:\r
141\r
142 \r
143\r
144Returns: \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