summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2018-04-12 21:38:37 +0800
committerLiming Gao <liming.gao@intel.com>2018-04-18 14:56:07 +0800
commit104bbee55e1f90d8c7ae64d0d319c9dbfb24e06c (patch)
treefb978cd4e65c1ab9c75295790be50547db4456bc
parent9e508f3acc10b96e957b277493ee527803b022bb (diff)
downloadedk2-104bbee55e1f90d8c7ae64d0d319c9dbfb24e06c.tar.gz
edk2-104bbee55e1f90d8c7ae64d0d319c9dbfb24e06c.tar.bz2
edk2-104bbee55e1f90d8c7ae64d0d319c9dbfb24e06c.zip
IntelFrameworkModulePkg IsaSerialDxe: Update algorithm to calculate Divisor
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>
-rw-r--r--IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
index 57ee669d14..7824d38a9c 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c
@@ -1,7 +1,7 @@
/** @file
Serial driver for standard UARTS on an ISA bus.
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1397,7 +1397,7 @@ IsaSerialSetAttributes (
((UINT32) BaudRate * 16),
&Remained
);
- if (Remained != 0) {
+ if (Remained >= ((UINT32) BaudRate * 8)) {
Divisor += 1;
}