From patchwork Thu Mar 1 06:57:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gary guo X-Patchwork-Id: 130109 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2452289edc; Wed, 28 Feb 2018 22:58:09 -0800 (PST) X-Google-Smtp-Source: AG47ELs2oK/tEURKT8xqcAZGSyrrqC49/quTFOsUI7lvnU9ZjC03t+6au7P9W75J7oHv1lYsFOV3 X-Received: by 10.167.129.67 with SMTP id d3mr917704pfn.108.1519887488909; Wed, 28 Feb 2018 22:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519887488; cv=none; d=google.com; s=arc-20160816; b=toABQhy0GyxfTxmZZCr4MGCfOib013RA4R0Zqt8TGYsAqVXZ4Qcqos8hDAPABCNjjA 4EfLIeuwnu+EfDCGp5UetJzsm46BMKOq8zoAeVlr1FzFgGIG86qEoAASbf91q3V/pkm6 urQcGPn/Wuue7Cxf7onU+8hxunt9Lp8TgsUS+xyKAu5HUzoqd3aNe1bmmBxBoyqfUcmu hOABc51fafn+xRjJdYxDEo/VMoMgMDP8Slga18gd9eC1iV3DUPuKcsWyJtEqsqeVfU7C 2T7lHqDaKUV6UmIaYznBL+Zk0kxg3k46engJdkVC2mxDBelMVa++Dag14Ecyucu0PNoF A34g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=bd0b6YwFnPgSIxGREise3mTeaEVfY+e/9Oub5BXJZb0=; b=QUJgO3sGPoINLzLCVYprWhEGxRrU4KvimtHLSE3IKqBGO/GESoahagHdXQ3nBiMFt2 f79neL48eGbXOO31o11YCK1kcRHPEBtjpD2GnBaljUB9OCx2yonBjGVVocWUynhfrJzc NH3DOMhtnvO8+0UvbvTbz4g+puiB76AdcARpaNB4joB7f1qcelXQThO2GFBfQsQwCkyE u2j+QTQkrr0xeDOEnhtJYpa3DeITU17sN878JklVRDbuoBBwBmCD3lUhuj5rNgj2UUGz IepkqpfqgRTeb9M05f8HQ8UHJjG3m4yanjbDK/f5rFJ47XZ+JAUYbMfE/uk23cWWnqSH ftng== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Cjf5Bq+t; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id q25si2541007pfl.289.2018.02.28.22.58.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 22:58:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Cjf5Bq+t; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3395C22423854; Wed, 28 Feb 2018 22:52:00 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::241; helo=mail-pg0-x241.google.com; envelope-from=heyi.guo@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8F9692242384D for ; Wed, 28 Feb 2018 22:51:58 -0800 (PST) Received: by mail-pg0-x241.google.com with SMTP id l131so1971034pga.2 for ; Wed, 28 Feb 2018 22:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZXGYrKCbwlIxDn7EQlJvo+VP5AeLWXCh9RIif8O+dJY=; b=Cjf5Bq+ttx0Yt30LYm9anBLXnB1NnMLgCyyxZI8oG4VUOKIcOWdpzhScIKD9C+WirZ WvgNalUJse6IFXIW3Bh2N0gKXr17bFbjSlvJZh0TrNEdRzpmy9TxwOc8wF7nyJjHwE8m ZiXXHnpHn2V+Sopr9TRvlSEdu4wJL6D5I4aNI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZXGYrKCbwlIxDn7EQlJvo+VP5AeLWXCh9RIif8O+dJY=; b=YS4a+pVNi4iaSQPdwFy2bxMtAS5B8xBZxPQH6qx7U1x+KZNrOlWHfWIfraHT/FzRD+ 0wTpVEKK0WQZKDn7GR4tyJb21+klvX26qWLbCK6RiSOhfDZUGAcQtgQGE9KNLYfTlHS4 O9q0SRUH3Bt7DmI5s45SqQZwSvncBWfMFBhbpu6W07/8wT+ovdllb/MAwyu65nCuwGcE hPaVGdF/R+eIIrLNkqCtYU19wIVDi7rN9NetdIBCKr+ufxGlQrL4vuOTlSKvWxaGYf+B DsrFX+WP68IOq1kzPgXsnhIvL875x5DnCz6Rgx2bi4kn5qYBxBvuV5RW3N9lRUqRIjV7 KR1Q== X-Gm-Message-State: APf1xPDchS0FMl4aM7+P+GHgh4bE2801uleQ8CBmQbICeOe3W4AwUUb7 G5MPc9SqC5yIjaroW2cXRkWHJNnMIdo= X-Received: by 10.98.228.3 with SMTP id r3mr901702pfh.77.1519887486360; Wed, 28 Feb 2018 22:58:06 -0800 (PST) Received: from localhost.localdomain ([45.56.152.115]) by smtp.gmail.com with ESMTPSA id p63sm6489867pfk.74.2018.02.28.22.58.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Feb 2018 22:58:05 -0800 (PST) From: Heyi Guo To: edk2-devel@lists.01.org Date: Thu, 1 Mar 2018 14:57:19 +0800 Message-Id: <1519887444-75510-2-git-send-email-heyi.guo@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519887444-75510-1-git-send-email-heyi.guo@linaro.org> References: <1519887444-75510-1-git-send-email-heyi.guo@linaro.org> Subject: [edk2] [PATCH v5 1/6] CorebootPayloadPkg/PciHostBridgeLib: Init PCI aperture to 0 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Ard Biesheuvel , Heyi Guo , Laszlo Ersek , Prince Agyeman MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Use ZeroMem to initialize all fields in temporary PCI_ROOT_BRIDGE_APERTURE variables to zero. This is not mandatory but helpful for future extension: when we add new fields to PCI_ROOT_BRIDGE_APERTURE and the default value of these fields can safely be zero, this code will not suffer from an additional change. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo Cc: Maurice Ma Cc: Prince Agyeman Cc: Benjamin You Cc: Ruiyu Ni Cc: Laszlo Ersek Cc: Ard Biesheuvel --- CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Ard Biesheuvel diff --git a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c b/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c index 6d94ff72c956..c61609b79cce 100644 --- a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c +++ b/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c @@ -319,6 +319,11 @@ ScanForRootBridges ( *NumberOfRootBridges = 0; RootBridges = NULL; + ZeroMem (&Io, sizeof (Io)); + ZeroMem (&Mem, sizeof (Mem)); + ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); + ZeroMem (&PMem, sizeof (PMem)); + ZeroMem (&PMemAbove4G, sizeof (PMemAbove4G)); // // After scanning all the PCI devices on the PCI root bridge's primary bus,