* MdeModulePkg/Core/Pei/Dependency/Dependency.h
[edk2.git] / DuetPkg / PcRtc / RealTimeClockEntry.c
blob7c5354835c38649a6127ee27ea3fffb22b99fa9e
1 /*++
3 Copyright (c) 2009, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 --*/
15 #include "RealTimeClock.h"
17 PC_RTC_MODULE_GLOBALS mModuleGlobal;
19 EFI_STATUS
20 EFIAPI
21 PcRtcEfiGetTime (
22 OUT EFI_TIME *Time,
23 OUT EFI_TIME_CAPABILITIES *Capabilities
25 /*++
27 Routine Description:
29 TODO: Add function description
31 Arguments:
33 Time - TODO: add argument description
34 Capabilities - TODO: add argument description
36 Returns:
38 TODO: add return values
40 --*/
42 return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);
45 EFI_STATUS
46 EFIAPI
47 PcRtcEfiSetTime (
48 IN EFI_TIME *Time
50 /*++
52 Routine Description:
54 TODO: Add function description
56 Arguments:
58 Time - TODO: add argument description
60 Returns:
62 TODO: add return values
64 --*/
66 return PcRtcSetTime (Time, &mModuleGlobal);
69 EFI_STATUS
70 EFIAPI
71 PcRtcEfiGetWakeupTime (
72 OUT BOOLEAN *Enabled,
73 OUT BOOLEAN *Pending,
74 OUT EFI_TIME *Time
76 /*++
78 Routine Description:
80 TODO: Add function description
82 Arguments:
84 Enabled - TODO: add argument description
85 Pending - TODO: add argument description
86 Time - TODO: add argument description
88 Returns:
90 TODO: add return values
92 --*/
94 return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);
97 EFI_STATUS
98 EFIAPI
99 PcRtcEfiSetWakeupTime (
100 IN BOOLEAN Enabled,
101 OUT EFI_TIME *Time
103 /*++
105 Routine Description:
107 TODO: Add function description
109 Arguments:
111 Enabled - TODO: add argument description
112 Time - TODO: add argument description
114 Returns:
116 TODO: add return values
118 --*/
120 return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);
123 EFI_STATUS
124 EFIAPI
125 InitializeRealTimeClock (
126 IN EFI_HANDLE ImageHandle,
127 IN EFI_SYSTEM_TABLE *SystemTable
129 /*++
131 Routine Description:
133 Arguments:
137 Returns:
138 --*/
139 // TODO: ImageHandle - add argument and description to function comment
140 // TODO: SystemTable - add argument and description to function comment
142 EFI_STATUS Status;
143 EFI_HANDLE NewHandle;
145 EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_HIGH_LEVEL);
147 Status = PcRtcInit (&mModuleGlobal);
148 if (EFI_ERROR (Status)) {
149 return Status;
152 SystemTable->RuntimeServices->GetTime = PcRtcEfiGetTime;
153 SystemTable->RuntimeServices->SetTime = PcRtcEfiSetTime;
154 SystemTable->RuntimeServices->GetWakeupTime = PcRtcEfiGetWakeupTime;
155 SystemTable->RuntimeServices->SetWakeupTime = PcRtcEfiSetWakeupTime;
157 NewHandle = NULL;
158 Status = gBS->InstallMultipleProtocolInterfaces (
159 &NewHandle,
160 &gEfiRealTimeClockArchProtocolGuid,
161 NULL,
162 NULL
165 return Status;