]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Add QemuFwCfgLib library class and implementation
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2012 23:14:38 +0000 (23:14 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2012 23:14:38 +0000 (23:14 +0000)
QEMU's Firmware Configuration interface gives the firmware
access to various types of information.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13383 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/Include/Library/QemuFwCfgLib.h [new file with mode: 0644]
OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S [new file with mode: 0644]
OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm [new file with mode: 0644]
OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c [new file with mode: 0644]
OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf [new file with mode: 0644]
OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S [new file with mode: 0644]
OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm [new file with mode: 0644]
OvmfPkg/OvmfPkg.dec
OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h
new file mode 100644 (file)
index 0000000..5a3db7e
--- /dev/null
@@ -0,0 +1,157 @@
+/** @file\r
+  QEMU/KVM Firmware Configuration access\r
+\r
+  Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __FW_CFG_LIB__\r
+#define __FW_CFG_LIB__\r
+\r
+typedef enum {\r
+  QemuFwCfgItemSignature            = 0x0000,\r
+  QemuFwCfgItemInterfaceVersion     = 0x0001,\r
+  QemuFwCfgItemSystemUuid           = 0x0002,\r
+  QemuFwCfgItemRamSize              = 0x0003,\r
+  QemuFwCfgItemGraphicsEnabled      = 0x0004,\r
+  QemuFwCfgItemSmpCpuCount          = 0x0005,\r
+  QemuFwCfgItemMachineId            = 0x0006,\r
+  QemuFwCfgItemKernelAddress        = 0x0007,\r
+  QemuFwCfgItemKernelSize           = 0x0008,\r
+  QemuFwCfgItemKernelCommandLine    = 0x0009,\r
+  QemuFwCfgItemInitrdAddress        = 0x000a,\r
+  QemuFwCfgItemInitrdSize           = 0x000b,\r
+  QemuFwCfgItemBootDevice           = 0x000c,\r
+  QemuFwCfgItemNumaData             = 0x000d,\r
+  QemuFwCfgItemBootMenu             = 0x000e,\r
+  QemuFwCfgItemMaximumCpuCount      = 0x000f,\r
+  QemuFwCfgItemKernelEntry          = 0x0010,\r
+  QemuFwCfgItemKernelData           = 0x0011,\r
+  QemuFwCfgItemInitrdData           = 0x0012,\r
+  QemuFwCfgItemCommandLineAddress   = 0x0013,\r
+  QemuFwCfgItemCommandLineSize      = 0x0014,\r
+  QemuFwCfgItemCommandLineData      = 0x0015,\r
+  QemuFwCfgItemKernelSetupAddress   = 0x0016,\r
+  QemuFwCfgItemKernelSetupSize      = 0x0017,\r
+  QemuFwCfgItemKernelSetupData      = 0x0018,\r
+\r
+  QemuFwCfgItemX86AcpiTables        = 0x8000,\r
+  QemuFwCfgItemX86SmbiosTables      = 0x8001,\r
+  QemuFwCfgItemX86Irq0Override      = 0x8002,\r
+  QemuFwCfgItemX86E820Table         = 0x8003,\r
+  QemuFwCfgItemX86HpetData          = 0x8004,\r
+\r
+} FIRMWARE_CONFIG_ITEM;\r
+\r
+\r
+/**\r
+  Returns a boolean indicating if the firmware configuration interface\r
+  is available or not.\r
+\r
+  @retval    TRUE   The interface is available\r
+  @retval    FALSE  The interface is not available\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+QemuFwCfgIsAvailable (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Selects a firmware configuration item for reading.\r
+\r
+  Following this call, any data read from this item will start from\r
+  the beginning of the configuration item's data.\r
+\r
+  @param[in] QemuFwCfgItem - Firmware Configuration item to read\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+QemuFwCfgSelectItem (\r
+  IN FIRMWARE_CONFIG_ITEM   QemuFwCfgItem\r
+  );\r
+\r
+\r
+/**\r
+  Reads firmware configuration bytes into a buffer\r
+\r
+  If called multiple times, then the data read will\r
+  continue at the offset of the firmware configuration\r
+  item where the previous read ended.\r
+\r
+  @param[in] Size - Size in bytes to read\r
+  @param[in] Buffer - Buffer to store data into\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+QemuFwCfgReadBytes (\r
+  IN UINTN                  Size,\r
+  IN VOID                   *Buffer  OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  Reads a UINT8 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+QemuFwCfgRead8 (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Reads a UINT16 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+QemuFwCfgRead16 (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Reads a UINT32 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+QemuFwCfgRead32 (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Reads a UINT64 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+QemuFwCfgRead64 (\r
+  VOID\r
+  );\r
+\r
+\r
+#endif\r
+\r
diff --git a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.S
new file mode 100644 (file)
index 0000000..a32b2c6
--- /dev/null
@@ -0,0 +1,32 @@
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php.\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+#  VOID\r
+#  EFIAPI\r
+#  IoReadFifo8 (\r
+#    IN UINTN                  Port,\r
+#    IN UINTN                  Size,\r
+#    IN VOID                   *Buffer\r
+#    );\r
+#------------------------------------------------------------------------------\r
+ASM_GLOBAL ASM_PFX(IoReadFifo8)\r
+ASM_PFX(IoReadFifo8):\r
+    movw    4(%esp), %dx\r
+    movl    8(%esp), %ecx\r
+    pushl   %edi\r
+    movl    16(%esp), %edi\r
+rep insb\r
+    popl    %edi\r
+    ret\r
+\r
diff --git a/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm b/OvmfPkg/Library/QemuFwCfgLib/Ia32/IoLibExAsm.asm
new file mode 100644 (file)
index 0000000..e46af81
--- /dev/null
@@ -0,0 +1,40 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php.\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .586P\r
+    .model  flat,C\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EFIAPI\r
+;  IoReadFifo8 (\r
+;    IN UINTN                  Port,\r
+;    IN UINTN                  Size,\r
+;    IN VOID                   *Buffer\r
+;    );\r
+;------------------------------------------------------------------------------\r
+IoReadFifo8 PROC\r
+\r
+    mov     dx, [esp + 4]\r
+    mov     ecx, [esp + 8]\r
+    push    edi\r
+    mov     edx, [esp + 16]\r
+rep insb\r
+    pop     edi\r
+    ret\r
+\r
+IoReadFifo8 ENDP\r
+\r
+    END\r
+\r
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
new file mode 100644 (file)
index 0000000..b94dc67
--- /dev/null
@@ -0,0 +1,246 @@
+/** @file\r
+\r
+  Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "Uefi.h"\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/QemuFwCfgLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+\r
+STATIC BOOLEAN mQemuFwCfgSupported = FALSE;\r
+\r
+\r
+/**\r
+  Reads an 8-bit I/O port fifo into a block of memory.\r
+\r
+  Reads the 8-bit I/O fifo port specified by Port.\r
+\r
+  The port is read Count times, and the read data is\r
+  stored in the provided Buffer.\r
+\r
+  This function must guarantee that all I/O read and write operations are\r
+  serialized.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to read.\r
+  @param  Count   The number of times to read I/O port.\r
+  @param  Buffer  The buffer to store the read data into.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+IoReadFifo8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     Count,\r
+  OUT     VOID                      *Buffer\r
+  );\r
+\r
+\r
+/**\r
+  Returns a boolean indicating if the firmware configuration interface\r
+  is available or not.\r
+\r
+  @retval    TRUE   The interface is available\r
+  @retval    FALSE  The interface is not available\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+QemuFwCfgIsAvailable (\r
+  VOID\r
+  )\r
+{\r
+  return mQemuFwCfgSupported;\r
+}\r
+\r
+\r
+/**\r
+  Selects a firmware configuration item for reading.\r
+  \r
+  Following this call, any data read from this item will start from\r
+  the beginning of the configuration item's data.\r
+\r
+  @param[in] QemuFwCfgItem - Firmware Configuration item to read\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+QemuFwCfgSelectItem (\r
+  IN FIRMWARE_CONFIG_ITEM   QemuFwCfgItem\r
+  )\r
+{\r
+  DEBUG ((EFI_D_INFO, "Select Item: 0x%x\n", (UINT16)(UINTN) QemuFwCfgItem));\r
+  IoWrite16 (0x510, (UINT16)(UINTN) QemuFwCfgItem);\r
+}\r
+\r
+\r
+/**\r
+  Reads firmware configuration bytes into a buffer\r
+\r
+  @param[in] Size - Size in bytes to read\r
+  @param[in] Buffer - Buffer to store data into  (OPTIONAL if Size is 0)\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+InternalQemuFwCfgReadBytes (\r
+  IN UINTN                  Size,\r
+  IN VOID                   *Buffer  OPTIONAL\r
+  )\r
+{\r
+  IoReadFifo8 (0x511, Size, Buffer);\r
+}\r
+\r
+\r
+/**\r
+  Reads firmware configuration bytes into a buffer\r
+\r
+  If called multiple times, then the data read will\r
+  continue at the offset of the firmware configuration\r
+  item where the previous read ended.\r
+\r
+  @param[in] Size - Size in bytes to read\r
+  @param[in] Buffer - Buffer to store data into\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+QemuFwCfgReadBytes (\r
+  IN UINTN                  Size,\r
+  IN VOID                   *Buffer\r
+  )\r
+{\r
+  if (mQemuFwCfgSupported) {\r
+    InternalQemuFwCfgReadBytes (Size, Buffer);\r
+  } else {\r
+    ZeroMem (Buffer, Size);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  Reads a UINT8 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+QemuFwCfgRead8 (\r
+  VOID\r
+  )\r
+{\r
+  UINT8 Result;\r
+\r
+  QemuFwCfgReadBytes (sizeof (Result), &Result);\r
+\r
+  return Result;\r
+}\r
+\r
+\r
+/**\r
+  Reads a UINT16 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+QemuFwCfgRead16 (\r
+  VOID\r
+  )\r
+{\r
+  UINT16 Result;\r
+\r
+  QemuFwCfgReadBytes (sizeof (Result), &Result);\r
+\r
+  return Result;\r
+}\r
+\r
+\r
+/**\r
+  Reads a UINT32 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+QemuFwCfgRead32 (\r
+  VOID\r
+  )\r
+{\r
+  UINT32 Result;\r
+\r
+  QemuFwCfgReadBytes (sizeof (Result), &Result);\r
+\r
+  return Result;\r
+}\r
+\r
+\r
+/**\r
+  Reads a UINT64 firmware configuration value\r
+\r
+  @return    Value of Firmware Configuration item read\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+QemuFwCfgRead64 (\r
+  VOID\r
+  )\r
+{\r
+  UINT64 Result;\r
+\r
+  QemuFwCfgReadBytes (sizeof (Result), &Result);\r
+\r
+  return Result;\r
+}\r
+\r
+\r
+RETURN_STATUS\r
+EFIAPI\r
+QemuFwCfgInitialize (\r
+  VOID\r
+  )\r
+{\r
+  UINT32 Signature;\r
+  UINT32 Revision;\r
+\r
+  //\r
+  // Enable the access routines while probing to see if it is supported.\r
+  //\r
+  mQemuFwCfgSupported = TRUE;\r
+\r
+  QemuFwCfgSelectItem (QemuFwCfgItemSignature);\r
+  Signature = QemuFwCfgRead32 ();\r
+  DEBUG ((EFI_D_INFO, "FW CFG Signature: 0x%x\n", Signature));\r
+  QemuFwCfgSelectItem (QemuFwCfgItemInterfaceVersion);\r
+  Revision = QemuFwCfgRead32 ();\r
+  DEBUG ((EFI_D_INFO, "FW CFG Revision: 0x%x\n", Revision));\r
+  if ((Signature != SIGNATURE_32 ('Q', 'E', 'M', 'U')) ||\r
+      (Revision < 1)\r
+     ) {\r
+    DEBUG ((EFI_D_INFO, "QemuFwCfg interface not supported.\n"));\r
+    mQemuFwCfgSupported = FALSE;\r
+    return RETURN_SUCCESS;\r
+  }\r
+\r
+  DEBUG ((EFI_D_INFO, "QemuFwCfg interface is supported.\n"));\r
+  return RETURN_SUCCESS;\r
+}\r
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
new file mode 100644 (file)
index 0000000..a5446f0
--- /dev/null
@@ -0,0 +1,53 @@
+## @file\r
+#\r
+#  Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
+#\r
+#  This program and the accompanying materials\r
+#  are licensed and made available under the terms and conditions of the BSD License\r
+#  which accompanies this distribution. The full text of the license may be found at\r
+#  http://opensource.org/licenses/bsd-license.php\r
+#\r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+##\r
+\r
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = QemuFwCfgLib\r
+  FILE_GUID                      = fdd53716-31e1-4acc-9007-8bd5d877c96f\r
+  MODULE_TYPE                    = BASE\r
+  VERSION_STRING                 = 1.0\r
+  LIBRARY_CLASS                  = QemuFwCfgLib\r
+\r
+  CONSTRUCTOR                    = QemuFwCfgInitialize\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64\r
+#\r
+\r
+[Sources]\r
+  QemuFwCfgLib.c\r
+\r
+[Sources.IA32]\r
+  Ia32/IoLibExAsm.asm\r
+  Ia32/IoLibExAsm.S\r
+\r
+[Sources.X64]\r
+  X64/IoLibExAsm.asm\r
+  X64/IoLibExAsm.S\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  OvmfPkg/OvmfPkg.dec\r
+\r
+[LibraryClasses]\r
+  BaseLib\r
+  BaseMemoryLib\r
+  DebugLib\r
+  IoLib\r
+  MemoryAllocationLib\r
+  UefiBootServicesTableLib\r
+\r
diff --git a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.S
new file mode 100644 (file)
index 0000000..b1125ed
--- /dev/null
@@ -0,0 +1,30 @@
+#------------------------------------------------------------------------------\r
+#\r
+# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php.\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+#------------------------------------------------------------------------------\r
+\r
+#------------------------------------------------------------------------------\r
+#  VOID\r
+#  EFIAPI\r
+#  IoReadFifo8 (\r
+#    IN UINTN                  Port,              // rcx\r
+#    IN UINTN                  Size,              // rdx\r
+#    IN VOID                   *Buffer            // r8\r
+#    );\r
+#------------------------------------------------------------------------------\r
+ASM_GLOBAL ASM_PFX(IoReadFifo8)\r
+ASM_PFX(IoReadFifo8):\r
+    xchg    %rcx, %rdx\r
+    xchg    %r8, %rdi           # rdi: buffer address; r8: save rdi\r
+rep insb\r
+    mov     %r8, %rdi           # restore rdi\r
+    ret\r
+\r
diff --git a/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm b/OvmfPkg/Library/QemuFwCfgLib/X64/IoLibExAsm.asm
new file mode 100644 (file)
index 0000000..c60ad2c
--- /dev/null
@@ -0,0 +1,36 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution.  The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php.\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    .code\r
+\r
+;------------------------------------------------------------------------------\r
+;  VOID\r
+;  EFIAPI\r
+;  IoReadFifo8 (\r
+;    IN UINTN                  Port,              // rcx\r
+;    IN UINTN                  Size,              // rdx\r
+;    IN VOID                   *Buffer            // r8\r
+;    );\r
+;------------------------------------------------------------------------------\r
+IoReadFifo8 PROC\r
+\r
+    xchg    rcx, rdx\r
+    xchg    rdi, r8             ; rdi: buffer address; r8: save rdi\r
+rep insb\r
+    mov     rdi, r8             ; restore rdi\r
+    ret\r
+\r
+IoReadFifo8 ENDP\r
+\r
+    END\r
+\r
index dd86bd7bb68cca2fbe766ad23d107ff087901816..2a01968e1b89e4e15c1b52cff0b4ca074073f448 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform\r
 #\r
-#  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
   #\r
   NvVarsFileLib|Include/Library/NvVarsFileLib.h\r
 \r
+  ##  @libraryclass  Access QEMU's firmware configuration interface\r
+  #\r
+  QemuFwCfgLib|Include/Library/QemuFwCfgLib.h\r
+\r
   ##  @libraryclass  Serialize (and deserialize) variables\r
   #\r
   SerializeVariablesLib|Include/Library/SerializeVariablesLib.h\r
index c8522df7356b31f6a511e9267206b6456948f44d..ffd9238a7194a3ac7344614e920bda816337ae33 100644 (file)
@@ -94,6 +94,8 @@
   DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf\r
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
   SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf\r
+  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf\r
+  LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
 \r
 !ifdef $(SOURCE_DEBUG_ENABLE)\r
   PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf\r
index fe094414829a0683424ba2add82eee1d56a5abaa..fc2677f024723662298b6576980fc1f1c0bab9ad 100644 (file)
@@ -94,6 +94,7 @@
   DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf\r
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
   SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf\r
+  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf\r
   LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
 \r
 !ifdef $(SOURCE_DEBUG_ENABLE)\r
index a312ddbe59468932dce0547c96ee02001ecb304a..f2bd5a7a1fc8bf53976268415d0781d370df1ba2 100644 (file)
@@ -94,6 +94,7 @@
   DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf\r
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
   SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf\r
+  QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf\r
   LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf\r
 \r
 !ifdef $(SOURCE_DEBUG_ENABLE)\r