From nobody Sat Nov 2 12:27:37 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 1490602150217283.50986655627753; Mon, 27 Mar 2017 01:09:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BAF2D2008474D; Mon, 27 Mar 2017 01:08:58 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 E4F0C203BEBE0 for ; Mon, 27 Mar 2017 01:08:55 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2017 01:08:55 -0700 Received: from junghyun-mobl.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.252.131.12]) by fmsmga005.fm.intel.com with ESMTP; 27 Mar 2017 01:08:55 -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=1490602135; x=1522138135; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=uwKcrLbx3wiK/mdtQkhm+YZqs1Qdoi66e5Ki0RvT0X0=; b=xPuIgShsutIX++iv3PbY+CsN89O0PXqag1tuvcsKfJXjX0sBwrSjI1vr 53NH/ns8U2OXOKp70i9qqvMKCbJYFA==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,229,1486454400"; d="scan'208";a="80948358" From: Jordan Justen To: edk2-devel@lists.01.org Date: Mon, 27 Mar 2017 01:05:38 -0700 Message-Id: <20170327080544.24748-7-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170327080544.24748-1-jordan.l.justen@intel.com> References: <20170327080544.24748-1-jordan.l.justen@intel.com> Subject: [edk2] [PATCH 06/12] OvmfPkg QemuFlash: Add DetectFlashBaseLib.inf 'NULL' library 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: Jordan Justen , Laszlo Ersek 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" This library attempts to detect QEMU flash. If writable flash is detected, then PcdOvmfFlashVariablesEnable is set to TRUE. Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen --- .../DetectFlashNullLib.c | 41 +++++++++++++++ .../DetectFlashNullLib.inf | 60 ++++++++++++++++++= ++++ 2 files changed, 101 insertions(+) create mode 100644 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullL= ib.c create mode 100644 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullL= ib.inf diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.c b/= OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.c new file mode 100644 index 0000000000..cfa6026ff2 --- /dev/null +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.c @@ -0,0 +1,41 @@ +/** @file + OVMF support for QEMU system firmware flash device + + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+ + This program and the accompanying materials are licensed and made availa= ble + 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 IMP= LIED. + +**/ + +#include +#include +#include + +#include "QemuFlash.h" + + +/** + Initializes QEMU flash memory support + + @retval !RETURN_SUCCESS Failed to set the PCD + @retval RETURN_SUCCESS The constructor was successful + +**/ +RETURN_STATUS +EFIAPI +DetectFlashConstructor ( + VOID + ) +{ + if (QemuFlashDetected ()) { + return PcdSetBoolS (PcdOvmfFlashVariablesEnable, TRUE); + } + + return RETURN_SUCCESS; +} diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf = b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf new file mode 100644 index 0000000000..1b7717af3e --- /dev/null +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/DetectFlashNullLib.inf @@ -0,0 +1,60 @@ +## @file +# This is a small library with a constructor that will set a PCD if +# writable flash is detected. +# +# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials are licensed and made avail= able +# 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. +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D DetectFlashNullLib + FILE_GUID =3D 6ec93337-513a-4188-bf57-7bb746c6e8ac + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D NULL|PEIM DXE_RUNTIME_DRIVER DXE_SMM_= DRIVER + CONSTRUCTOR =3D DetectFlashConstructor + +# +# The following information is for reference only and not required by the = build +# tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + DetectFlashNullLib.c + QemuFlash.c + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + PcdLib + +[FixedPcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareBlockSize + +[Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable + +[FeaturePcd] + gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire + +[Depex] + TRUE --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel