]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/Ia32/Ia32PcRtc.c
Code scrub:
[mirror_edk2.git] / MdeModulePkg / Universal / PcatRealTimeClockRuntimeDxe / Ia32 / Ia32PcRtc.c
index 638d54d3cfa362721faadb93b83e7fbb633027e8..ce3fa904926de2643e296fb74c147a3ac8583d6b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides Set/Get time operations.\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -16,56 +16,66 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 PC_RTC_MODULE_GLOBALS  mModuleGlobal;\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-PcRtcEfiGetTime (\r
-  OUT EFI_TIME                *Time,\r
-  OUT  EFI_TIME_CAPABILITIES  *Capabilities\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
+EFI_HANDLE             mHandle = NULL;\r
 \r
-Arguments:\r
 \r
-  Time          - GC_TODO: add argument description\r
-  Capabilities  - GC_TODO: add argument description\r
+/**\r
+  Returns the current time and date information, and the time-keeping capabilities\r
+  of the hardware platform.\r
 \r
-Returns:\r
+  @param  Time          A pointer to storage to receive a snapshot of the current time.\r
+  @param  Capabilities  An optional pointer to a buffer to receive the real time\r
+                        clock device's capabilities.\r
 \r
-  GC_TODO: add return values\r
+  @retval EFI_SUCCESS            The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER  Time is NULL.\r
+  @retval EFI_DEVICE_ERROR       The time could not be retrieved due to hardware error.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PcRtcEfiGetTime (\r
+  OUT EFI_TIME                *Time,\r
+  OUT EFI_TIME_CAPABILITIES   *Capabilities  OPTIONAL\r
+  )\r
 {\r
   return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);\r
 }\r
 \r
+/**\r
+  Sets the current local time and date information.\r
+\r
+  @param  Time                   A pointer to the current time.\r
+\r
+  @retval EFI_SUCCESS            The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER  A time field is out of range.\r
+  @retval EFI_DEVICE_ERROR       The time could not be set due due to hardware error.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PcRtcEfiSetTime (\r
   IN EFI_TIME                *Time\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Time  - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  GC_TODO: add return values\r
-\r
---*/\r
 {\r
   return PcRtcSetTime (Time, &mModuleGlobal);\r
 }\r
 \r
+/**\r
+  Returns the current wakeup alarm clock setting.\r
+\r
+  @param  Enabled  Indicates if the alarm is currently enabled or disabled.\r
+  @param  Pending  Indicates if the alarm signal is pending and requires acknowledgement.\r
+  @param  Time     The current alarm setting.\r
+\r
+  @retval EFI_SUCCESS           The alarm settings were returned.\r
+  @retval EFI_INVALID_PARAMETER Enabled is NULL.\r
+  @retval EFI_INVALID_PARAMETER Pending is NULL.\r
+  @retval EFI_INVALID_PARAMETER Time is NULL.\r
+  @retval EFI_DEVICE_ERROR      The wakeup time could not be retrieved due to a hardware error.\r
+  @retval EFI_UNSUPPORTED       A wakeup timer is not supported on this platform.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PcRtcEfiGetWakeupTime (\r
@@ -73,74 +83,56 @@ PcRtcEfiGetWakeupTime (
   OUT BOOLEAN     *Pending,\r
   OUT EFI_TIME    *Time\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
+{\r
+  return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);\r
+}\r
 \r
-  Enabled - GC_TODO: add argument description\r
-  Pending - GC_TODO: add argument description\r
-  Time    - GC_TODO: add argument description\r
 \r
-Returns:\r
+/**\r
+  Sets the system wakeup alarm clock time.\r
 \r
-  GC_TODO: add return values\r
+  @param  Enabled  Enable or disable the wakeup alarm.\r
+  @param  Time     If Enable is TRUE, the time to set the wakeup alarm for.\r
+                   If Enable is FALSE, then this parameter is optional, and may be NULL.\r
 \r
---*/\r
-{\r
-  return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);\r
-}\r
+  @retval EFI_SUCCESS            If Enable is TRUE, then the wakeup alarm was enabled.\r
+                                 If Enable is FALSE, then the wakeup alarm was disabled.\r
+  @retval EFI_INVALID_PARAMETER  A time field is out of range.\r
+  @retval EFI_DEVICE_ERROR       The wakeup time could not be set due to a hardware error.\r
+  @retval EFI_UNSUPPORTED        A wakeup timer is not supported on this platform.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 PcRtcEfiSetWakeupTime (\r
   IN BOOLEAN      Enabled,\r
-  OUT EFI_TIME    *Time\r
+  IN EFI_TIME    *Time       OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
+{\r
+  return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);\r
+}\r
 \r
-  Enabled - GC_TODO: add argument description\r
-  Time    - GC_TODO: add argument description\r
+/**\r
+  The user Entry Point for PcRTC module.\r
 \r
-Returns:\r
+  This is the entrhy point for PcRTC module. It installs the UEFI runtime service\r
+  including GetTime(),SetTime(),GetWakeupTime(),and SetWakeupTime().\r
 \r
-  GC_TODO: add return values\r
+  @param  ImageHandle    The firmware allocated handle for the EFI image.\r
+  @param  SystemTable    A pointer to the EFI System Table.\r
 \r
---*/\r
-{\r
-  return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);\r
-}\r
+  @retval EFI_SUCCESS    The entry point is executed successfully.\r
+  @retval Others         Some error occurs when executing this entry point.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 InitializePcRtc (\r
   IN EFI_HANDLE                            ImageHandle,\r
   IN EFI_SYSTEM_TABLE                      *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Arguments:\r
-\r
-\r
-\r
-Returns:\r
---*/\r
-// GC_TODO:    ImageHandle - add argument and description to function comment\r
-// GC_TODO:    SystemTable - add argument and description to function comment\r
 {\r
   EFI_STATUS  Status;\r
-  EFI_HANDLE  NewHandle;\r
 \r
   EfiInitializeLock (&mModuleGlobal.RtcLock, TPL_HIGH_LEVEL);\r
 \r
@@ -154,13 +146,13 @@ Returns:
   gRT->GetWakeupTime = PcRtcEfiGetWakeupTime;\r
   gRT->SetWakeupTime = PcRtcEfiSetWakeupTime;\r
 \r
-  NewHandle = NULL;\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &NewHandle,\r
+                  &mHandle,\r
                   &gEfiRealTimeClockArchProtocolGuid,\r
                   NULL,\r
                   NULL\r
                   );\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   return Status;\r
 }\r