]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/8254TimerDxe/Timer.c
PcAtChipsetPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / PcAtChipsetPkg / 8254TimerDxe / Timer.c
index 6cf99d5e82ee9e30e4ec3fee9084fb23ee2b951a..67e22f5da1476caf527ebdbf0f2b5638fbcea740 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Timer Architectural Protocol as defined in the DXE CIS\r
 \r
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved. <BR>\r
-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) 2005 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -69,10 +63,10 @@ SetPitCount (
 }\r
 \r
 /**\r
-  8254 Timer #0 Interrupt Handler\r
+  8254 Timer #0 Interrupt Handler.\r
 \r
-  @param InterruptType    The type of interrupt that occured\r
-  @param SystemContext    A pointer to the system context when the interrupt occured\r
+  @param InterruptType    The type of interrupt that occurred\r
+  @param SystemContext    A pointer to the system context when the interrupt occurred\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -87,9 +81,9 @@ TimerInterruptHandler (
 \r
   mLegacy8259->EndOfInterrupt (mLegacy8259, Efi8259Irq0);\r
 \r
-  if (mTimerNotifyFunction) {\r
+  if (mTimerNotifyFunction != NULL) {\r
     //\r
-    // BUGBUG : This does not handle missed timer interrupts\r
+    // @bug : This does not handle missed timer interrupts\r
     //\r
     mTimerNotifyFunction (mTimerPeriod);\r
   }\r
@@ -219,9 +213,7 @@ TimerDriverSetTimerPeriod (
     //\r
     if (TimerCount >= 65536) {\r
       TimerCount = 0;\r
-      if (TimerPeriod >= DEFAULT_TIMER_TICK_DURATION) {\r
-        TimerPeriod = DEFAULT_TIMER_TICK_DURATION;\r
-      }\r
+      TimerPeriod = MAX_TIMER_TICK_DURATION;\r
     }\r
     //\r
     // Program the 8254 timer with the new count value\r
@@ -287,7 +279,7 @@ TimerDriverGetTimerPeriod (
   @param This              The EFI_TIMER_ARCH_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS       The soft timer interrupt was generated.\r
-  @retval EFI_UNSUPPORTEDT  The platform does not support the generation of soft timer interrupts.\r
+  @retval EFI_UNSUPPORTED   The platform does not support the generation of soft timer interrupts.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -299,7 +291,7 @@ TimerDriverGenerateSoftInterrupt (
   EFI_STATUS  Status;\r
   UINT16      IRQMask;\r
   EFI_TPL     OriginalTPL;\r
-  \r
+\r
   //\r
   // If the timer interrupt is enabled, then the registered handler will be invoked.\r
   //\r
@@ -311,13 +303,13 @@ TimerDriverGenerateSoftInterrupt (
     //\r
     OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
 \r
-    if (mTimerNotifyFunction) {\r
+    if (mTimerNotifyFunction != NULL) {\r
       //\r
-      // BUGBUG : This does not handle missed timer interrupts\r
+      // @bug : This does not handle missed timer interrupts\r
       //\r
       mTimerNotifyFunction (mTimerPeriod);\r
     }\r
-   \r
+\r
     gBS->RestoreTPL (OriginalTPL);\r
   } else {\r
     return EFI_UNSUPPORTED;\r
@@ -334,7 +326,7 @@ TimerDriverGenerateSoftInterrupt (
 \r
   @retval EFI_SUCCESS            Timer Architectural Protocol created\r
   @retval EFI_OUT_OF_RESOURCES   Not enough resources available to initialize driver.\r
-  @retval EFI_DEVICE_ERROR       A device error occured attempting to initialize the driver.\r
+  @retval EFI_DEVICE_ERROR       A device error occurred attempting to initialize the driver.\r
 \r
 **/\r
 EFI_STATUS\r