]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/WatchdogTimer/Dxe/WatchDogTimer.c
Add some definitions for efi event in Uefi/UefiSpec.h to follow spec.
[mirror_edk2.git] / EdkModulePkg / Universal / WatchdogTimer / Dxe / WatchDogTimer.c
index 2f8866711d61555080d6f34273bcc0a2405865c9..e38def3b05c84f8e04bc8d026dbf37778a19c2b6 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006, 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
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006, 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
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 Module Name:\r
 \r
@@ -66,15 +66,15 @@ WatchdogTimerDriverExpires (
 \r
   Routine Description:\r
 \r
-    Notification function that is called if the watchdog timer is fired.  If a \r
+    Notification function that is called if the watchdog timer is fired.  If a\r
     handler has been registered with the Watchdog Timer Architectural Protocol,\r
     then that handler is called passing in the time period that has passed that\r
-    cause the watchdog timer to fire.  Then, a call to the Runtime Service \r
+    cause the watchdog timer to fire.  Then, a call to the Runtime Service\r
     ResetSystem() is made to reset the platform.\r
-    \r
+\r
   Arguments:\r
 \r
-    Timer   - The one-shot timer event that was signaled when the watchdog timer \r
+    Timer   - The one-shot timer event that was signaled when the watchdog timer\r
               expired.\r
 \r
     Context - The context that was registered when the event Timer was created.\r
@@ -115,15 +115,15 @@ WatchdogTimerDriverRegisterHandler (
 \r
 Routine Description:\r
 \r
-  This function registers a handler that is to be invoked when the watchdog \r
-  timer fires.  By default, the EFI_WATCHDOG_TIMER protocol will call the \r
-  Runtime Service ResetSystem() when the watchdog timer fires.  If a \r
-  NotifyFunction is registered, then the NotifyFunction will be called before \r
-  the Runtime Service ResetSystem() is called.  If NotifyFunction is NULL, then \r
-  the watchdog handler is unregistered.  If a watchdog handler is registered, \r
-  then EFI_SUCCESS is returned.  If an attempt is made to register a handler \r
-  when a handler is already registered, then EFI_ALREADY_STARTED is returned.  \r
-  If an attempt is made to uninstall a handler when a handler is not installed, \r
+  This function registers a handler that is to be invoked when the watchdog\r
+  timer fires.  By default, the EFI_WATCHDOG_TIMER protocol will call the\r
+  Runtime Service ResetSystem() when the watchdog timer fires.  If a\r
+  NotifyFunction is registered, then the NotifyFunction will be called before\r
+  the Runtime Service ResetSystem() is called.  If NotifyFunction is NULL, then\r
+  the watchdog handler is unregistered.  If a watchdog handler is registered,\r
+  then EFI_SUCCESS is returned.  If an attempt is made to register a handler\r
+  when a handler is already registered, then EFI_ALREADY_STARTED is returned.\r
+  If an attempt is made to uninstall a handler when a handler is not installed,\r
   then return EFI_INVALID_PARAMETER.\r
 \r
 Arguments:\r
@@ -133,15 +133,15 @@ Arguments:
   NotifyFunction - The function to call when the watchdog timer fires.  If this\r
                    is NULL, then the handler will be unregistered.\r
 \r
-Returns: \r
+Returns:\r
 \r
-  EFI_SUCCESS           - The watchdog timer handler was registered or \r
+  EFI_SUCCESS           - The watchdog timer handler was registered or\r
                           unregistered.\r
 \r
-  EFI_ALREADY_STARTED   - NotifyFunction is not NULL, and a handler is already \r
+  EFI_ALREADY_STARTED   - NotifyFunction is not NULL, and a handler is already\r
                           registered.\r
 \r
-  EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not \r
+  EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not\r
                           previously registered.\r
 \r
 --*/\r
@@ -169,24 +169,24 @@ WatchdogTimerDriverSetTimerPeriod (
 \r
 Routine Description:\r
 \r
-  This function sets the amount of time to wait before firing the watchdog \r
-  timer to TimerPeriod 100 nS units.  If TimerPeriod is 0, then the watchdog \r
+  This function sets the amount of time to wait before firing the watchdog\r
+  timer to TimerPeriod 100 nS units.  If TimerPeriod is 0, then the watchdog\r
   timer is disabled.\r
 \r
 Arguments:\r
 \r
   This        - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
 \r
-  TimerPeriod - The amount of time in 100 nS units to wait before the watchdog \r
-                timer is fired.  If TimerPeriod is zero, then the watchdog \r
+  TimerPeriod - The amount of time in 100 nS units to wait before the watchdog\r
+                timer is fired.  If TimerPeriod is zero, then the watchdog\r
                 timer is disabled.\r
-  \r
-Returns: \r
 \r
-  EFI_SUCCESS      - The watchdog timer has been programmed to fire in Time \r
+Returns:\r
+\r
+  EFI_SUCCESS      - The watchdog timer has been programmed to fire in Time\r
                      100 nS units.\r
 \r
-  EFI_DEVICE_ERROR - A watchdog timer could not be programmed due to a device \r
+  EFI_DEVICE_ERROR - A watchdog timer could not be programmed due to a device\r
                      error.\r
 \r
 --*/\r
@@ -210,21 +210,21 @@ WatchdogTimerDriverGetTimerPeriod (
 \r
 Routine Description:\r
 \r
-  This function retrieves the amount of time the system will wait before firing \r
-  the watchdog timer.  This period is returned in TimerPeriod, and EFI_SUCCESS \r
+  This function retrieves the amount of time the system will wait before firing\r
+  the watchdog timer.  This period is returned in TimerPeriod, and EFI_SUCCESS\r
   is returned.  If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r
 \r
 Arguments:\r
 \r
   This        - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
 \r
-  TimerPeriod - A pointer to the amount of time in 100 nS units that the system \r
+  TimerPeriod - A pointer to the amount of time in 100 nS units that the system\r
                 will wait before the watchdog timer is fired.  If TimerPeriod of\r
                 zero is returned, then the watchdog timer is disabled.\r
-  \r
-Returns: \r
 \r
-  EFI_SUCCESS           - The amount of time that the system will wait before \r
+Returns:\r
+\r
+  EFI_SUCCESS           - The amount of time that the system will wait before\r
                           firing the watchdog timer was returned in TimerPeriod.\r
 \r
   EFI_INVALID_PARAMETER - TimerPeriod is NULL.\r
@@ -263,7 +263,7 @@ Returns:
   EFI_SUCCESS           - Timer Architectural Protocol created\r
 \r
   EFI_OUT_OF_RESOURCES  - Not enough resources available to initialize driver.\r
-  \r
+\r
   EFI_DEVICE_ERROR      - A device error occured attempting to initialize the driver.\r
 \r
 --*/\r
@@ -283,8 +283,8 @@ Returns:
   // Create the timer event used to implement a simple watchdog timer\r
   //\r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_SIGNAL,\r
-                  EFI_TPL_NOTIFY,\r
+                  EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
+                  TPL_NOTIFY,\r
                   WatchdogTimerDriverExpires,\r
                   NULL,\r
                   &mWatchdogTimerEvent\r