2 Implement EFI RealTimeClock runtime services via RTC Lib.
4 Currently this driver does not support runtime virtual calling.
6 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #include <Library/BaseLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/IoLib.h>
22 #include <Library/RealTimeClockLib.h>
26 Returns the current time and date information, and the time-keeping capabilities
27 of the hardware platform.
29 @param Time A pointer to storage to receive a snapshot of the current time.
30 @param Capabilities An optional pointer to a buffer to receive the real time clock
31 device's capabilities.
33 @retval EFI_SUCCESS The operation completed successfully.
34 @retval EFI_INVALID_PARAMETER Time is NULL.
35 @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error.
42 OUT EFI_TIME_CAPABILITIES
*Capabilities
46 // Fill in Time and Capabilities via data from you RTC
48 return EFI_DEVICE_ERROR
;
53 Sets the current local time and date information.
55 @param Time A pointer to the current time.
57 @retval EFI_SUCCESS The operation completed successfully.
58 @retval EFI_INVALID_PARAMETER A time field is out of range.
59 @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error.
69 // Use Time, to set the time in your RTC hardware
71 return EFI_DEVICE_ERROR
;
76 Returns the current wakeup alarm clock setting.
78 @param Enabled Indicates if the alarm is currently enabled or disabled.
79 @param Pending Indicates if the alarm signal is pending and requires acknowledgement.
80 @param Time The current alarm setting.
82 @retval EFI_SUCCESS The alarm settings were returned.
83 @retval EFI_INVALID_PARAMETER Any parameter is NULL.
84 @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
95 // Not a required feature
96 return EFI_UNSUPPORTED
;
101 Sets the system wakeup alarm clock time.
103 @param Enabled Enable or disable the wakeup alarm.
104 @param Time If Enable is TRUE, the time to set the wakeup alarm for.
106 @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If
107 Enable is FALSE, then the wakeup alarm was disabled.
108 @retval EFI_INVALID_PARAMETER A time field is out of range.
109 @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error.
110 @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
120 // Not a required feature
121 return EFI_UNSUPPORTED
;
127 This is the declaration of an EFI image entry point. This can be the entry point to an application
128 written to this specification, an EFI boot service driver, or an EFI runtime driver.
130 @param ImageHandle Handle that identifies the loaded image.
131 @param SystemTable System Table for this image.
133 @retval EFI_SUCCESS The operation completed successfully.
139 IN EFI_HANDLE ImageHandle
,
140 IN EFI_SYSTEM_TABLE
*SystemTable
144 // Do some initialization if reqruied to turn on the RTC
151 Fixup internal data so that EFI can be call in virtual mode.
152 Call the passed in Child Notify event and convert any pointers in
155 @param[in] Event The Event that is being processed
156 @param[in] Context Event Context
160 LibRtcVirtualNotifyEvent (
166 // Only needed if you are going to support the OS calling RTC functions in virtual mode.
167 // You will need to call EfiConvertPointer (). To convert any stored physical addresses
168 // to virtual address. After the OS transistions to calling in virtual mode, all future
169 // runtime calls will be made in virtual mode.