From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F2E1821F2E165 for ; Tue, 17 Apr 2018 01:15:39 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2018 01:15:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,462,1517904000"; d="scan'208";a="46781865" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.15]) by fmsmga004.fm.intel.com with ESMTP; 17 Apr 2018 01:15:37 -0700 From: Liming Gao To: edk2-devel@lists.01.org Cc: Ruiyu Ni Date: Tue, 17 Apr 2018 16:15:29 +0800 Message-Id: <1523952929-13304-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [Patch] IntelFrameworkModulePkg IsaSerialDxe: Update algorithm to calculate Divisor X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 08:15:40 -0000 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 Cc: Ruiyu Ni --- IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/Serial.c | 4 ++-- 1 file 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.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
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; } -- 2.16.2.windows.1