]> git.proxmox.com Git - mirror_edk2.git/commitdiff
modify coding style to pass ecc tool and provide comments that complied with Doxgen.
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 11 Jul 2008 06:49:09 +0000 (06:49 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 11 Jul 2008 06:49:09 +0000 (06:49 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5451 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.c
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.h

index 2c7576c1e6e179bed22c77df60b1ad8b2527d962..5f55a796589f3da4ce996deb9edd76c6be3c44e9 100644 (file)
@@ -45,38 +45,28 @@ EFI_WATCHDOG_TIMER_NOTIFY         mWatchdogTimerNotifyFunction = NULL;
 //\r
 EFI_EVENT                         mWatchdogTimerEvent;\r
 \r
-//\r
-// Worker Functions\r
-//\r
-STATIC\r
+\r
+/**\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
+  ResetSystem() is made to reset the platform.\r
+\r
+\r
+  @param  Timer     The one-shot timer event that was signaled when the watchdog timer\r
+                         expired.\r
+  @param  Context   The context that was registered when the event Timer was created.\r
+\r
+  @return None.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 WatchdogTimerDriverExpires (\r
   IN EFI_EVENT    Timer,\r
   IN VOID         *Context\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-\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
-    ResetSystem() is made to reset the platform.\r
-\r
-  Arguments:\r
-\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
-\r
-  Returns:\r
-\r
-    None.\r
-\r
---*/\r
 {\r
   REPORT_STATUS_CODE (EFI_ERROR_CODE | EFI_ERROR_MINOR, PcdGet32 (PcdStatusCodeValueEfiWatchDogTimerExpired));\r
 \r
@@ -93,16 +83,7 @@ WatchdogTimerDriverExpires (
 }\r
 \r
 \r
-EFI_STATUS\r
-EFIAPI\r
-WatchdogTimerDriverRegisterHandler (\r
-  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
-  IN EFI_WATCHDOG_TIMER_NOTIFY         NotifyFunction\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\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
@@ -114,25 +95,21 @@ Routine Description:
   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
-\r
-  This           - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
-\r
-  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
-\r
-  EFI_SUCCESS           - The watchdog timer handler was registered or\r
-                          unregistered.\r
+  @param  This                  The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  @param  NotifyFunction        The function to call when the watchdog timer fires.  If this\r
+                                is NULL, then the handler will be unregistered.\r
 \r
-  EFI_ALREADY_STARTED   - NotifyFunction is not NULL, and a handler is already\r
-                          registered.\r
+  @return EFI_SUCCESS           The watchdog timer handler was registered or unregistered.\r
+  @return EFI_ALREADY_STARTED   NotifyFunction is not NULL, and a handler is already registered.\r
+  @return EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not previously registered.\r
 \r
-  EFI_INVALID_PARAMETER - NotifyFunction is NULL, and a handler was not\r
-                          previously registered.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+WatchdogTimerDriverRegisterHandler (\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  IN EFI_WATCHDOG_TIMER_NOTIFY         NotifyFunction\r
+  )\r
 {\r
   if (NotifyFunction == NULL && mWatchdogTimerNotifyFunction == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -147,37 +124,28 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-WatchdogTimerDriverSetTimerPeriod (\r
-  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
-  IN UINT64                            TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\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
   timer is disabled.\r
 \r
-Arguments:\r
+  @param  This              The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  @param  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
-  This        - The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  @return EFI_SUCCESS       The watchdog timer has been programmed to fire in Time\r
+                            100 nS units.\r
+  @return EFI_DEVICE_ERROR  A watchdog timer could not be programmed due to a device\r
+                            error.\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
-                timer is disabled.\r
-\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
-                     error.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+WatchdogTimerDriverSetTimerPeriod (\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  IN UINT64                            TimerPeriod\r
+  )\r
 {\r
   mWatchdogTimerPeriod = TimerPeriod;\r
 \r
@@ -188,36 +156,27 @@ Returns:
                 );\r
 }\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-WatchdogTimerDriverGetTimerPeriod (\r
-  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
-  IN UINT64                            *TimerPeriod\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\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
   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
-                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
+  @param  This                    The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  @param  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
-  EFI_SUCCESS           - The amount of time that the system will wait before\r
-                          firing the watchdog timer was returned in TimerPeriod.\r
+  @return EFI_SUCCESS             The amount of time that the system will wait before\r
+                                  firing the watchdog timer was returned in TimerPeriod.\r
+  @return EFI_INVALID_PARAMETER   TimerPeriod is NULL.\r
 \r
-  EFI_INVALID_PARAMETER - TimerPeriod is NULL.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+WatchdogTimerDriverGetTimerPeriod (\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  IN UINT64                            *TimerPeriod\r
+  )\r
 {\r
   if (TimerPeriod == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -228,33 +187,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Initialize the Watchdog Timer Architectural Protocol driver.\r
+\r
+  @param  ImageHandle             ImageHandle of the loaded driver.\r
+  @param  SystemTable             Pointer to the System Table.\r
+\r
+  @return EFI_SUCCESS             Timer Architectural Protocol created.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 WatchdogTimerDriverInitialize (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the Watchdog Timer Architectural Protocol driver\r
-\r
-Arguments:\r
-\r
-  ImageHandle - ImageHandle of the loaded driver\r
-\r
-  SystemTable - Pointer to the System Table\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Timer Architectural Protocol created\r
-\r
-  EFI_OUT_OF_RESOURCES  - Not enough resources available to initialize driver.\r
-\r
-  EFI_DEVICE_ERROR      - A device error occured attempting to initialize the driver.\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
 \r
index 0117d287bbc304b82078794129ce3e45ab74a664..103ad06d9fd7444b7c316d53aaeef129a1bcda5e 100644 (file)
@@ -29,9 +29,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/WatchdogTimer.h>\r
 \r
 \r
-//\r
-// Function Prototypes\r
-//\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
+  then return EFI_INVALID_PARAMETER.\r
+\r
+  @param  This                  The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  @param  NotifyFunction        The function to call when the watchdog timer fires.  If this\r
+                                is NULL, then the handler will be unregistered.\r
+\r
+  @return EFI_SUCCESS           The watchdog timer handler was registered or unregistered.\r
+  @return EFI_ALREADY_STARTED   NotifyFunction is not NULL, and a handler is already registered.\r
+  @return EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not previously registered.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 WatchdogTimerDriverRegisterHandler (\r
@@ -39,6 +57,22 @@ WatchdogTimerDriverRegisterHandler (
   IN EFI_WATCHDOG_TIMER_NOTIFY         NotifyFunction\r
   );\r
 \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
+  timer is disabled.\r
+\r
+  @param  This              The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  @param  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
+  @return EFI_SUCCESS       The watchdog timer has been programmed to fire in Time\r
+                            100 nS units.\r
+  @return EFI_DEVICE_ERROR  A watchdog timer could not be programmed due to a device\r
+                            error.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 WatchdogTimerDriverSetTimerPeriod (\r
@@ -46,6 +80,21 @@ WatchdogTimerDriverSetTimerPeriod (
   IN UINT64                            TimerPeriod\r
   );\r
 \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
+  is returned.  If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  @param  This                    The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  @param  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
+  @return EFI_SUCCESS             The amount of time that the system will wait before\r
+                                  firing the watchdog timer was returned in TimerPeriod.\r
+  @return EFI_INVALID_PARAMETER   TimerPeriod is NULL.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 WatchdogTimerDriverGetTimerPeriod (\r
@@ -53,6 +102,15 @@ WatchdogTimerDriverGetTimerPeriod (
   IN UINT64                            *TimerPeriod\r
   );\r
 \r
+/**\r
+  Initialize the Watchdog Timer Architectural Protocol driver.\r
+\r
+  @param  ImageHandle             ImageHandle of the loaded driver.\r
+  @param  SystemTable             Pointer to the System Table.\r
+\r
+  @return EFI_SUCCESS             Timer Architectural Protocol created.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 WatchdogTimerDriverInitialize (\r