From patchwork Fri Dec 2 20:20:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 86358 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp429011qgi; Fri, 2 Dec 2016 12:21:12 -0800 (PST) X-Received: by 10.99.100.132 with SMTP id y126mr80835080pgb.177.1480710072012; Fri, 02 Dec 2016 12:21:12 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id o20si6365037pgn.236.2016.12.02.12.21.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2016 12:21:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BAB2C81F5E; Fri, 2 Dec 2016 12:21:11 -0800 (PST) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 C22EF81F19 for ; Fri, 2 Dec 2016 12:21:10 -0800 (PST) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3CE9AC05AA52; Fri, 2 Dec 2016 20:21:10 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-87.phx2.redhat.com [10.3.116.87]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB2KL4BF010188; Fri, 2 Dec 2016 15:21:09 -0500 From: Laszlo Ersek To: edk2-devel-01 Date: Fri, 2 Dec 2016 21:20:55 +0100 Message-Id: <20161202202059.5061-3-lersek@redhat.com> In-Reply-To: <20161202202059.5061-1-lersek@redhat.com> References: <20161202202059.5061-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 02 Dec 2016 20:21:10 +0000 (UTC) Subject: [edk2] [PATCH v2 2/6] OvmfPkg/QemuFwCfgLib: move InternalQemuFwCfgIsAvailable() to lib instances X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" InternalQemuFwCfgIsAvailable() is an API that is incorrectly exposed by the "OvmfPkg/Include/Library/QemuFwCfgLib.h" library class header; the API is meant to be used internally to library instances (if it's needed at all). In OvmfPkg, we have two lib instances (for SEC and PEI/DXE); they provide different implementations of InternalQemuFwCfgIsAvailable(), for the shared file "OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c". Move the API declaration to a new internal header called "QemuFwCfgLibInternal.h", and drop EFIAPI in the process. Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Jordan Justen --- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf | 1 + OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf | 1 + OvmfPkg/Include/Library/QemuFwCfgLib.h | 16 ---------- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h | 33 ++++++++++++++++++++ OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 2 ++ OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c | 3 +- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c | 2 +- 7 files changed, 40 insertions(+), 18 deletions(-) -- 2.9.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf index a95e1e730c2c..66ac77850915 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf @@ -32,6 +32,7 @@ [Defines] # [Sources] + QemuFwCfgLibInternal.h QemuFwCfgLib.c QemuFwCfgPeiDxe.c diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf index 03a659c9b082..c1d6a54b1a39 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf @@ -30,6 +30,7 @@ [Defines] # [Sources] + QemuFwCfgLibInternal.h QemuFwCfgLib.c QemuFwCfgSec.c diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h index baaa257d6188..7c29422fbd72 100644 --- a/OvmfPkg/Include/Library/QemuFwCfgLib.h +++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h @@ -206,22 +206,6 @@ QemuFwCfgFindFile ( /** - Returns a boolean indicating if the firmware configuration interface is - available for library-internal purposes. - - This function never changes fw_cfg state. - - @retval TRUE The interface is available internally. - @retval FALSE The interface is not available internally. -**/ -BOOLEAN -EFIAPI -InternalQemuFwCfgIsAvailable ( - VOID - ); - - -/** Determine if S3 support is explicitly enabled. @retval TRUE if S3 support is explicitly enabled. diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h new file mode 100644 index 000000000000..5b162bf98739 --- /dev/null +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibInternal.h @@ -0,0 +1,33 @@ +/** @file + Internal interfaces specific to the QemuFwCfgLib instances in OvmfPkg. + + Copyright (C) 2016, Red Hat, Inc. + + 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 + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __QEMU_FW_CFG_LIB_INTERNAL_H__ +#define __QEMU_FW_CFG_LIB_INTERNAL_H__ + +/** + Returns a boolean indicating if the firmware configuration interface is + available for library-internal purposes. + + This function never changes fw_cfg state. + + @retval TRUE The interface is available internally. + @retval FALSE The interface is not available internally. +**/ +BOOLEAN +InternalQemuFwCfgIsAvailable ( + VOID + ); + +#endif diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index 5c96d2af2532..804d5b0e42be 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -22,6 +22,8 @@ #include #include +#include "QemuFwCfgLibInternal.h" + /** Reads an 8-bit I/O port fifo into a block of memory. diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c index f693cff29e01..88d88c0edf69 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c @@ -17,6 +17,8 @@ #include #include +#include "QemuFwCfgLibInternal.h" + STATIC BOOLEAN mQemuFwCfgSupported = FALSE; @@ -83,7 +85,6 @@ QemuFwCfgInitialize ( @retval FALSE The interface is not available internally. **/ BOOLEAN -EFIAPI InternalQemuFwCfgIsAvailable ( VOID ) diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c index 88c32ce89a72..56c59ca3f01d 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c @@ -19,6 +19,7 @@ #include #include +#include "QemuFwCfgLibInternal.h" /** Returns a boolean indicating if the firmware configuration interface @@ -67,7 +68,6 @@ QemuFwCfgIsAvailable ( @retval FALSE The interface is not available internally. **/ BOOLEAN -EFIAPI InternalQemuFwCfgIsAvailable ( VOID )