From nobody Sat May 4 21:09:18 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490246968208816.8625661706704; Wed, 22 Mar 2017 22:29:28 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 0C02A80441; Wed, 22 Mar 2017 22:29:27 -0700 (PDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 1D55C8042C for ; Wed, 22 Mar 2017 22:29:26 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2017 22:29:25 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by orsmga002.jf.intel.com with ESMTP; 22 Mar 2017 22:29:24 -0700 X-Original-To: edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490246966; x=1521782966; h=from:to:cc:subject:date:message-id; bh=/1KtWRUmXDwuo9S4pKx3rVQPkXhT2ETFoCRpywToIkw=; b=isQ2aMHZEOqa/3zYuYETR72YPbm4hg4zXFsfW4RVSMl8vCFfBt4SzutY tXvf929jPkLqxDxrck9l46pN9XJdTA==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,208,1486454400"; d="scan'208";a="63945917" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Thu, 23 Mar 2017 13:29:22 +0800 Message-Id: <20170323052922.59684-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [edk2] [PATCH] ShellPkg/mm: Support UINT16 segment number X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It's to follow the Shell 2.2 spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jaben Carsey Reviewed-by: Jaben Carsey --- ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 18 +++++++++--------- .../UefiShellDebug1CommandsLib.uni | 22 +++++++++++-------= ---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c b/ShellPkg/Li= brary/UefiShellDebug1CommandsLib/Mm.c index 6caf448..9f97f1d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c @@ -2,7 +2,7 @@ Main file for Mm shell Debug1 function. =20 (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -58,10 +58,10 @@ CONST EFI_CPU_IO_PROTOCOL_WIDTH mShellMmCpuIoWidth[] = =3D { =20 /** Extract the PCI segment, bus, device, function, register from - from a SHELL_MM_PCI or SHELL_MM_PCIE format of address.. + from a PCI or PCIE format of address.. =20 @param[in] PciFormat Whether the address is of PCI format of PCIE = format. - @param[in] Address SHELL_MM_PCI or SHELL_MM_PCIE address. + @param[in] Address PCI or PCIE address. @param[out] Segment PCI segment number. @param[out] Bus PCI bus number. @param[out] Device PCI device number. @@ -81,10 +81,10 @@ ShellMmDecodePciAddress ( { if (PciFormat) { // - // PCI Configuration Space.The address will have the format 0x000000ss= bbddffrr, - // where ss =3D Segment, bb =3D Bus, dd =3D Device, ff =3D Function an= d rr =3D Register. + // PCI Configuration Space.The address will have the format ssssbbddff= rr, + // where ssss =3D Segment, bb =3D Bus, dd =3D Device, ff =3D Function = and rr =3D Register. // - *Segment =3D (UINT32) (RShiftU64 (Address, 32) & 0xFF); + *Segment =3D (UINT32) (RShiftU64 (Address, 32) & 0xFFFF); *Bus =3D (UINT8) (((UINT32) Address) >> 24); =20 if (Device !=3D NULL) { @@ -98,10 +98,10 @@ ShellMmDecodePciAddress ( } } else { // - // PCI Express Configuration Space.The address will have the format 0x= 0000000ssbbddffrrr, - // where ss =3D Segment, bb =3D Bus, dd =3D Device, ff =3D Function an= d rrr =3D Register. + // PCI Express Configuration Space.The address will have the format ss= ssssbbddffrrr, + // where ssss =3D Segment, bb =3D Bus, dd =3D Device, ff =3D Function = and rrr =3D Register. // - *Segment =3D (UINT32) (RShiftU64 (Address, 36) & 0xFF); + *Segment =3D (UINT32) (RShiftU64 (Address, 36) & 0xFFFF); *Bus =3D (UINT8) RShiftU64 (Address, 28); if (Device !=3D NULL) { *Device =3D (UINT8) (((UINT32) Address) >> 20); diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Com= mandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1C= ommandsLib.uni index 2d5d16f..6c02abe 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi= b.uni @@ -614,21 +614,21 @@ "MM Address [Value] [-w 1|2|4|8] [-MEM | -MMIO | -IO | -PCI | -PCIE] [-n]\= r\n" ".SH OPTIONS\r\n" " \r\n" -" Address - Specifies a starting address.\r\n" -" Value - Specifies the value to write.\r\n" +" Address - Starting address in hexadecimal format.\r\n" +" Value - The value to write in hexadecimal format.\r\n" " -MEM - Memory Address type\r\n" " -MMIO - Memory Mapped IO Address type\r\n" " -IO - IO Address type\r\n" " -PCI - PCI Configuration Space Address type:\r\n" -" Address format: 0x000000ssbbddffrr\r\n" -" ss - Segment\r\n" +" Address format: ssssbbddffrr\r\n" +" ssss - Segment\r\n" " bb - Bus\r\n" " dd - Device\r\n" " ff - Function\r\n" " rr - Register\r\n" " -PCIE - PCIE Configuration Space Address type:\r\n" -" Address format: 0x00000ssbbddffrrr\r\n" -" ss - Segment\r\n" +" Address format: ssssbbddffrrr\r\n" +" ssss - Segment\r\n" " bb - Bus\r\n" " dd - Device\r\n" " ff - Function\r\n" @@ -653,7 +653,7 @@ " follow the PCI Configuration Space Address format above. The 'PCI'\= r\n" " command can be used to determine the address for a specified device= .\r\n" " It is listed in the PCI configuration space dump information in the= \r\n" -" following format: "[EFI 0x000000ssbbddffxx]".\r\n" +" following format: "[EFI ssbbddffxx]".\r\n" " 5. If the PCIE address type is specified, the 'Address' parameter must= \r\n" " follow the PCIE Configuration Space Address format above.\r\n" " 6. In interactive mode, type a hex value to modify, 'q' or '.' to exit= .\r\n" @@ -709,8 +709,8 @@ " IO 0x0000000000000086 : 0xFF >\r\n" " IO 0x0000000000000087 : 0x00 > q\r\n" " \r\n" -" * To display PCI configuration space, ss=3D00, bb=3D00, dd=3D00, ff=3D0= 0, rr=3D00:\r\n" -" Shell> mm 0000000000 -PCI\r\n" +" * To display PCI configuration space, ss=3D0000, bb=3D00, dd=3D00, ff= =3D00, rr=3D00:\r\n" +" Shell> mm 000000000000 -PCI\r\n" " PCI 0x0000000000000000 : 0x86 >\r\n" " PCI 0x0000000000000001 : 0x80 >\r\n" " PCI 0x0000000000000002 : 0x30 >\r\n" @@ -719,8 +719,8 @@ " PCI 0x0000000000000005 : 0x00 > q\r\n" " These contents can also be displayed by 'PCI 00 00 00'.\r\n" " \r\n" -" * To display PCIE configuration space, ss=3D00, bb=3D06, dd=3D00, ff=3D= 00, rrr=3D000:\r\n" -" Shell> mm 00060000000 -PCIE\r\n" +" * To display PCIE configuration space, ss=3D0000, bb=3D06, dd=3D00, ff= =3D00, rrr=3D000:\r\n" +" Shell> mm 0000060000000 -PCIE\r\n" " PCIE 0x0000000060000000 : 0xAB >\r\n" " PCIE 0x0000000060000001 : 0x11 >\r\n" " PCIE 0x0000000060000002 : 0x61 >\r\n" --=20 2.9.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel