]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/Ia32/Ia32PcRtc.c
Move RealTimeClockRuntimeDxe to PcatRealTimeClockRuntimeDxe folder of MdeModulePkg.
[mirror_edk2.git] / MdeModulePkg / Universal / PcatRealTimeClockRuntimeDxe / Ia32 / Ia32PcRtc.c
diff --git a/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/Ia32/Ia32PcRtc.c b/MdeModulePkg/Universal/PcatRealTimeClockRuntimeDxe/Ia32/Ia32PcRtc.c
new file mode 100644 (file)
index 0000000..f0b1640
--- /dev/null
@@ -0,0 +1,173 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation. All rights reserved. <BR> \r
+This software and associated documentation (if any) is furnished\r
+under a license and may only be used or copied in accordance\r
+with the terms of the license. Except as permitted by such\r
+license, no part of this software or documentation may be\r
+reproduced, stored in a retrieval system, or transmitted in any\r
+form or by any means without the express written consent of\r
+Intel Corporation.\r
+\r
+\r
+\r
+Module Name:\r
+\r
+ Ia32PcRtc.c\r
+\r
+Abstract:\r
+\r
+--*/\r
+\r
+#include "PcRtc.h"\r
+\r
+static 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
+\r
+Arguments:\r
+\r
+  Time          - GC_TODO: add argument description\r
+  Capabilities  - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  return PcRtcGetTime (Time, Capabilities, &mModuleGlobal);\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
+EFI_STATUS\r
+EFIAPI\r
+PcRtcEfiGetWakeupTime (\r
+  OUT BOOLEAN     *Enabled,\r
+  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
+  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
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  return PcRtcGetWakeupTime (Enabled, Pending, Time, &mModuleGlobal);\r
+}\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+PcRtcEfiSetWakeupTime (\r
+  IN BOOLEAN      Enabled,\r
+  OUT EFI_TIME    *Time\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  GC_TODO: Add function description\r
+\r
+Arguments:\r
+\r
+  Enabled - GC_TODO: add argument description\r
+  Time    - GC_TODO: add argument description\r
+\r
+Returns:\r
+\r
+  GC_TODO: add return values\r
+\r
+--*/\r
+{\r
+  return PcRtcSetWakeupTime (Enabled, Time, &mModuleGlobal);\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
+  Status = PcRtcInit (&mModuleGlobal);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  gRT->GetTime       = PcRtcEfiGetTime;\r
+  gRT->SetTime       = PcRtcEfiSetTime;\r
+  gRT->GetWakeupTime = PcRtcEfiGetWakeupTime;\r
+  gRT->SetWakeupTime = PcRtcEfiSetWakeupTime;\r
+\r
+  NewHandle = NULL;\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &NewHandle,\r
+                  &gEfiRealTimeClockArchProtocolGuid,\r
+                  NULL,\r
+                  NULL\r
+                  );\r
+\r
+  return Status;\r
+}\r