From nobody Sat Nov 2 16:37:04 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 1487691509361803.7368185084283; Tue, 21 Feb 2017 07:38:29 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2C4B282222; Tue, 21 Feb 2017 07:38:26 -0800 (PST) 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 E869E82218 for ; Tue, 21 Feb 2017 07:38:24 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 8461B81255; Tue, 21 Feb 2017 15:38:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-47.phx2.redhat.com [10.3.116.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LFcGVD015879; Tue, 21 Feb 2017 10:38:24 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 21 Feb 2017 16:38:09 +0100 Message-Id: <20170221153812.1420-4-lersek@redhat.com> In-Reply-To: <20170221153812.1420-1-lersek@redhat.com> References: <20170221153812.1420-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Feb 2017 15:38:25 +0000 (UTC) Subject: [edk2] [PATCH 3/6] OvmfPkg/QemuFwCfgLib: move types/macros from lib class to IndustryStandard 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 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" Cc: Jordan Justen Suggested-by: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Include/IndustryStandard/QemuFwCfg.h | 96 ++++++++++++++++++++ OvmfPkg/Include/Library/QemuFwCfgLib.h | 70 +------------- 2 files changed, 97 insertions(+), 69 deletions(-) diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Include= /IndustryStandard/QemuFwCfg.h new file mode 100644 index 000000000000..c7e9b5c382a5 --- /dev/null +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h @@ -0,0 +1,96 @@ +/** @file + Macro and type definitions corresponding to the QEMU fw_cfg interface. + + Refer to "docs/specs/fw_cfg.txt" in the QEMU source directory. + + Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
+ Copyright (C) 2013 - 2017, Red Hat, Inc. + + 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, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#ifndef __FW_CFG_H__ +#define __FW_CFG_H__ + +#include + +// +// The size, in bytes, of names of firmware configuration files, including= at +// least one terminating NUL byte. +// +#define QEMU_FW_CFG_FNAME_SIZE 56 + +// +// If the following bit is set in the UINT32 fw_cfg revision / feature bit= map +// -- read from key 0x0001 with the basic IO Port or MMIO method --, then = the +// DMA interface is available. +// +#define FW_CFG_F_DMA BIT1 + +// +// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding). +// +#define FW_CFG_DMA_CTL_ERROR BIT0 +#define FW_CFG_DMA_CTL_READ BIT1 +#define FW_CFG_DMA_CTL_SKIP BIT2 +#define FW_CFG_DMA_CTL_SELECT BIT3 +#define FW_CFG_DMA_CTL_WRITE BIT4 + +// +// Numerically defined keys. +// +typedef enum { + QemuFwCfgItemSignature =3D 0x0000, + QemuFwCfgItemInterfaceVersion =3D 0x0001, + QemuFwCfgItemSystemUuid =3D 0x0002, + QemuFwCfgItemRamSize =3D 0x0003, + QemuFwCfgItemGraphicsEnabled =3D 0x0004, + QemuFwCfgItemSmpCpuCount =3D 0x0005, + QemuFwCfgItemMachineId =3D 0x0006, + QemuFwCfgItemKernelAddress =3D 0x0007, + QemuFwCfgItemKernelSize =3D 0x0008, + QemuFwCfgItemKernelCommandLine =3D 0x0009, + QemuFwCfgItemInitrdAddress =3D 0x000a, + QemuFwCfgItemInitrdSize =3D 0x000b, + QemuFwCfgItemBootDevice =3D 0x000c, + QemuFwCfgItemNumaData =3D 0x000d, + QemuFwCfgItemBootMenu =3D 0x000e, + QemuFwCfgItemMaximumCpuCount =3D 0x000f, + QemuFwCfgItemKernelEntry =3D 0x0010, + QemuFwCfgItemKernelData =3D 0x0011, + QemuFwCfgItemInitrdData =3D 0x0012, + QemuFwCfgItemCommandLineAddress =3D 0x0013, + QemuFwCfgItemCommandLineSize =3D 0x0014, + QemuFwCfgItemCommandLineData =3D 0x0015, + QemuFwCfgItemKernelSetupAddress =3D 0x0016, + QemuFwCfgItemKernelSetupSize =3D 0x0017, + QemuFwCfgItemKernelSetupData =3D 0x0018, + QemuFwCfgItemFileDir =3D 0x0019, + + QemuFwCfgItemX86AcpiTables =3D 0x8000, + QemuFwCfgItemX86SmbiosTables =3D 0x8001, + QemuFwCfgItemX86Irq0Override =3D 0x8002, + QemuFwCfgItemX86E820Table =3D 0x8003, + QemuFwCfgItemX86HpetData =3D 0x8004, + +} FIRMWARE_CONFIG_ITEM; + +// +// Communication structure for the DMA access method. All fields are encod= ed in +// big endian. +// +#pragma pack (1) +typedef struct { + UINT32 Control; + UINT32 Length; + UINT64 Address; +} FW_CFG_DMA_ACCESS; +#pragma pack () + +#endif diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Libra= ry/QemuFwCfgLib.h index 41c3817470a2..2a1261327b01 100644 --- a/OvmfPkg/Include/Library/QemuFwCfgLib.h +++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h @@ -17,75 +17,7 @@ #ifndef __FW_CFG_LIB__ #define __FW_CFG_LIB__ =20 -// -// The size, in bytes, of names of firmware configuration files, including= at -// least one terminating NUL byte. -// -#define QEMU_FW_CFG_FNAME_SIZE 56 - -// -// If the following bit is set in the UINT32 fw_cfg revision / feature bit= map -// -- read from key 0x0001 with the basic IO Port or MMIO method --, then = the -// DMA interface is available. -// -#define FW_CFG_F_DMA BIT1 - -// -// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding). -// -#define FW_CFG_DMA_CTL_ERROR BIT0 -#define FW_CFG_DMA_CTL_READ BIT1 -#define FW_CFG_DMA_CTL_SKIP BIT2 -#define FW_CFG_DMA_CTL_SELECT BIT3 -#define FW_CFG_DMA_CTL_WRITE BIT4 - -typedef enum { - QemuFwCfgItemSignature =3D 0x0000, - QemuFwCfgItemInterfaceVersion =3D 0x0001, - QemuFwCfgItemSystemUuid =3D 0x0002, - QemuFwCfgItemRamSize =3D 0x0003, - QemuFwCfgItemGraphicsEnabled =3D 0x0004, - QemuFwCfgItemSmpCpuCount =3D 0x0005, - QemuFwCfgItemMachineId =3D 0x0006, - QemuFwCfgItemKernelAddress =3D 0x0007, - QemuFwCfgItemKernelSize =3D 0x0008, - QemuFwCfgItemKernelCommandLine =3D 0x0009, - QemuFwCfgItemInitrdAddress =3D 0x000a, - QemuFwCfgItemInitrdSize =3D 0x000b, - QemuFwCfgItemBootDevice =3D 0x000c, - QemuFwCfgItemNumaData =3D 0x000d, - QemuFwCfgItemBootMenu =3D 0x000e, - QemuFwCfgItemMaximumCpuCount =3D 0x000f, - QemuFwCfgItemKernelEntry =3D 0x0010, - QemuFwCfgItemKernelData =3D 0x0011, - QemuFwCfgItemInitrdData =3D 0x0012, - QemuFwCfgItemCommandLineAddress =3D 0x0013, - QemuFwCfgItemCommandLineSize =3D 0x0014, - QemuFwCfgItemCommandLineData =3D 0x0015, - QemuFwCfgItemKernelSetupAddress =3D 0x0016, - QemuFwCfgItemKernelSetupSize =3D 0x0017, - QemuFwCfgItemKernelSetupData =3D 0x0018, - QemuFwCfgItemFileDir =3D 0x0019, - - QemuFwCfgItemX86AcpiTables =3D 0x8000, - QemuFwCfgItemX86SmbiosTables =3D 0x8001, - QemuFwCfgItemX86Irq0Override =3D 0x8002, - QemuFwCfgItemX86E820Table =3D 0x8003, - QemuFwCfgItemX86HpetData =3D 0x8004, - -} FIRMWARE_CONFIG_ITEM; - -// -// Communication structure for the DMA access method. All fields are encod= ed in -// big endian. -// -#pragma pack (1) -typedef struct { - UINT32 Control; - UINT32 Length; - UINT64 Address; -} FW_CFG_DMA_ACCESS; -#pragma pack () +#include =20 /** Returns a boolean indicating if the firmware configuration interface --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel