]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtcEntry.c
MdeModulePkg:Clear the screen before booting the boot option
[mirror_edk2.git] / PcAtChipsetPkg / PcatRealTimeClockRuntimeDxe / PcRtcEntry.c
... / ...
CommitLineData
1/** @file\r
2 Provides Set/Get time operations.\r
3\r
4Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include "PcRtc.h"\r
16\r
17PC_RTC_MODULE_GLOBALS mModuleGlobal;\r
18\r
19EFI_HANDLE mHandle = NULL;\r
20\r
21\r
22/**\r
23 Returns the current time and date information, and the time-keeping capabilities\r
24 of the hardware platform.\r
25\r
26 @param Time A pointer to storage to receive a snapshot of the current time.\r
27 @param Capabilities An optional pointer to a buffer to receive the real time\r
28 clock device's capabilities.\r
29\r
30 @retval EFI_SUCCESS The operation completed successfully.\r
31 @retval EFI_INVALID_PARAMETER Time is NULL.\r
32 @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.\r
33\r
34**/\r
35EFI_STATUS\r
36EFIAPI\r
37PcRtcEfiGetTime (\r
38 OUT EFI_TIME *Time,\r
39 OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL\r
40 )\r
41{\r
42 return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);\r
43}\r
44\r
45/**\r
46 Sets the current local time and date information.\r
47\r
48 @param Time A pointer to the current time.\r
49\r
50 @retval EFI_SUCCESS The operation completed successfully.\r
51 @retval EFI_INVALID_PARAMETER A time field is out of range.\r
52 @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.\r
53\r
54**/\r
55EFI_STATUS\r
56EFIAPI\r
57PcRtcEfiSetTime (\r
58 IN EFI_TIME *Time\r
59 )\r
60{\r
61 return PcRtcSetTime (Time, &mModuleGlobal);\r
62}\r
63\r
64/**\r
65 Returns the current wakeup alarm clock setting.\r
66\r
67 @param Enabled Indicates if the alarm is currently enabled or disabled.\r
68 @param Pending Indicates if the alarm signal is pending and requires acknowledgement.\r
69 @param Time The current alarm setting.\r
70\r
71 @retval EFI_SUCCESS The alarm settings were returned.\r
72 @retval EFI_INVALID_PARAMETER Enabled is NULL.\r
73 @retval EFI_INVALID_PARAMETER Pending is NULL.\r
74 @retval EFI_INVALID_PARAMETER Time is NULL.\r
75 @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.\r
76 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r
77\r
78**/\r
79EFI_STATUS\r
80EFIAPI\r
81PcRtcEfiGetWakeupTime (\r
82 OUT BOOLEAN *Enabled,\r
83 OUT BOOLEAN *Pending,\r
84 OUT EFI_TIME *Time\r
85 )\r
86{\r
87 return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);\r
88}\r
89\r
90\r
91/**\r
92 Sets the system wakeup alarm clock time.\r
93\r
94 @param Enabled Enable or disable the wakeup alarm.\r
95 @param Time If Enable is TRUE, the time to set the wakeup alarm for.\r
96 If Enable is FALSE, then this parameter is optional, and may be NULL.\r
97\r
98 @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled.\r
99 If Enable is FALSE, then the wakeup alarm was disabled.\r
100 @retval EFI_INVALID_PARAMETER A time field is out of range.\r
101 @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.\r
102 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.\r
103\r
104**/\r
105EFI_STATUS\r
106EFIAPI\r
107PcRtcEfiSetWakeupTime (\r
108 IN BOOLEAN Enabled,\r
109 IN EFI_TIME *Time OPTIONAL\r
110 )\r
111{\r
112 return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);\r
113}\r
114\r
115/**\r
116 The user Entry Point for PcRTC module.\r
117\r
118 This is the entrhy point for PcRTC module. It installs the UEFI runtime service\r
119 including GetTime(),SetTime(),GetWakeupTime(),and SetWakeupTime().\r
120\r
121 @param ImageHandle The firmware allocated handle for the EFI image.\r
122 @param SystemTable A pointer to the EFI System Table.\r
123\r
124 @retval EFI_SUCCESS The entry point is executed successfully.\r
125 @retval Others Some error occurs when executing this entry point.\r
126\r
127**/\r
128EFI_STATUS\r
129EFIAPI\r
130InitializePcRtc (\r
131 IN EFI_HANDLE ImageHandle,\r
132 IN EFI_SYSTEM_TABLE *SystemTable\r
133 )\r
134{\r
135 EFI_STATUS Status;\r
136\r
137 EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_CALLBACK);\r
138\r
139 Status = PcRtcInit (&mModuleGlobal);\r
140 ASSERT_EFI_ERROR (Status);\r
141\r
142 gRT->GetTime = PcRtcEfiGetTime;\r
143 gRT->SetTime = PcRtcEfiSetTime;\r
144 gRT->GetWakeupTime = PcRtcEfiGetWakeupTime;\r
145 gRT->SetWakeupTime = PcRtcEfiSetWakeupTime;\r
146\r
147 Status = gBS->InstallMultipleProtocolInterfaces (\r
148 &mHandle,\r
149 &gEfiRealTimeClockArchProtocolGuid,\r
150 NULL,\r
151 NULL\r
152 );\r
153 ASSERT_EFI_ERROR (Status);\r
154\r
155 return Status;\r
156}\r