From: AbnerChang <[email protected]>

QEMU RISC-V I/O lib instance. Add RISC-V I/O lib instance for QEMU FW config 
lib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Abner Chang<[email protected]>

---
 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf  |  7 ++-
 OvmfPkg/Library/QemuFwCfgLib/RiscV64/IoLibEx.c | 80 ++++++++++++++++++++++++++
 2 files changed, 86 insertions(+), 1 deletion(-)
 create mode 100644 OvmfPkg/Library/QemuFwCfgLib/RiscV64/IoLibEx.c

diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf 
b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
index a95e1e7..eaefd17 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
@@ -2,6 +2,7 @@
 #
 #  Stateful, implicitly initialized fw_cfg library.
 #
+#  Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights 
reserved.<BR>
 #  Copyright (C) 2013, Red Hat, Inc.
 #  Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
 #
@@ -28,7 +29,7 @@
 #
 # The following information is for reference only and not required by the 
build tools.
 #
-#  VALID_ARCHITECTURES           = IA32 X64
+#  VALID_ARCHITECTURES           = IA32 X64 RISCV64
 #
 
 [Sources]
@@ -40,6 +41,10 @@
 
 [Sources.X64]
   X64/IoLibExAsm.nasm
+  
+[Sources.RISCV64]
+  RiscV64/IoLibEx.c
+
 
 [Packages]
   MdePkg/MdePkg.dec
diff --git a/OvmfPkg/Library/QemuFwCfgLib/RiscV64/IoLibEx.c 
b/OvmfPkg/Library/QemuFwCfgLib/RiscV64/IoLibEx.c
new file mode 100644
index 0000000..8c09bba
--- /dev/null
+++ b/OvmfPkg/Library/QemuFwCfgLib/RiscV64/IoLibEx.c
@@ -0,0 +1,80 @@
+/** @file
+  RISC-V specific functionality for I/O read/write.
+
+  Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights 
reserved.<BR>
+
+  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.
+**/
+
+#include "Uefi.h"
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/IoLib.h>
+#include <Library/QemuFwCfgLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+/**
+  Reads an 8-bit I/O port fifo into a block of memory.
+
+  Reads the 8-bit I/O fifo port specified by Port.
+
+  The port is read Count times, and the read data is
+  stored in the provided Buffer.
+
+  This function must guarantee that all I/O read and write operations are
+  serialized.
+
+  If 8-bit I/O port operations are not supported, then ASSERT().
+
+  @param  Port    The I/O port to read.
+  @param  Count   The number of times to read I/O port.
+  @param  Buffer  The buffer to store the read data into.
+
+**/
+VOID
+EFIAPI
+IoReadFifo8 (
+  IN      UINTN                     Port,
+  IN      UINTN                     Count,
+  OUT     VOID                      *Buffer
+  )
+{
+}
+
+/**
+  Writes an 8-bit I/O port fifo from a block of memory.
+
+  Writes the 8-bit I/O fifo port specified by Port.
+
+  The port is written Count times, and the data are obtained
+  from the provided Buffer.
+
+  This function must guarantee that all I/O read and write operations are
+  serialized.
+
+  If 8-bit I/O port operations are not supported, then ASSERT().
+
+  @param  Port    The I/O port to read.
+  @param  Count   The number of times to read I/O port.
+  @param  Buffer  The buffer to store the read data into.
+
+**/
+VOID
+EFIAPI
+IoWriteFifo8 (
+  IN      UINTN                     Port,
+  IN      UINTN                     Count,
+  OUT     VOID                      *Buffer
+  )
+{
+}
+
+
-- 
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to