Home | History | Annotate | Download | only in Library
      1 /** @file
      2   Implement EFI RealTimeClock runtime services via Lib.
      3 
      4   Currently this driver does not support runtime virtual calling.
      5 
      6   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
      7 
      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
     12 
     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.
     15 
     16 **/
     17 
     18 #ifndef __REAL_TIME_CLOCK_LIB__
     19 #define __REAL_TIME_CLOCK_LIB__
     20 
     21 
     22 /**
     23   Returns the current time and date information, and the time-keeping capabilities
     24   of the hardware platform.
     25 
     26   @param  Time                  A pointer to storage to receive a snapshot of the current time.
     27   @param  Capabilities          An optional pointer to a buffer to receive the real time clock
     28                                 device's capabilities.
     29 
     30   @retval EFI_SUCCESS           The operation completed successfully.
     31   @retval EFI_INVALID_PARAMETER Time is NULL.
     32   @retval EFI_DEVICE_ERROR      The time could not be retrieved due to hardware error.
     33 
     34 **/
     35 EFI_STATUS
     36 EFIAPI
     37 LibGetTime (
     38   OUT EFI_TIME                *Time,
     39   OUT  EFI_TIME_CAPABILITIES  *Capabilities
     40   );
     41 
     42 
     43 /**
     44   Sets the current local time and date information.
     45 
     46   @param  Time                  A pointer to the current time.
     47 
     48   @retval EFI_SUCCESS           The operation completed successfully.
     49   @retval EFI_INVALID_PARAMETER A time field is out of range.
     50   @retval EFI_DEVICE_ERROR      The time could not be set due due to hardware error.
     51 
     52 **/
     53 EFI_STATUS
     54 EFIAPI
     55 LibSetTime (
     56   IN EFI_TIME                *Time
     57   );
     58 
     59 
     60 /**
     61   Returns the current wakeup alarm clock setting.
     62 
     63   @param  Enabled               Indicates if the alarm is currently enabled or disabled.
     64   @param  Pending               Indicates if the alarm signal is pending and requires acknowledgement.
     65   @param  Time                  The current alarm setting.
     66 
     67   @retval EFI_SUCCESS           The alarm settings were returned.
     68   @retval EFI_INVALID_PARAMETER Any parameter is NULL.
     69   @retval EFI_DEVICE_ERROR      The wakeup time could not be retrieved due to a hardware error.
     70 
     71 **/
     72 EFI_STATUS
     73 EFIAPI
     74 LibGetWakeupTime (
     75   OUT BOOLEAN     *Enabled,
     76   OUT BOOLEAN     *Pending,
     77   OUT EFI_TIME    *Time
     78   );
     79 
     80 
     81 /**
     82   Sets the system wakeup alarm clock time.
     83 
     84   @param  Enabled               Enable or disable the wakeup alarm.
     85   @param  Time                  If Enable is TRUE, the time to set the wakeup alarm for.
     86 
     87   @retval EFI_SUCCESS           If Enable is TRUE, then the wakeup alarm was enabled. If
     88                                 Enable is FALSE, then the wakeup alarm was disabled.
     89   @retval EFI_INVALID_PARAMETER A time field is out of range.
     90   @retval EFI_DEVICE_ERROR      The wakeup time could not be set due to a hardware error.
     91   @retval EFI_UNSUPPORTED       A wakeup timer is not supported on this platform.
     92 
     93 **/
     94 EFI_STATUS
     95 EFIAPI
     96 LibSetWakeupTime (
     97   IN BOOLEAN      Enabled,
     98   OUT EFI_TIME    *Time
     99   );
    100 
    101 
    102 
    103 /**
    104   This is the declaration of an EFI image entry point. This can be the entry point to an application
    105   written to this specification, an EFI boot service driver, or an EFI runtime driver.
    106 
    107   @param  ImageHandle           Handle that identifies the loaded image.
    108   @param  SystemTable           System Table for this image.
    109 
    110   @retval EFI_SUCCESS           The operation completed successfully.
    111 
    112 **/
    113 EFI_STATUS
    114 EFIAPI
    115 LibRtcInitialize (
    116   IN EFI_HANDLE                            ImageHandle,
    117   IN EFI_SYSTEM_TABLE                      *SystemTable
    118   );
    119 
    120 
    121 /**
    122   Fixup internal data so that EFI can be call in virtual mode.
    123   Call the passed in Child Notify event and convert any pointers in
    124   lib to virtual mode.
    125 
    126   @param[in]    Event   The Event that is being processed
    127   @param[in]    Context Event Context
    128 **/
    129 VOID
    130 EFIAPI
    131 LibRtcVirtualNotifyEvent (
    132   IN EFI_EVENT        Event,
    133   IN VOID             *Context
    134   );
    135 
    136 
    137 #endif
    138 
    139