From patchwork Thu Dec 1 17:56:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 86130 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp810489qgi; Thu, 1 Dec 2016 09:56:45 -0800 (PST) X-Received: by 10.84.217.70 with SMTP id e6mr86464547plj.161.1480615005229; Thu, 01 Dec 2016 09:56:45 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id y90si982711plh.249.2016.12.01.09.56.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 09:56:45 -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; 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 Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EE74381F37; Thu, 1 Dec 2016 09:56:44 -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 48F0581F23 for ; Thu, 1 Dec 2016 09:56:43 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 B20AF624D0; Thu, 1 Dec 2016 17:56:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-138.phx2.redhat.com [10.3.116.138]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB1HuaWq018501; Thu, 1 Dec 2016 12:56:41 -0500 From: Laszlo Ersek To: edk2-devel-01 Date: Thu, 1 Dec 2016 18:56:30 +0100 Message-Id: <20161201175633.2538-3-lersek@redhat.com> In-Reply-To: <20161201175633.2538-1-lersek@redhat.com> References: <20161201175633.2538-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 01 Dec 2016 17:56:42 +0000 (UTC) Subject: [edk2] [PATCH 2/5] 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 --- 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 )