]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkModulePkg IsaSerialDxe: Update algorithm to calculate Divisor
authorLiming Gao <liming.gao@intel.com>
Thu, 12 Apr 2018 13:38:37 +0000 (21:38 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 18 Apr 2018 06:56:07 +0000 (14:56 +0800)
To align the way in MdeModulePkg SerialPortLib and PciSioSerialDxe driver,
Divisor is added by one when the reminder is more than half (16 * BaudRate).

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c

index 57ee669d140682e922f5b0d632eef765e4e411a7..7824d38a9ca8a1ddee3ead85c099296949ba3bdb 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Serial driver for standard UARTS on an ISA bus.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, 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
@@ -1397,7 +1397,7 @@ IsaSerialSetAttributes (
                        ((UINT32) BaudRate * 16),\r
                        &Remained\r
                        );\r
-  if (Remained != 0) {\r
+  if (Remained >= ((UINT32) BaudRate * 8)) {\r
     Divisor += 1;\r
   }\r
 \r