]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/Ia32/Ia32PcRtc.c
Code Scrub for ConPlatform.
[mirror_edk2.git] / MdeModulePkg / Universal / PcatRealTimeClockRuntimeDxe / Ia32 / Ia32PcRtc.c
1 /** @file
2 Provides Set/Get time operations.
3
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "PcRtc.h"
16
17 PC_RTC_MODULE_GLOBALS mModuleGlobal;
18
19 EFI_STATUS
20 EFIAPI
21 PcRtcEfiGetTime (
22 OUT EFI_TIME *Time,
23 OUT EFI_TIME_CAPABILITIES *Capabilities
24 )
25 /*++
26
27 Routine Description:
28
29 GC_TODO: Add function description
30
31 Arguments:
32
33 Time - GC_TODO: add argument description
34 Capabilities - GC_TODO: add argument description
35
36 Returns:
37
38 GC_TODO: add return values
39
40 --*/
41 {
42 return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);
43 }
44
45 EFI_STATUS
46 EFIAPI
47 PcRtcEfiSetTime (
48 IN EFI_TIME *Time
49 )
50 /*++
51
52 Routine Description:
53
54 GC_TODO: Add function description
55
56 Arguments:
57
58 Time - GC_TODO: add argument description
59
60 Returns:
61
62 GC_TODO: add return values
63
64 --*/
65 {
66 return PcRtcSetTime (Time, &mModuleGlobal);
67 }
68
69 EFI_STATUS
70 EFIAPI
71 PcRtcEfiGetWakeupTime (
72 OUT BOOLEAN *Enabled,
73 OUT BOOLEAN *Pending,
74 OUT EFI_TIME *Time
75 )
76 /*++
77
78 Routine Description:
79
80 GC_TODO: Add function description
81
82 Arguments:
83
84 Enabled - GC_TODO: add argument description
85 Pending - GC_TODO: add argument description
86 Time - GC_TODO: add argument description
87
88 Returns:
89
90 GC_TODO: add return values
91
92 --*/
93 {
94 return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);
95 }
96
97 EFI_STATUS
98 EFIAPI
99 PcRtcEfiSetWakeupTime (
100 IN BOOLEAN Enabled,
101 OUT EFI_TIME *Time
102 )
103 /*++
104
105 Routine Description:
106
107 GC_TODO: Add function description
108
109 Arguments:
110
111 Enabled - GC_TODO: add argument description
112 Time - GC_TODO: add argument description
113
114 Returns:
115
116 GC_TODO: add return values
117
118 --*/
119 {
120 return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);
121 }
122
123 EFI_STATUS
124 EFIAPI
125 InitializePcRtc (
126 IN EFI_HANDLE ImageHandle,
127 IN EFI_SYSTEM_TABLE *SystemTable
128 )
129 /*++
130
131 Routine Description:
132
133 Arguments:
134
135
136
137 Returns:
138 --*/
139 // GC_TODO: ImageHandle - add argument and description to function comment
140 // GC_TODO: SystemTable - add argument and description to function comment
141 {
142 EFI_STATUS Status;
143 EFI_HANDLE NewHandle;
144
145 EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_HIGH_LEVEL);
146
147 Status = PcRtcInit (&mModuleGlobal);
148 if (EFI_ERROR (Status)) {
149 return Status;
150 }
151
152 gRT->GetTime = PcRtcEfiGetTime;
153 gRT->SetTime = PcRtcEfiSetTime;
154 gRT->GetWakeupTime = PcRtcEfiGetWakeupTime;
155 gRT->SetWakeupTime = PcRtcEfiSetWakeupTime;
156
157 NewHandle = NULL;
158 Status = gBS->InstallMultipleProtocolInterfaces (
159 &NewHandle,
160 &gEfiRealTimeClockArchProtocolGuid,
161 NULL,
162 NULL
163 );
164
165 return Status;
166 }