public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-test PATCHv3 0/5] Port SCT to RISCV64
@ 2021-03-04  3:21 Daniel Schaefer
  2021-03-04  3:21 ` [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources Daniel Schaefer
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Daniel Schaefer @ 2021-03-04  3:21 UTC (permalink / raw)
  To: devel
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang

Changes to previous series:

- Fixed the commit to remove whitespace to *only* remove whitespace. Had
  some mixup there...
- Added missing HPE copyright in one file

I was able to run SCT on my EDK2 port to RISCV64 and I don't see any
obvious failures related to this. Additionally Heinrich has tested the
first series on the U-Boot implementation of UEFI.

If you apply these patches or check out my branch [1] you can easily
review the changes with `git diff -w master`. It will hide anything
that's copied and any whitespace changes.

Cheers,
Daniel

[1] https://github.com/johnazoidberg/edk2-test/tree/riscv64

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>

Daniel Schaefer (5):
  SctPkg: Add RISCV64 support by using Aarch64 sources
  SctPkg: Adapt Aarch64 sources for Riscv64
  SctPkg: Add RISCV64 build support
  SctPkg: Unify CC_FLAGS for all GCC platforms
  SctPkg: Remove trailing whitespace

 uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h                                                                                  |  4 ++
 uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h                                                                                     |  4 +-
 uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c                                                                                       |  6 +-
 uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/SctLibPlat.h                                                                        |  7 ++-
 uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/initplat.c                                                                          |  6 +-
 uefi-sct/SctPkg/Library/SctLib/SctLib.inf                                                                                               |  6 ++
 uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S                                                                                        |  6 +-
 uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c                                                                                    |  6 +-
 uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/GoVirtual.S                                                                           | 15 +++--
 uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/VirtualMemory.c                                                                       | 22 +++----
 uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf                                                                                                |  5 ++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c                                                                                         |  8 +--
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c                                                                                          |  8 +--
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c                                                                                            |  8 +--
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h                                                                                            |  8 +--
 uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Debug.c                                                                            | 28 ++++-----
 uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Dump.c                                                                             |  8 +--
 uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Io.c                                                                               | 15 ++---
 uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf                                                                                          |  6 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c                          |  6 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c              |  7 +--
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c                                              |  6 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf                                             |  6 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestCacheFunction.c             |  6 +-
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestExceptionCallbackFunction.c | 18 +++---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/PlatformIsa.c                                 | 10 ++--
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf                                                           |  4 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf                                                             |  4 ++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLibPlat.h                                                      |  6 +-
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat.c                                                         |  6 +-
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf                                                                |  5 ++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/EntsLibPlat.h                                         |  9 +--
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/InitPlat.c                                            |  6 +-
 uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile                                                                                         |  4 ++
 uefi-sct/SctPkg/UEFI/IHV_SCT.dsc                                                                                                        | 30 +++++++---
 uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h                                                                                            | 61 +++++++++++++++++++-
 uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc                                                                                                       | 31 +++++++---
 uefi-sct/SctPkg/build.sh                                                                                                                | 11 +++-
 38 files changed, 269 insertions(+), 143 deletions(-)
 copy uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/SctLibPlat.h (79%)
 copy uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/initplat.c (92%)
 copy uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/GoVirtual.S (83%)
 copy uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/VirtualMemory.c (85%)
 copy uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Debug.c (65%)
 copy uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Dump.c (93%)
 copy uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Io.c (84%)
 copy uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestCacheFunction.c (96%)
 copy uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/DebugSupportBBTestExceptionCallbackFunction.c (92%)
 copy uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/{Aarch64 => Riscv64}/PlatformIsa.c (76%)
 copy uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/EntsLibPlat.h (83%)
 copy uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/{Aarch64 => Riscv64}/InitPlat.c (92%)

-- 
2.30.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources
  2021-03-04  3:21 [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Daniel Schaefer
@ 2021-03-04  3:21 ` Daniel Schaefer
  2021-03-30 12:25   ` Sunny Wang
  2021-03-04  3:21 ` [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64 Daniel Schaefer
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-03-04  3:21 UTC (permalink / raw)
  To: devel
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang

The sources were copied from Aarch64. Follow-up commit will adapt them
for Riscv64.

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h                                                                        |  32 +++
 uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c                                                                          |  45 ++++
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S                                                                           |  44 ++++
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c                                                                       | 182 +++++++++++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c                                                                            |  88 +++++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c                                                                             |  68 +++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c                                                                               | 134 ++++++++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h                                                                               |  48 ++++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c             | 137 ++++++++++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c | 276 ++++++++++++++++++++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c                                 |  30 +++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h                                         |  55 ++++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c                                            |  55 ++++
 13 files changed, 1194 insertions(+)

diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
new file mode 100644
index 00000000..ee7c656b
--- /dev/null
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
@@ -0,0 +1,32 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2012, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  SctLibPlat.h
+
+Abstract:
+
+  AArch64 specific defines
+
+--*/
+
+#ifndef _EFI_LIB_PLAT_H_
+#define _EFI_LIB_PLAT_H_
+
+#define MIN_ALIGNMENT_SIZE  8
+
+#endif
diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
new file mode 100644
index 00000000..a48bb2f3
--- /dev/null
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
@@ -0,0 +1,45 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2012, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  initplat.c
+
+Abstract:
+
+  Math routines for compatibility with native EFI library routines.
+
+--*/
+
+#include "SctLibInternal.h"
+
+VOID
+InitializeLibPlatform (
+    IN EFI_HANDLE           ImageHandle,
+    IN EFI_SYSTEM_TABLE     *SystemTable
+    )
+
+{
+  // No platform-specific initializations
+}
+
+UINT64
+SctReadTsc (
+  VOID
+  )
+{
+  return 0;
+}
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
new file mode 100644
index 00000000..d223b36b
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
@@ -0,0 +1,44 @@
+## @file
+#
+#  Copyright 2010 - 2012 Unified EFI, Inc.<BR>
+#  Copyright (c) 2012, ARM Ltd. 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.
+# 
+##
+#
+#
+#/*++
+#
+# Module Name:
+#
+#  GoVirtual.S
+#
+#--*/
+#start of the code section
+.text
+/* FIXME: Should alignment be different on Aarch64? */
+.align 3
+
+.global JumpToTestFunc
+.type JumpToTestFunc, %function
+
+#------------------------------------------------------------------------------
+# VOID
+# JumpToTestFunc (
+#   IN  UINTN  FuncPointer,
+#   IN  UNITN  ConfigInfo
+#   )
+#
+JumpToTestFunc:
+	mov x2, x0
+	mov x0, x1
+
+	// Jump to Virtual function
+	blr x2
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
new file mode 100644
index 00000000..397b3514
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
@@ -0,0 +1,182 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2012, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  VirtualMemory.c
+
+--*/
+
+#include "SCRTApp.h"
+
+#define VIRT_TO_PHYS_OFFSET       (0x80000000)     //2G
+
+BOOLEAN     HighAddress = FALSE;
+UINTN       PageTable   = 0;
+
+
+VOID
+ConvertRuntimeFuncPtr (
+  IN OUT UINTN      *VirtualFunc
+  )
+/*++
+
+Routine Description:
+
+  Change RuntimeTestFunc physical address to virtual address
+
+Arguments:
+
+  VirtualFunc  - On input, RuntimeTestFunc physical address.
+                 On output, RuntimeTest virtual address.
+
+Returns:
+
+  NONE
+
+--*/
+{
+	/*Note: It is presumed that on ARM v5, V6 and V7 architectures
+	 * the MMU is configured and enabled in PEI phase. As VirtualFunc
+	 * is already mapped to virtual memory, don't have to do anything here.
+	 */
+  /* FIXME: Is it the same on ARM v8? */
+}
+
+
+EFI_STATUS
+DoMemoryAllocation (
+  IN UINTN PhysicalFunc
+  )
+/*++
+
+Routine Description:
+
+  Allocate memory and create the PageTable to set up physical-virtual map.
+
+Arguments:
+
+  PhysicalFunc  - Physical address where RuntimeTestFunc locates.
+
+Returns:
+
+  EFI_STATUS
+
+--*/
+{
+  EFI_STATUS                  Status;
+  EFI_PHYSICAL_ADDRESS        AllocateMemory;
+
+  //create new page tables or use existing page tables.
+  //
+  // Allocate PageTable memory close to this Application image location in
+  // the system memory. In this way, it is safe for page table memory.
+  //
+  AllocateMemory = PhysicalFunc;
+
+  Status = tBS->AllocatePages (
+                  AllocateMaxAddress,
+                  EfiRuntimeServicesData,
+                  1,
+                  &AllocateMemory
+                  );
+
+  if (EFI_ERROR(Status)) {
+    return Status;
+  }
+
+  PageTable = (UINTN)AllocateMemory;
+  return EFI_SUCCESS;
+}
+
+
+VOID
+PrepareVirtualAddressMap (
+  IN UINTN                       MemoryMapSize,
+  IN UINTN                       DescriptorSize,
+  IN EFI_MEMORY_DESCRIPTOR       *MemoryMap,
+  IN EFI_MEMORY_DESCRIPTOR       *VirtualMemoryMap,
+  IN OUT UINTN                   *VirtualMapSize
+  )
+/*++
+
+Routine Description:
+
+  Construct VirtualAddressMap from physical address to virtual address
+
+Arguments:
+
+  MemoryMapSize     - The size, in bytes, of the MemoryMap buffer
+  DescriptorSize    - The size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR
+  MemoryMap         - A pointer to the current memory map
+  VirtualMemoryMap  - A pointer to the modified virtual memory map
+  VirtualMapSize    - A pointer to the size, in bytes, of the VirtualMemoryMap buffer
+
+Returns:
+
+  NONE
+
+--*/
+{
+  UINTN    Index;
+  *VirtualMapSize        = 0;
+
+  //
+  // Copy entries that need runtime mapping to construct virtualMemoryMap
+  //
+  for (Index = 0; Index < (MemoryMapSize / DescriptorSize); Index++) {
+    if ((MemoryMap->Attribute & EFI_MEMORY_RUNTIME) == EFI_MEMORY_RUNTIME) {
+      SctCopyMem ((VOID *) VirtualMemoryMap, (VOID *) MemoryMap, DescriptorSize);
+      VirtualMemoryMap->VirtualStart  = VirtualMemoryMap->PhysicalStart;
+      *VirtualMapSize += DescriptorSize;
+      VirtualMemoryMap = NextMemoryDescriptor (VirtualMemoryMap, DescriptorSize);
+    }
+
+    MemoryMap = NextMemoryDescriptor (MemoryMap, DescriptorSize);
+  }
+}
+
+
+
+VOID
+JumpVirtualMode(
+  IN UINTN VirtualFunc,
+  IN UINTN HandOffAddr
+  )
+/*++
+
+Routine Description:
+
+  Enable virtual addressing mode, and jump to RuntimeTestFunc in virtual address
+
+Arguments:
+
+  VirtualFunc  - RuntimeTestFunc virtual address
+  HandOffAddr  - Configuration Data Address
+
+Returns:
+
+  NONE
+
+--*/
+{
+  //
+  // Note: It is assumed that the MMU and page tables are configured on ARM platforms
+  // based on ARM v5 v6 and v7 architecture.
+  //
+  /* FIXME: Is it the same on ARM v8? */
+	JumpToTestFunc(VirtualFunc, HandOffAddr);
+}
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
new file mode 100644
index 00000000..6161d596
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
@@ -0,0 +1,88 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2012 ARM Ltd. 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.
+ 
+**/
+
+/*++
+
+Module Name:
+
+  Debug.c
+
+--*/
+
+#include "SCRTDriver.h"
+
+UINTN                 mHandOffPtr        =  0;
+EFI_PHYSICAL_ADDRESS  mIoPortSpaceAddress = 0;
+
+
+EFI_STATUS
+ConsumeHandOff (
+  IN  UINTN         HandOffAddr,
+  OUT CONF_INFO     *ConfigData
+  )
+{
+   RUNTIME_HANDOFF   *HandOffPtr;
+   //
+   // First fix the memory address of hand off data.
+   //
+   FixAddress(&HandOffAddr);
+   mHandOffPtr = HandOffAddr;
+   HandOffPtr  = (RUNTIME_HANDOFF*)mHandOffPtr;
+   *ConfigData =  HandOffPtr->ConfigureInfo;
+
+   if (!HandOffPtr->DebuggerInfo.MmioFlag){
+     //
+     // If debug port is I/O mapped, fix IoBase Address.
+     //
+     FixAddress(&HandOffPtr->DebuggerInfo.IoBase);
+     mIoPortSpaceAddress = HandOffPtr->DebuggerInfo.IoBase;
+   } else {
+     //
+     // If debug port is MMIO, fix MmioBase Address.
+     //
+     FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);
+   }
+
+   return EFI_SUCCESS;
+}
+
+
+EFI_STATUS
+Send2UART (
+  CHAR8                *String
+  )
+{
+  //
+  // TODO: On ARM platforms use platform specific functions to
+  // write the data to UART.
+  //
+  return EFI_SUCCESS;
+}
+
+
+
+EFI_STATUS
+DebugWorker (
+  IN CHAR8    *String
+  )
+{
+  EFI_STATUS    Status;
+
+  //
+  // Send text message to registered UART.
+  //
+  Status = Send2UART(String);
+  return Status;
+}
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
new file mode 100644
index 00000000..cc8d9869
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
@@ -0,0 +1,68 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2012 ARM Ltd. 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.
+ 
+**/
+
+/*++
+
+Module Name:
+
+  Dump.c
+
+--*/
+
+#include "SCRTDriver.h"
+
+VOID
+DumpRuntimeTable()
+{
+  SctAPrint ("\n================Dump Runtime Table===============\n");
+  SctAPrint ("Header Signature = 0x%x\n", VRT->Hdr.Signature);
+
+  SctAPrint ("\n================GetTime Service==============\n");
+  SctAPrint ("GetTime @ 0x%x\n", VRT->GetTime);
+
+  SctAPrint ("\n================SetTime Service==============\n");
+  SctAPrint ("SetTime @ 0x%x\n", VRT->SetTime);
+
+  SctAPrint ("\n================GetWakeupTime Service==============\n");
+  SctAPrint ("GetWakeupTime @ 0x%x\n", VRT->GetWakeupTime);
+
+  SctAPrint ("\n================SetWakeupTime Service==============\n");
+  SctAPrint ("SetWakeupTime @ 0x%x\n", VRT->SetWakeupTime);
+
+  SctAPrint ("\n================GetVariable Service==============\n");
+  SctAPrint ("GetVariable @ 0x%x\n", VRT->GetVariable);
+
+  SctAPrint ("\n================GetNextVariableName Service==============\n");
+  SctAPrint ("GetNextVariableName @ 0x%x\n", VRT->GetNextVariableName);
+
+  SctAPrint ("\n================SetVariable Service==============\n");
+  SctAPrint ("SetVariable @ 0x%x\n", VRT->SetVariable);
+
+  SctAPrint ("\n================GetNextHighMonotonicCount Service==============\n");
+  SctAPrint ("GetNextHighMonotonicCount @ 0x%x\n", VRT->GetNextHighMonotonicCount);
+
+  SctAPrint ("\n================ResetSystem Service==============\n");
+  SctAPrint ("ResetSystem @ 0x%x\n", VRT->ResetSystem);
+#if 0
+  SctAPrint ("\n================UpdateCapsule Service==============\n");
+  SctAPrint ("UpdateCapsule @ 0x%x\n", VRT->UpdateCapsule);
+
+  SctAPrint ("\n================QueryCapsuleCapabilities Service==============\n");
+  SctAPrint ("QueryCapsuleCapabilities @ 0x%x\n", VRT->QueryCapsuleCapabilities);
+
+  SctAPrint ("\n================QueryVariableInfo Service==============\n");
+  SctAPrint ("QueryVariableInfo @ 0x%x\n", VRT->QueryVariableInfo);
+#endif
+}
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
new file mode 100644
index 00000000..b925e151
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
@@ -0,0 +1,134 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2012 ARM Ltd. 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.
+ 
+**/
+
+/*++
+
+Module Name:
+
+  Io.c
+
+--*/
+
+#include "Io.h"
+
+EFI_STATUS
+EFIAPI
+CpuIoServiceWrite (
+  IN EFI_PEI_CPU_IO_PPI_WIDTH  Width,
+  IN UINT64                     UserAddress,
+  IN UINTN                      Count,
+  IN VOID                       *UserBuffer
+  )
+/*++
+
+Routine Description:
+
+  Perform the port I/O write service
+
+Arguments:
+
+  Width   - Width of the port I/O operation
+  Address - Base address of the port I/O operation
+  Count   - Count of the number of accesses to perform
+  Buffer  - Pointer to the source buffer from which to write data
+
+Returns:
+
+  EFI_SUCCESS           - The data was written.
+  EFI_INVALID_PARAMETER - Width is invalid.
+  EFI_INVALID_PARAMETER - Buffer is NULL.
+  EFI_UNSUPPORTED       - The Buffer is not aligned for the given Width.
+  EFI_UNSUPPORTED       - The address range specified by Address, Width,
+                          and Count is not valid.
+
+--*/
+{
+  return EFI_UNSUPPORTED;
+}
+
+
+EFI_STATUS
+EfiIoWrite (
+  IN     EFI_PEI_CPU_IO_PPI_WIDTH  Width,
+  IN     UINT64                     Address,
+  IN     UINTN                      Count,
+  IN OUT VOID                       *Buffer
+  )
+/*++
+
+Routine Description:
+  Perform an IO write into Buffer.
+
+Arguments:
+  Width   - Width of write transaction, and repeat operation to use
+  Address - IO address to write
+  Count   - Number of times to write the IO address.
+  Buffer  - Buffer to write data from. size is Width * Count
+
+Returns:
+  Status code
+
+--*/
+{
+  return CpuIoServiceWrite(Width, Address, Count, Buffer);
+}
+
+
+EFI_STATUS
+EfiIoRead (
+  IN     EFI_PEI_CPU_IO_PPI_WIDTH  Width,
+  IN     UINT64                     Address,
+  IN     UINTN                      Count,
+  IN OUT VOID                       *Buffer
+  )
+/*++
+
+Routine Description:
+  Perform an IO read into Buffer.
+
+Arguments:
+  Width   - Width of read transaction, and repeat operation to use
+  Address - IO address to read
+  Count   - Number of times to read the IO address.
+  Buffer  - Buffer to read data into. size is Width * Count
+
+Returns:
+  Status code
+
+--*/
+{
+  return EFI_UNSUPPORTED;
+}
+
+
+VOID
+FixAddress (
+  IN UINTN     *PhyAddress
+  )
+{
+		//
+		//Note: On ARM platforms don't have to do this as all the functions are virtually mapped.
+		//
+}
+
+// Quick port to ARM
+
+VOID
+Port80 (
+  UINT8 Number
+  )
+{
+  //EFI_SCT_DEBUG ((EFI_SCT_D_ERROR, L"Port80 %02x", Number));
+}
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
new file mode 100644
index 00000000..1e78b3e4
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
@@ -0,0 +1,48 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2012 ARM Ltd. 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.
+ 
+**/
+
+/*++
+
+Module Name:
+
+  Debug.h
+
+--*/
+
+#ifndef _IA32_IO_ACCESS_H
+#define _IA32_IO_ACCESS_H
+
+#include "SCRTDriver.h"
+
+#define IA32_MAX_IO_ADDRESS   0xFFFF
+
+#define IA32API
+
+
+typedef union {
+  UINT8  VOLATILE  *buf;
+  UINT8  VOLATILE  *ui8;
+  UINT16 VOLATILE  *ui16;
+  UINT32 VOLATILE  *ui32;
+  UINT64 VOLATILE  *ui64;
+  UINTN  VOLATILE  ui;
+} PTR;
+
+// This address is assuming a pure PC architecture. Not required?
+#define   VIRT_TO_PHYS_OFFSET            (0x80000000)     //2G
+
+
+
+#endif
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
new file mode 100644
index 00000000..96ee7b57
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
@@ -0,0 +1,137 @@
+/** @file
+
+  Copyright 2006 - 2016 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2016, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  DebugSupportBBTestCacheFunction.c
+
+Abstract:
+
+  Interface Function Test Cases of Debug Support Protocol
+
+--*/
+
+
+#include "DebugSupportBBTestMain.h"
+
+/**
+ *  Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache() Function Test.
+ *  @param This a pointer of EFI_BB_TEST_PROTOCOL.
+ *  @param ClientInterface a pointer to the interface to be tested.
+ *  @param TestLevel test "thoroughness" control.
+ *  @param SupportHandle a handle containing protocols required.
+ *  @return EFI_SUCCESS Finish the test successfully.
+ */
+//
+// TDS 3.5
+//
+EFI_STATUS
+BBTestInvalidateInstructionCacheFunctionAutoTest (
+  IN EFI_BB_TEST_PROTOCOL       *This,
+  IN VOID                       *ClientInterface,
+  IN EFI_TEST_LEVEL             TestLevel,
+  IN EFI_HANDLE                 SupportHandle
+  )
+{
+  EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib;
+  EFI_STATUS                           Status;
+  EFI_DEBUG_SUPPORT_PROTOCOL           *DebugSupport;
+  EFI_TEST_ASSERTION                   AssertionType;
+  UINT64                               Start;
+  UINT64                               Length;
+  UINTN                                MaxProcessorIndex;
+  UINTN                                ProcessorIndex;
+
+  //
+  // Get the Standard Library Interface
+  //
+  Status = gtBS->HandleProtocol (
+                   SupportHandle,
+                   &gEfiStandardTestLibraryGuid,
+                   (VOID **) &StandardLib
+                   );
+
+  if (EFI_ERROR(Status)) {
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   EFI_TEST_ASSERTION_FAILED,
+                   gTestGenericFailureGuid,
+                   L"BS.HandleProtocol - Handle standard test library",
+                   L"%a:%d:Status - %r",
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
+    return Status;
+  }
+
+  DebugSupport = (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface;
+
+  if (DebugSupport->Isa != PlatformIsa) {
+    return EFI_SUCCESS;
+  }
+
+  Status = DebugSupport->GetMaximumProcessorIndex (DebugSupport, &MaxProcessorIndex);
+  if (EFI_ERROR(Status)) {
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   EFI_TEST_ASSERTION_FAILED,
+                   gTestGenericFailureGuid,
+                   L"EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex",
+                   L"%a:%d:Status - %r",
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
+    return Status;
+  }
+
+  for (ProcessorIndex = 0; ProcessorIndex <= MaxProcessorIndex; ProcessorIndex++) {
+
+    //
+    // Assertion Point 3.5.2.1
+    // Invoke InvalidateInstructionCache and verify interface correctness.
+    //
+
+    // The Physical base of the memory range to be invalidated.
+    Start  = 0x0;
+
+    // The minimum number of bytes in the processor's instruction cache to be invalidated.
+    Length = 0x0;
+
+    Status = DebugSupport->InvalidateInstructionCache (DebugSupport, ProcessorIndex, (VOID*)&Start, Length);
+
+    if (EFI_ERROR(Status)) {
+      AssertionType = EFI_TEST_ASSERTION_FAILED;
+    } else {
+      AssertionType = EFI_TEST_ASSERTION_PASSED;
+    }
+
+    StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gDebugSupportBBTestFunctionAssertionGuid015,
+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache - Invoke this function and verify interface correctness",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+  }
+
+  return EFI_SUCCESS;
+}
+
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
new file mode 100644
index 00000000..c27c0c0c
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
@@ -0,0 +1,276 @@
+/** @file
+
+  Copyright 2006 - 2016 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2016, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  DebugSupportBBExceptionCallbackFunction.c
+
+Abstract:
+
+  Interface Function Test Cases of Debug Support Protocol
+
+--*/
+
+
+#include "DebugSupportBBTestMain.h"
+
+extern volatile  UINTN InvokedExceptionCallback;
+extern volatile  UINTN InvokedPeriodicCallback;
+
+extern EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa;
+
+void
+SoftwareBreak (
+  void
+  )
+{
+  // Not ported to ARM yet
+  ASSERT (FALSE);
+}
+
+/**
+ *  Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback() Function Test.
+ *  @param This a pointer of EFI_BB_TEST_PROTOCOL.
+ *  @param ClientInterface a pointer to the interface to be tested.
+ *  @param TestLevel test "thoroughness" control.
+ *  @param SupportHandle a handle containing protocols required.
+ *  @return EFI_SUCCESS Finish the test successfully.
+ */
+//
+// TDS 3.4
+//
+EFI_STATUS
+BBTestRegisterExceptionCallbackFunctionManualTest (
+  IN EFI_BB_TEST_PROTOCOL       *This,
+  IN VOID                       *ClientInterface,
+  IN EFI_TEST_LEVEL             TestLevel,
+  IN EFI_HANDLE                 SupportHandle
+  )
+{
+  EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib;
+  EFI_STATUS                           Status;
+  EFI_DEBUG_SUPPORT_PROTOCOL           *DebugSupport;
+  EFI_TEST_ASSERTION                   AssertionType;
+
+  DebugSupport = (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface;
+
+  if (DebugSupport->Isa != PlatformIsa) {
+    return EFI_SUCCESS;
+  }
+
+  //
+  // Get the Standard Library Interface
+  //
+  Status = gtBS->HandleProtocol (
+                   SupportHandle,
+                   &gEfiStandardTestLibraryGuid,
+                   (VOID **) &StandardLib
+                   );
+
+  if (EFI_ERROR(Status)) {
+    StandardLib->RecordAssertion (
+                   StandardLib,
+                   EFI_TEST_ASSERTION_FAILED,
+                   gTestGenericFailureGuid,
+                   L"BS.HandleProtocol - Handle standard test library",
+                   L"%a:%d:Status - %r",
+                   __FILE__,
+                   (UINTN)__LINE__,
+                   Status
+                   );
+    return Status;
+  }
+
+  //
+  // Assertion Point 3.4.2.1
+  // Invoke RegisterExceptionCallback() to install an interrupt handler function.
+  //
+  InvokedExceptionCallback = FALSE;
+  // FIXME: Is it normal that we use EXCEPT_IA32_BREAKPOINT here?
+  // Shouldn't we define proper constants for ARM exceptions in DebugSupportProtocol.h file?
+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback, EXCEPT_IA32_BREAKPOINT);
+
+  if ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED)) {
+    AssertionType = EFI_TEST_ASSERTION_PASSED;
+  } else {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  }
+
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gDebugSupportBBTestFunctionAssertionGuid009,
+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Invoke this function and verify interface correctness",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+
+  //
+  // If the callback function is already registed, return
+  //
+  if (EFI_ERROR(Status)) {
+    return EFI_SUCCESS;
+  }
+
+  //
+  // Test the callback function registed.
+  //
+
+  //
+  // Call SoftwareBreak to invoke the interrupt handler function.
+  //
+  SoftwareBreak ();
+
+  if (InvokedExceptionCallback == FALSE) {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  } else {
+    AssertionType = EFI_TEST_ASSERTION_PASSED;
+  }
+
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gDebugSupportBBTestFunctionAssertionGuid010,
+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Verify the callback function was invoked.",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+
+  //
+  // Assertion Point 3.4.2.2
+  // Invoke RegisterPeriodicCallback() to install the Periodic interrupt handler function.
+  // Verify the two callback functions can be both invoked.
+  //
+  InvokedExceptionCallback = FALSE;
+  InvokedPeriodicCallback  = FALSE;
+
+  Status = DebugSupport->RegisterPeriodicCallback (DebugSupport, 0, PeriodicCallback);
+  if (EFI_ERROR(Status)) {
+    return Status;
+  }
+
+  //
+  // Wait the PeriodicCallback to be invoked.
+  //
+  gtBS->Stall (500000);
+
+  //
+  // Call SoftwareBreak to invoke the interrupt handler function.
+  //
+  SoftwareBreak ();
+
+  if ((InvokedExceptionCallback == TRUE) && (InvokedPeriodicCallback == TRUE)) {
+    AssertionType = EFI_TEST_ASSERTION_PASSED;
+  } else {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  }
+
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gDebugSupportBBTestFunctionAssertionGuid011,
+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Verify the two callback functions can be both invoked.",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+
+  //
+  // Uninstall the Periodic callback function.
+  //
+  Status = DebugSupport->RegisterPeriodicCallback (DebugSupport, 0, NULL);
+  if (EFI_ERROR(Status)) {
+    return Status;
+  }
+
+  //
+  // Assertion Point 3.4.2.3
+  // Invoke RegisterExceptionCallback() to install another interrupt handler function.
+  //
+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback1, EXCEPT_IA32_BREAKPOINT);
+
+  if (Status != EFI_ALREADY_STARTED) {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  } else {
+    AssertionType = EFI_TEST_ASSERTION_PASSED;
+  }
+
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gDebugSupportBBTestFunctionAssertionGuid012,
+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Register another callback function.",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+
+  //
+  // Assertion Point 3.4.2.4
+  // Invoke RegisterExceptionCallback() to unstall the interrupt handler function.
+  //
+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NULL, EXCEPT_IA32_BREAKPOINT);
+
+  if (EFI_ERROR(Status)) {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  } else {
+    AssertionType = EFI_TEST_ASSERTION_PASSED;
+  }
+
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gDebugSupportBBTestFunctionAssertionGuid013,
+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Invoke this function to uninstall the interrupt handler function",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+
+  InvokedExceptionCallback = FALSE;
+
+  //
+  // Call SoftwareBreak to invoke the interrupt handler function.
+  //
+  SoftwareBreak ();
+
+  if (InvokedExceptionCallback != FALSE) {
+    AssertionType = EFI_TEST_ASSERTION_FAILED;
+  } else {
+    AssertionType = EFI_TEST_ASSERTION_PASSED;
+  }
+
+  StandardLib->RecordAssertion (
+                 StandardLib,
+                 AssertionType,
+                 gDebugSupportBBTestFunctionAssertionGuid014,
+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - Verify the callback function wasn't invoked",
+                 L"%a:%d:Status - %r",
+                 __FILE__,
+                 (UINTN)__LINE__,
+                 Status
+                 );
+
+  return EFI_SUCCESS;
+}
+
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
new file mode 100644
index 00000000..8334f601
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
@@ -0,0 +1,30 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2011 - 2012, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  PlatformIsa.c
+
+Abstract:
+
+  Platform related Isa definition.
+
+--*/
+
+#include "DebugSupportBBTestMain.h"
+
+EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaAArch64;
+
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
new file mode 100644
index 00000000..ff781aee
--- /dev/null
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
@@ -0,0 +1,55 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2010 - 2012, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  EntsLibPlat.h
+
+Abstract:
+
+  AArch64 specific defines
+
+--*/
+
+#ifndef _EFI_LIB_PLAT_H_
+#define _EFI_LIB_PLAT_H_
+
+#define MIN_ALIGNMENT_SIZE  8
+
+VOID
+EntsInitializeLibPlatform (
+  IN EFI_HANDLE           ImageHandle,
+  IN EFI_SYSTEM_TABLE     *SystemTable
+  )
+/*++
+
+Routine Description:
+
+  Initialize platform.
+
+Arguments:
+
+  ImageHandle           - The image handle.
+  SystemTable           - The system table.
+
+Returns:
+
+  None.
+
+--*/
+;
+
+#endif
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c
new file mode 100644
index 00000000..70a509a4
--- /dev/null
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c
@@ -0,0 +1,55 @@
+/** @file
+
+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
+  Copyright (c) 2010 - 2012, ARM Ltd. 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.
+ 
+**/
+/*++
+
+Module Name:
+
+  InitPlat.c
+
+Abstract:
+
+  Math routines for compatibility with native EFI library routines.
+
+--*/
+
+#include "Efi.h"
+#include "EntsLibPlat.h"
+
+VOID
+EntsInitializeLibPlatform (
+  IN EFI_HANDLE           ImageHandle,
+  IN EFI_SYSTEM_TABLE     *SystemTable
+  )
+/*++
+
+Routine Description:
+
+  Initialize platform.
+
+Arguments:
+
+  ImageHandle           - The image handle.
+  SystemTable           - The system table.
+
+Returns:
+
+  None.
+
+--*/
+{
+  //
+  // No platform-specific initializations
+  //
+}
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64
  2021-03-04  3:21 [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Daniel Schaefer
  2021-03-04  3:21 ` [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources Daniel Schaefer
@ 2021-03-04  3:21 ` Daniel Schaefer
  2021-03-04  7:50   ` Abner Chang
  2021-03-30 12:25   ` Sunny Wang
  2021-03-04  3:21 ` [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support Daniel Schaefer
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Daniel Schaefer @ 2021-03-04  3:21 UTC (permalink / raw)
  To: devel
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h                                                                        |  3 +-
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S                                                                           |  9 ++--
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c                                                                       | 16 +++----
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c                                                                            | 22 +++------
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c                                                                               |  7 +--
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h                                                                               | 48 --------------------
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c | 12 ++---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c                                 |  4 +-
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h                                         |  3 +-
 9 files changed, 32 insertions(+), 92 deletions(-)

diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
index ee7c656b..69e7f904 100644
--- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
@@ -2,6 +2,7 @@
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
   Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2021, 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
@@ -20,7 +21,7 @@ Module Name:
 
 Abstract:
 
-  AArch64 specific defines
+  RISCV64 specific defines
 
 --*/
 
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
index d223b36b..ae33da18 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
@@ -2,6 +2,7 @@
 #
 #  Copyright 2010 - 2012 Unified EFI, Inc.<BR>
 #  Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2021, Hewlett Packard Enterprise Development LP.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -23,8 +24,6 @@
 #--*/
 #start of the code section
 .text
-/* FIXME: Should alignment be different on Aarch64? */
-.align 3
 
 .global JumpToTestFunc
 .type JumpToTestFunc, %function
@@ -37,8 +36,8 @@
 #   )
 #
 JumpToTestFunc:
-	mov x2, x0
-	mov x0, x1
+	mv x2, x0
+	mv x0, x1
 
 	// Jump to Virtual function
-	blr x2
+	jalr x2
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
index 397b3514..00b59594 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
@@ -2,6 +2,7 @@
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
   Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2021, 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
@@ -22,9 +23,6 @@ Module Name:
 
 #include "SCRTApp.h"
 
-#define VIRT_TO_PHYS_OFFSET       (0x80000000)     //2G
-
-BOOLEAN     HighAddress = FALSE;
 UINTN       PageTable   = 0;
 
 
@@ -49,11 +47,10 @@ Returns:
 
 --*/
 {
-	/*Note: It is presumed that on ARM v5, V6 and V7 architectures
-	 * the MMU is configured and enabled in PEI phase. As VirtualFunc
-	 * is already mapped to virtual memory, don't have to do anything here.
+  /* Note: It is presumed that on RISCV architectures the MMU is configured and
+   * enabled in PEI phase. As VirtualFunc is already mapped to virtual memory,
+   * don't have to do anything here.
 	 */
-  /* FIXME: Is it the same on ARM v8? */
 }
 
 
@@ -174,9 +171,8 @@ Returns:
 --*/
 {
   //
-  // Note: It is assumed that the MMU and page tables are configured on ARM platforms
-  // based on ARM v5 v6 and v7 architecture.
+  // Note: It is assumed that the MMU and page tables are configured on RISC-V
+  // platforms.
   //
-  /* FIXME: Is it the same on ARM v8? */
 	JumpToTestFunc(VirtualFunc, HandOffAddr);
 }
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
index 6161d596..2991935a 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
@@ -1,7 +1,8 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2021 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
@@ -24,7 +25,6 @@ Module Name:
 #include "SCRTDriver.h"
 
 UINTN                 mHandOffPtr        =  0;
-EFI_PHYSICAL_ADDRESS  mIoPortSpaceAddress = 0;
 
 
 EFI_STATUS
@@ -42,18 +42,10 @@ ConsumeHandOff (
    HandOffPtr  = (RUNTIME_HANDOFF*)mHandOffPtr;
    *ConfigData =  HandOffPtr->ConfigureInfo;
 
-   if (!HandOffPtr->DebuggerInfo.MmioFlag){
-     //
-     // If debug port is I/O mapped, fix IoBase Address.
-     //
-     FixAddress(&HandOffPtr->DebuggerInfo.IoBase);
-     mIoPortSpaceAddress = HandOffPtr->DebuggerInfo.IoBase;
-   } else {
-     //
-     // If debug port is MMIO, fix MmioBase Address.
-     //
-     FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);
-   }
+   //
+   // Fix MmioBase Address.
+   //
+   FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);
 
    return EFI_SUCCESS;
 }
@@ -65,7 +57,7 @@ Send2UART (
   )
 {
   //
-  // TODO: On ARM platforms use platform specific functions to
+  // TODO: On RISC-V platforms use platform specific functions to
   // write the data to UART.
   //
   return EFI_SUCCESS;
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
index b925e151..255cb9a6 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
@@ -2,6 +2,7 @@
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
   Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -21,7 +22,7 @@ Module Name:
 
 --*/
 
-#include "Io.h"
+#include "SCRTDriver.h"
 
 EFI_STATUS
 EFIAPI
@@ -119,11 +120,11 @@ FixAddress (
   )
 {
 		//
-		//Note: On ARM platforms don't have to do this as all the functions are virtually mapped.
+		//Note: On RISC-V platforms don't have to do this as all the functions are virtually mapped.
 		//
 }
 
-// Quick port to ARM
+// Quick port to RISC-V. It doesn't have traditional I/O-Port 80h POST Codes
 
 VOID
 Port80 (
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
deleted file mode 100644
index 1e78b3e4..00000000
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file
-
-  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. 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.
- 
-**/
-
-/*++
-
-Module Name:
-
-  Debug.h
-
---*/
-
-#ifndef _IA32_IO_ACCESS_H
-#define _IA32_IO_ACCESS_H
-
-#include "SCRTDriver.h"
-
-#define IA32_MAX_IO_ADDRESS   0xFFFF
-
-#define IA32API
-
-
-typedef union {
-  UINT8  VOLATILE  *buf;
-  UINT8  VOLATILE  *ui8;
-  UINT16 VOLATILE  *ui16;
-  UINT32 VOLATILE  *ui32;
-  UINT64 VOLATILE  *ui64;
-  UINTN  VOLATILE  ui;
-} PTR;
-
-// This address is assuming a pure PC architecture. Not required?
-#define   VIRT_TO_PHYS_OFFSET            (0x80000000)     //2G
-
-
-
-#endif
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
index c27c0c0c..c6e72806 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
@@ -2,6 +2,7 @@
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
   Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2021, 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
@@ -37,7 +38,7 @@ SoftwareBreak (
   void
   )
 {
-  // Not ported to ARM yet
+  // Not ported to RISC-V yet
   ASSERT (FALSE);
 }
 
@@ -99,9 +100,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
   // Invoke RegisterExceptionCallback() to install an interrupt handler function.
   //
   InvokedExceptionCallback = FALSE;
-  // FIXME: Is it normal that we use EXCEPT_IA32_BREAKPOINT here?
-  // Shouldn't we define proper constants for ARM exceptions in DebugSupportProtocol.h file?
-  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback, EXCEPT_IA32_BREAKPOINT);
+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback, EXCEPT_RISCV_BREAKPOINT);
 
   if ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED)) {
     AssertionType = EFI_TEST_ASSERTION_PASSED;
@@ -205,7 +204,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
   // Assertion Point 3.4.2.3
   // Invoke RegisterExceptionCallback() to install another interrupt handler function.
   //
-  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback1, EXCEPT_IA32_BREAKPOINT);
+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback1, EXCEPT_RISCV_BREAKPOINT);
 
   if (Status != EFI_ALREADY_STARTED) {
     AssertionType = EFI_TEST_ASSERTION_FAILED;
@@ -228,7 +227,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
   // Assertion Point 3.4.2.4
   // Invoke RegisterExceptionCallback() to unstall the interrupt handler function.
   //
-  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NULL, EXCEPT_IA32_BREAKPOINT);
+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NULL, EXCEPT_RISCV_BREAKPOINT);
 
   if (EFI_ERROR(Status)) {
     AssertionType = EFI_TEST_ASSERTION_FAILED;
@@ -273,4 +272,3 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
 
   return EFI_SUCCESS;
 }
-
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
index 8334f601..8b23d91b 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
@@ -2,6 +2,7 @@
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
   Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2021, 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
@@ -26,5 +27,4 @@ Abstract:
 
 #include "DebugSupportBBTestMain.h"
 
-EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaAArch64;
-
+EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaRiscv64;
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
index ff781aee..144f812a 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
@@ -2,6 +2,7 @@
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
   Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2021 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
@@ -20,7 +21,7 @@ Module Name:
 
 Abstract:
 
-  AArch64 specific defines
+  RISCV64 specific defines
 
 --*/
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support
  2021-03-04  3:21 [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Daniel Schaefer
  2021-03-04  3:21 ` [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources Daniel Schaefer
  2021-03-04  3:21 ` [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64 Daniel Schaefer
@ 2021-03-04  3:21 ` Daniel Schaefer
  2021-03-30 12:26   ` [edk2-devel] " Sunny Wang
  2021-03-04  3:21 ` [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms Daniel Schaefer
  2021-03-04  3:21 ` [edk2-test PATCHv3 5/5] SctPkg: Remove trailing whitespace Daniel Schaefer
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-03-04  3:21 UTC (permalink / raw)
  To: devel
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h                                      |  4 ++
 uefi-sct/SctPkg/Library/SctLib/SctLib.inf                                                   |  6 ++
 uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf                                                    |  5 ++
 uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf                                              |  6 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf |  6 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf               |  4 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf                 |  4 ++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf                    |  5 ++
 uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile                                             |  4 ++
 uefi-sct/SctPkg/UEFI/IHV_SCT.dsc                                                            | 17 +++++-
 uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h                                                | 61 +++++++++++++++++++-
 uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc                                                           | 18 +++++-
 uefi-sct/SctPkg/build.sh                                                                    | 11 +++-
 13 files changed, 144 insertions(+), 7 deletions(-)

diff --git a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
index a7815580..02f0283e 100644
--- a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
+++ b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
@@ -3,6 +3,7 @@
   Copyright 2006 - 2017 Unified EFI, Inc.<BR>
   Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
   Portions copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -32,6 +33,9 @@
 #elif defined(EFIAARCH64)
   #define INSTALL_SCT_PLATFORM_SHORT_NAME   L"aarch64"
   #define INSTALL_SCT_PLATFORM_NAME         L"AARCH64"
+#elif defined(EFIRISCV64)
+  #define INSTALL_SCT_PLATFORM_SHORT_NAME   L"riscv64"
+  #define INSTALL_SCT_PLATFORM_NAME         L"RISCV64"
 #else
   #error "Architecture not supported"
 #endif
diff --git a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
index 23cb77fb..7527b203 100644
--- a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
+++ b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>
 #  Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved.<BR>
 #  Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -62,6 +63,11 @@
   Aarch64/initplat.c
   Math.c
 
+[sources.RISCV64]
+  Riscv64/SctLibPlat.h
+  Riscv64/initplat.c
+  Math.c
+
 [sources.ia32]
   ia32/SctLibPlat.h
   ia32/initplat.c
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
index 7aca6e30..8104a4ef 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -39,6 +40,10 @@
   Aarch64/GoVirtual.asm | RVCT
   Aarch64/GoVirtual.S | GCC
 
+[sources.RISCV64]
+  Riscv64/VirtualMemory.c
+  Riscv64/GoVirtual.S | GCC
+
 [sources.ia32]
   ia32/VirtualMemory.c
   ia32/GoVirtual.asm | MSFT
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
index ad0eb0f8..a3ef454e 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -69,6 +70,11 @@
   Aarch64/Dump.c
   Aarch64/Debug.c
 
+[sources.RISCV64]
+  Riscv64/Io.c
+  Riscv64/Dump.c
+  Riscv64/Debug.c
+
 [sources.common]
   Guid.h
   Guid.c
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
index 799f86fd..03bf7ccf 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2019, ARM Ltd. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -67,6 +68,11 @@
   Aarch64/DebugSupportBBTestExceptionCallbackFunction.c
   Aarch64/DebugSupportBBTestCacheFunction.c
 
+[sources.RISCV64]
+  Riscv64/PlatformIsa.c
+  Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
+  Riscv64/DebugSupportBBTestCacheFunction.c
+
 [Packages]
   SctPkg/SctPkg.dec
   SctPkg/UEFI/UEFI.dec
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf
index e8118739..95ae593e 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -55,6 +56,9 @@
 #[sources.Aarch64]
 #  IPF/TimerInterrupt.c
 
+#[sources.Riscv64]
+#  IPF/TimerInterrupt.c
+
 [Packages]
   MdePkg/MdePkg.dec
   SctPkg/SctPkg.dec
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf
index efc438c1..d3bcd5ce 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -55,6 +56,9 @@
 [sources.Aarch64]
   Aarch64/TimerInterrupt.c
 
+[sources.RISCV64]
+  Riscv64/TimerInterrupt.c
+
 [Packages]
   MdePkg/MdePkg.dec
   SctPkg/SctPkg.dec
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf
index 23f12d1a..b60e90b2 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2012 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2019, ARM Ltd. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -66,6 +67,10 @@
   Aarch64/EntsLibPlat.h
   Aarch64/InitPlat.c
 
+[sources.RISCV64]
+  Riscv64/EntsLibPlat.h
+  Riscv64/InitPlat.c
+
 [Packages]
   MdePkg/MdePkg.dec
   SctPkg/SctPkg.dec
diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile b/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile
index c235f313..c492d441 100644
--- a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile
+++ b/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile
@@ -1,6 +1,7 @@
 #
 #  Copyright 2006 - 2010 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -31,6 +32,9 @@ ifndef ARCH
   ifneq (,$(findstring arm,$(uname_m)))
     ARCH=ARM
   endif
+  ifneq (,$(findstring riscv64,$(uname_m)))
+    ARCH=RISCV64
+  endif
   ifndef ARCH
     $(info Could not detected ARCH from uname results)
     $(error ARCH is not defined!)
diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
index f9e86264..94bb5c36 100644
--- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
 #  Copyright (c) 2019,Microchip Technology Inc.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -42,7 +43,7 @@
   PLATFORM_VERSION               = 0.1
   DSC_SPECIFICATION              = 0x00010005
   OUTPUT_DIRECTORY               = Build/IhvSct
-  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64
+  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64|RISCV64
   BUILD_TARGETS                  = DEBUG|RELEASE
   SKUID_IDENTIFIER               = DEFAULT
 
@@ -109,6 +110,12 @@
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak
 
+  *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+  GCC:*_*_RISCV64_CC_FLAGS  = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+
   DEBUG_*_*_CC_FLAGS  = -DEFI_DEBUG
   RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG
 
@@ -124,6 +131,9 @@
 [Libraries.AARCH64]
   ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
 
+[Libraries.RISCV64]
+  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 [Libraries.IA32,Libraries.X64]
 
 [LibraryClasses.common]
@@ -146,6 +156,9 @@
 [LibraryClasses.AARCH64]
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
 
+[LibraryClasses.RISCV64]
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 [LibraryClasses.IA32]
 
 ###############################################################################
@@ -228,4 +241,4 @@ SctPkg/TestInfrastructure/SCT/Framework/Sct.inf
 
 [Components.IA32, Components.X64]
 SctPkg/TestCase/UEFI/IHV/Protocol/PlatformDriverOverride/BlackBoxTest/IhvPlatformDriverOverrideBBTest.inf
-SctPkg/TestCase/UEFI/IHV/Protocol/PlatformToDriverConfiguration/BlackBoxTest/IhvPlatformToDriverConfigurationBBTest.inf
\ No newline at end of file
+SctPkg/TestCase/UEFI/IHV/Protocol/PlatformToDriverConfiguration/BlackBoxTest/IhvPlatformToDriverConfigurationBBTest.inf
diff --git a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h b/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h
index 7fba87ae..1963d619 100644
--- a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h
+++ b/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h
@@ -2,6 +2,7 @@
 
   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
   Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>   
+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -607,6 +608,60 @@ typedef struct {
   UINT64  FAR;  // Fault Address Register
 } EFI_SYSTEM_CONTEXT_AARCH64;
 
+///
+/// RISC-V processor exception types.
+///
+#define EXCEPT_RISCV_INST_MISALIGNED              0
+#define EXCEPT_RISCV_INST_ACCESS_FAULT            1
+#define EXCEPT_RISCV_ILLEGAL_INST                 2
+#define EXCEPT_RISCV_BREAKPOINT                   3
+#define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED      4
+#define EXCEPT_RISCV_LOAD_ACCESS_FAULT            5
+#define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6
+#define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT       7
+#define EXCEPT_RISCV_ENV_CALL_FROM_UMODE          8
+#define EXCEPT_RISCV_ENV_CALL_FROM_SMODE          9
+#define EXCEPT_RISCV_ENV_CALL_FROM_HMODE          10
+#define EXCEPT_RISCV_ENV_CALL_FROM_MMODE          11
+
+#define EXCEPT_RISCV_SOFTWARE_INT       0x0
+#define EXCEPT_RISCV_TIMER_INT          0x1
+
+typedef struct {
+  UINT64  X0;
+  UINT64  X1;
+  UINT64  X2;
+  UINT64  X3;
+  UINT64  X4;
+  UINT64  X5;
+  UINT64  X6;
+  UINT64  X7;
+  UINT64  X8;
+  UINT64  X9;
+  UINT64  X10;
+  UINT64  X11;
+  UINT64  X12;
+  UINT64  X13;
+  UINT64  X14;
+  UINT64  X15;
+  UINT64  X16;
+  UINT64  X17;
+  UINT64  X18;
+  UINT64  X19;
+  UINT64  X20;
+  UINT64  X21;
+  UINT64  X22;
+  UINT64  X23;
+  UINT64  X24;
+  UINT64  X25;
+  UINT64  X26;
+  UINT64  X27;
+  UINT64  X28;
+  UINT64  X29;
+  UINT64  X30;
+  UINT64  X31;
+} EFI_SYSTEM_CONTEXT_RISCV64;
+
 //
 // Universal EFI_SYSTEM_CONTEXT definition
 //
@@ -618,6 +673,7 @@ union {
   EFI_SYSTEM_CONTEXT_IPF                  *SystemContextIpf;
   EFI_SYSTEM_CONTEXT_ARM                  *SystemContextArm;
   EFI_SYSTEM_CONTEXT_AARCH64              *SystemContextAArch64;
+  EFI_SYSTEM_CONTEXT_RISCV64              *SystemContextRiscV64;
 } EFI_SYSTEM_CONTEXT;
 
 //
@@ -645,6 +701,8 @@ VOID
 #define IMAGE_FILE_MACHINE_EBC             0x0EBC
 #define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED  0x01c2
 #define IMAGE_FILE_MACHINE_ARM64           0xAA64
+#define IMAGE_FILE_MACHINE_RISCV64         0x5064
+
 
 typedef
 enum {
@@ -653,7 +711,8 @@ enum {
   IsaIpf  = IMAGE_FILE_MACHINE_IA64,
   IsaEbc  = IMAGE_FILE_MACHINE_EBC,
   IsaArm  = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2
-  IsaAArch64  = IMAGE_FILE_MACHINE_ARM64       ///< 0xAA64
+  IsaAArch64  = IMAGE_FILE_MACHINE_ARM64,      ///< 0xAA64
+  IsaRiscv64  = IMAGE_FILE_MACHINE_RISCV64     ///< 0x5064
 } EFI_INSTRUCTION_SET_ARCHITECTURE;
 
 typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;;
diff --git a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
index 2e97687b..e13e40e4 100644
--- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
@@ -2,7 +2,7 @@
 #
 #  Copyright 2006 - 2017 Unified EFI, Inc.<BR>
 #  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
-#  (C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>
+#  (C) Copyright 2017 - 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -42,7 +42,7 @@
   PLATFORM_VERSION               = 0.1
   DSC_SPECIFICATION              = 0x00010005
   OUTPUT_DIRECTORY               = Build/UefiSct
-  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64
+  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64|RISCV64
   BUILD_TARGETS                  = DEBUG|RELEASE
   SKUID_IDENTIFIER               = DEFAULT
   
@@ -112,6 +112,12 @@
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak
 
+  *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+
   DEBUG_*_*_CC_FLAGS  = -DEFI_DEBUG
   RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG
 
@@ -129,6 +135,9 @@
 [Libraries.AARCH64]
   ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
 
+[Libraries.RISCV64]
+  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 [LibraryClasses.common]
   UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
@@ -157,6 +166,9 @@
 [LibraryClasses.AARCH64]
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
 
+[LibraryClasses.RISCV64]
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 ###############################################################################
 #
 # These are the components that will be built by the master makefile
@@ -483,4 +495,4 @@ SctPkg/TestCase/RIVL/Protocol/Http/Http/HttpENTSTest.inf
 SctPkg/TestCase/RIVL/Protocol/Http/HttpServiceBinding/HttpServiceBindingENTSTest.inf
 
 [Components.IA32, Components.X64]
-SctPkg/TestCase/UEFI/EFI/Generic/ExeMode/BlackBoxTest/ExeModeBBTest.inf
\ No newline at end of file
+SctPkg/TestCase/UEFI/EFI/Generic/ExeMode/BlackBoxTest/ExeModeBBTest.inf
diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh
index 37667711..f7c5e4bd 100755
--- a/uefi-sct/SctPkg/build.sh
+++ b/uefi-sct/SctPkg/build.sh
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2015 Unified EFI, Inc.<BR>
 #  Copyright (c) 2011 - 2020, ARM Ltd. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -22,6 +23,8 @@ function get_build_arch
 	        BUILD_ARCH=ARM;;
 	    aarch64*)
 	        BUILD_ARCH=AARCH64;;
+	    riscv64*)
+	        BUILD_ARCH=RISCV64;;
 	    *)
 	        BUILD_ARCH=other;;
 	esac
@@ -47,6 +50,12 @@ function set_cross_compile
 	    else
 	        TEMP_CROSS_COMPILE=arm-linux-gnueabihf-
 	    fi
+	elif [ "$SCT_TARGET_ARCH" == "RISCV64" ]; then
+	    if [ X"$CROSS_COMPILE_64" != X"" ]; then
+	        TEMP_CROSS_COMPILE="$CROSS_COMPILE_64"
+	    else
+	        TEMP_CROSS_COMPILE=riscv64-unknown-elf-
+	    fi
 	else
 	    echo "Unsupported target architecture '$SCT_TARGET_ARCH'!" >&2
 	fi
@@ -110,7 +119,7 @@ PrintUsage() {
 	#Print Help
 	#
 	echo "Usage:"
-	echo "    $0 <architecture (ARM, AARCH64, X64, etc)> \
+	echo "    $0 <architecture (ARM, AARCH64, X64, RISCV64, etc)> \
 <toolchain name (RVCT or ARMGCC or GCC*)> \
 [build type (RELEASE OR DEBUG, DEFAULT: DEBUG)]"
 }
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms
  2021-03-04  3:21 [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Daniel Schaefer
                   ` (2 preceding siblings ...)
  2021-03-04  3:21 ` [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support Daniel Schaefer
@ 2021-03-04  3:21 ` Daniel Schaefer
  2021-03-04  7:50   ` Abner Chang
  2021-03-30 12:26   ` [edk2-devel] " Sunny Wang
  2021-03-04  3:21 ` [edk2-test PATCHv3 5/5] SctPkg: Remove trailing whitespace Daniel Schaefer
  4 siblings, 2 replies; 13+ messages in thread
From: Daniel Schaefer @ 2021-03-04  3:21 UTC (permalink / raw)
  To: devel
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/UEFI/IHV_SCT.dsc  | 15 ++++++++-------
 uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc | 15 ++++++++-------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
index 94bb5c36..91116ca7 100644
--- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
@@ -69,15 +69,16 @@
   MSFT:*_*_X64_APP_FLAGS   = /D EFIX64
   MSFT:*_*_X64_PP_FLAGS    = /D EFIX64
 
-#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
-   GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error 
+   GCC:*_*_*_CC_FLAGS        = -ffreestanding -nostdinc -nostdlib -Wno-error
+#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
+   GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_VFRPP_FLAGS  = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_APP_FLAGS    = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_PP_FLAGS     = -D EFI32 $(GCC_VER_MACRO)
 
-#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
+#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
 
-   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error 
+   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_VFRPP_FLAGS  = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_APP_FLAGS    = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_PP_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
@@ -85,7 +86,7 @@
 
   #TODO: OM - fixme RVCT:*_*_ARM_CC_FLAGS = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_CC_FLAGS = -D EFIARM
-  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-protector -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=implicit-function-declaration -Wno-error
+  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-protector
   *_*_ARM_VFRPP_FLAGS   = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_APP_FLAGS     = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_PP_FLAGS      = -D EFIARM $(GCC_VER_MACRO)
@@ -104,14 +105,14 @@
   RVCT:*_*_ARM_CC_FLAGS    = --diag_remark=167 --diag_suppress=167,1295,188,550,1,68,111,177
 
   *_*_AARCH64_CC_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
-  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_VFRPP_FLAGS      = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_APP_FLAGS        = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak
 
   *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
-  GCC:*_*_RISCV64_CC_FLAGS  = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
diff --git a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
index e13e40e4..3bb57d26 100644
--- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
@@ -72,14 +72,15 @@
   MSFT:*_*_X64_APP_FLAGS   = /D EFIX64
   MSFT:*_*_X64_PP_FLAGS    = /D EFIX64
 
-#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
-  GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error 
+   GCC:*_*_*_CC_FLAGS        = -ffreestanding -nostdinc -nostdlib -Wno-error
+#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
+  GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_VFRPP_FLAGS  = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_APP_FLAGS    = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_PP_FLAGS     = -D EFI32 $(GCC_VER_MACRO)
 
-#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
-   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error 
+#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
+   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_VFRPP_FLAGS  = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_APP_FLAGS    = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_PP_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
@@ -87,7 +88,7 @@
 
   #TODO: OM - fixme RVCT:*_*_ARM_CC_FLAGS = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_CC_FLAGS = -D EFIARM
-  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-protector -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=implicit-function-declaration -Wno-error
+  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-protector
   *_*_ARM_VFRPP_FLAGS   = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_APP_FLAGS     = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_PP_FLAGS      = -D EFIARM $(GCC_VER_MACRO)
@@ -106,14 +107,14 @@
   RVCT:*_*_ARM_CC_FLAGS    = --diag_remark=167 --diag_suppress=167,1295,188,550,1,68,111,177
 
   *_*_AARCH64_CC_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
-  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_VFRPP_FLAGS      = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_APP_FLAGS        = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak
 
   *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
-  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [edk2-test PATCHv3 5/5] SctPkg: Remove trailing whitespace
  2021-03-04  3:21 [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Daniel Schaefer
                   ` (3 preceding siblings ...)
  2021-03-04  3:21 ` [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms Daniel Schaefer
@ 2021-03-04  3:21 ` Daniel Schaefer
  2021-03-04  7:51   ` Abner Chang
  4 siblings, 1 reply; 13+ messages in thread
From: Daniel Schaefer @ 2021-03-04  3:21 UTC (permalink / raw)
  To: devel
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Reviewed-by: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h                                                                        | 4 ++--
 uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c                                                                          | 6 +++---
 uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h                                                                        | 4 ++--
 uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c                                                                          | 6 +++---
 uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S                                                                           | 6 +++---
 uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c                                                                       | 6 +++---
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S                                                                           | 6 +++---
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c                                                                       | 6 +++---
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c                                                                            | 8 ++++----
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c                                                                             | 8 ++++----
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c                                                                               | 8 ++++----
 uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h                                                                               | 8 ++++----
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c                                                                            | 6 +++---
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c                                                                             | 8 ++++----
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c                                                                               | 8 ++++----
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c             | 6 +++---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c | 7 +++----
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c                                 | 6 +++---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c             | 6 +++---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c | 6 +++---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c                                 | 6 +++---
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLibPlat.h                                         | 6 +++---
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat.c                                            | 6 +++---
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h                                         | 6 +++---
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c                                            | 6 +++---
 25 files changed, 79 insertions(+), 80 deletions(-)

diff --git a/uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h b/uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h
index ee7c656b..b7832e18 100644
--- a/uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h
+++ b/uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h
@@ -5,12 +5,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c b/uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c
index a48bb2f3..1c247c91 100644
--- a/uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c
+++ b/uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c
@@ -5,12 +5,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
index 69e7f904..5d527ac2 100644
--- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
@@ -6,12 +6,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
index a48bb2f3..1c247c91 100644
--- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
@@ -5,12 +5,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S b/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S
index d223b36b..a2d7ed71 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S
@@ -5,12 +5,12 @@
 #
 #  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 
+#  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.
-# 
+#
 ##
 #
 #
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c b/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c
index 397b3514..3edf277e 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c
@@ -5,12 +5,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
index ae33da18..6b727d6e 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
@@ -6,12 +6,12 @@
 #
 #  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 
+#  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.
-# 
+#
 ##
 #
 #
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
index 00b59594..c85ea27b 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
@@ -6,12 +6,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c
index 6161d596..122e3531 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c
@@ -1,16 +1,16 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  Copyright (c) 2011 - 2012 ARM Ltd. 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 
+  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.
- 
+
 **/
 
 /*++
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c
index cc8d9869..cb9771b1 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c
@@ -1,16 +1,16 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  Copyright (c) 2011 - 2012 ARM Ltd. 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 
+  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.
- 
+
 **/
 
 /*++
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c
index b925e151..e215d723 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c
@@ -1,16 +1,16 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  Copyright (c) 2011 - 2012 ARM Ltd. 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 
+  which accompanies this distribution.  The full text of the license may be found a
   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.
- 
+
 **/
 
 /*++
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h
index 1e78b3e4..10ab372a 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h
@@ -1,16 +1,16 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  Copyright (c) 2011 - 2012 ARM Ltd. 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 
+  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.
- 
+
 **/
 
 /*++
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
index 2991935a..b3e13f63 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
@@ -6,12 +6,12 @@
 
   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 
+  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.
- 
+
 **/
 
 /*++
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
index cc8d9869..cb9771b1 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
@@ -1,16 +1,16 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  Copyright (c) 2011 - 2012 ARM Ltd. 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 
+  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.
- 
+
 **/
 
 /*++
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
index 255cb9a6..13cd0bc6 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
@@ -1,17 +1,17 @@
 /** @file
 
   Copyright 2006 - 2012 Unified EFI, Inc.<BR>
-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>   
+  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP<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 
+  which accompanies this distribution.  The full text of the license may be found a
   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.
- 
+
 **/
 
 /*++
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c
index 96ee7b57..6b54a25f 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c
@@ -5,12 +5,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c
index c27c0c0c..ab09a19a 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c
@@ -5,12 +5,12 @@
 
   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 
+  which accompanies this distribution.  The full text of the license may be found a
   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.
- 
+
 **/
 /*++
 
@@ -273,4 +273,3 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
 
   return EFI_SUCCESS;
 }
-
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c
index 8334f601..3178fb60 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c
@@ -5,12 +5,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
index 96ee7b57..6b54a25f 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
@@ -5,12 +5,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
index c6e72806..6338008e 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
@@ -6,12 +6,12 @@
 
   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 
+  which accompanies this distribution.  The full text of the license may be found a
   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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
index 8b23d91b..d91f520e 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
@@ -6,12 +6,12 @@
 
   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 
+  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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLibPlat.h
index ff781aee..91839324 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLibPlat.h
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLibPlat.h
@@ -5,12 +5,12 @@
 
   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 
+  which accompanies this distribution.  The full text of the license may be found a
   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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat.c
index 70a509a4..b255e811 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat.c
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat.c
@@ -5,12 +5,12 @@
 
   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 
+  which accompanies this distribution.  The full text of the license may be found a
   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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
index 144f812a..1dcd458e 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
@@ -6,12 +6,12 @@
 
   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 
+  which accompanies this distribution.  The full text of the license may be found a 
   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.
- 
+
 **/
 /*++
 
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c
index 70a509a4..b255e811 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c
@@ -5,12 +5,12 @@
 
   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 
+  which accompanies this distribution.  The full text of the license may be found a
   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.
- 
+
 **/
 /*++
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64
  2021-03-04  3:21 ` [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64 Daniel Schaefer
@ 2021-03-04  7:50   ` Abner Chang
  2021-03-30 12:25   ` Sunny Wang
  1 sibling, 0 replies; 13+ messages in thread
From: Abner Chang @ 2021-03-04  7:50 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt

Reviewed-by: Abner Chang <abner.chang@hpe.com>

> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Thursday, March 4, 2021 11:21 AM
> To: devel@edk2.groups.io
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao
> <gaojie@byosoft.com.cn>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Eric Jin <eric.jin@intel.com>; Arvin Chen
> <arvinx.chen@intel.com>; Leif Lindholm <leif@nuviainc.com>; Heinrich
> Schuchardt <xypron.glpk@gmx.de>; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> Subject: [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042
> 
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
> Cc: Barton Gao <gaojie@byosoft.com.cn>
> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Cc: Eric Jin <eric.jin@intel.com>
> Cc: Arvin Chen <arvinx.chen@intel.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Abner Chang <abner.chang@hpe.com>
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> |  3 +-
>  uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> |  9 ++--
>  uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> | 16 +++----
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> | 22 +++------
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> |  7 +--
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
> | 48 --------------------
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c | 12 ++---
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c                                 |  4 +-
>  uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h                                         |  3 +-
>  9 files changed, 32 insertions(+), 92 deletions(-)
> 
> diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-
> sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> index ee7c656b..69e7f904 100644
> --- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> @@ -2,6 +2,7 @@
>     Copyright 2006 - 2012 Unified EFI, Inc.<BR>   Copyright (c) 2011 - 2012, ARM
> Ltd. All rights reserved.<BR>+  Copyright (c) 2021, 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@@ -20,7 +21,7 @@ Module Name:
>   Abstract: -  AArch64 specific defines+  RISCV64 specific defines  --*/ diff --git
> a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-
> sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> index d223b36b..ae33da18 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> @@ -2,6 +2,7 @@
>  # #  Copyright 2010 - 2012 Unified EFI, Inc.<BR> #  Copyright (c) 2012, ARM
> Ltd. All rights reserved.<BR>+#  Copyright (c) 2021, Hewlett Packard
> Enterprise Development LP.<BR> # #  This program and the accompanying
> materials #  are licensed and made available under the terms and conditions
> of the BSD License@@ -23,8 +24,6 @@  #--*/ #start of the code section .text-
> /* FIXME: Should alignment be different on Aarch64? */-.align 3  .global
> JumpToTestFunc .type JumpToTestFunc, %function@@ -37,8 +36,8 @@
>  #   ) # JumpToTestFunc:-	mov x2, x0-	mov x0, x1+	mv x2, x0+
> 	mv x0, x1  	// Jump to Virtual function-	blr x2+	jalr x2diff --git
> a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-
> sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> index 397b3514..00b59594 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> @@ -2,6 +2,7 @@
>     Copyright 2006 - 2012 Unified EFI, Inc.<BR>   Copyright (c) 2012, ARM Ltd. All
> rights reserved.<BR>+  Copyright (c) 2021, 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@@ -22,9 +23,6 @@ Module Name:
>   #include "SCRTApp.h" -#define VIRT_TO_PHYS_OFFSET       (0x80000000)
> //2G--BOOLEAN     HighAddress = FALSE; UINTN       PageTable   = 0;  @@ -
> 49,11 +47,10 @@ Returns:
>   --*/ {-	/*Note: It is presumed that on ARM v5, V6 and V7 architectures-
> 	 * the MMU is configured and enabled in PEI phase. As VirtualFunc-
> 	 * is already mapped to virtual memory, don't have to do anything
> here.+  /* Note: It is presumed that on RISCV architectures the MMU is
> configured and+   * enabled in PEI phase. As VirtualFunc is already mapped to
> virtual memory,+   * don't have to do anything here. 	 */-  /* FIXME: Is it
> the same on ARM v8? */ }  @@ -174,9 +171,8 @@ Returns:
>  --*/ {   //-  // Note: It is assumed that the MMU and page tables are
> configured on ARM platforms-  // based on ARM v5 v6 and v7 architecture.+
> // Note: It is assumed that the MMU and page tables are configured on RISC-
> V+  // platforms.   //-  /* FIXME: Is it the same on ARM v8? */
> 	JumpToTestFunc(VirtualFunc, HandOffAddr); }diff --git a/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> index 6161d596..2991935a 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> @@ -1,7 +1,8 @@
>  /** @file    Copyright 2006 - 2012 Unified EFI, Inc.<BR>-  Copyright (c) 2011 -
> 2012 ARM Ltd. All rights reserved.<BR>   +  Copyright (c) 2011 - 2012 ARM Ltd.
> All rights reserved.<BR>+  Copyright (c) 2021 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@@ -24,7 +25,6 @@ Module Name:
>  #include "SCRTDriver.h"  UINTN                 mHandOffPtr        =  0;-
> EFI_PHYSICAL_ADDRESS  mIoPortSpaceAddress = 0;   EFI_STATUS@@ -42,18
> +42,10 @@ ConsumeHandOff (
>     HandOffPtr  = (RUNTIME_HANDOFF*)mHandOffPtr;    *ConfigData =
> HandOffPtr->ConfigureInfo; -   if (!HandOffPtr->DebuggerInfo.MmioFlag){-
> //-     // If debug port is I/O mapped, fix IoBase Address.-     //-
> FixAddress(&HandOffPtr->DebuggerInfo.IoBase);-     mIoPortSpaceAddress
> = HandOffPtr->DebuggerInfo.IoBase;-   } else {-     //-     // If debug port is
> MMIO, fix MmioBase Address.-     //-     FixAddress(&HandOffPtr-
> >DebuggerInfo.MmioBase);-   }+   //+   // Fix MmioBase Address.+   //+
> FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);     return
> EFI_SUCCESS; }@@ -65,7 +57,7 @@ Send2UART (
>    ) {   //-  // TODO: On ARM platforms use platform specific functions to+  //
> TODO: On RISC-V platforms use platform specific functions to   // write the
> data to UART.   //   return EFI_SUCCESS;diff --git a/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> index b925e151..255cb9a6 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> @@ -2,6 +2,7 @@
>     Copyright 2006 - 2012 Unified EFI, Inc.<BR>   Copyright (c) 2011 - 2012 ARM
> Ltd. All rights reserved.<BR>   +  (C) Copyright 2021 Hewlett Packard
> Enterprise Development LP<BR>    This program and the accompanying
> materials   are licensed and made available under the terms and conditions of
> the BSD License@@ -21,7 +22,7 @@ Module Name:
>   --*/ -#include "Io.h"+#include "SCRTDriver.h"  EFI_STATUS EFIAPI@@ -
> 119,11 +120,11 @@ FixAddress (
>    ) { 		//-		//Note: On ARM platforms don't have to do
> this as all the functions are virtually mapped.+		//Note: On RISC-V
> platforms don't have to do this as all the functions are virtually mapped.
> 		// } -// Quick port to ARM+// Quick port to RISC-V. It doesn't
> have traditional I/O-Port 80h POST Codes  VOID Port80 (diff --git a/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
> deleted file mode 100644
> index 1e78b3e4..00000000
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
> +++ /dev/null
> @@ -1,48 +0,0 @@
> -/** @file--  Copyright 2006 - 2012 Unified EFI, Inc.<BR>-  Copyright (c) 2011 -
> 2012 ARM Ltd. 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.- -**/--/*++--Module Name:--  Debug.h----*/--#ifndef
> _IA32_IO_ACCESS_H-#define _IA32_IO_ACCESS_H--#include
> "SCRTDriver.h"--#define IA32_MAX_IO_ADDRESS   0xFFFF--#define IA32API-
> --typedef union {-  UINT8  VOLATILE  *buf;-  UINT8  VOLATILE  *ui8;-  UINT16
> VOLATILE  *ui16;-  UINT32 VOLATILE  *ui32;-  UINT64 VOLATILE  *ui64;-
> UINTN  VOLATILE  ui;-} PTR;--// This address is assuming a pure PC
> architecture. Not required?-#define   VIRT_TO_PHYS_OFFSET
> (0x80000000)     //2G----#endifdiff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c
> index c27c0c0c..c6e72806 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe
> +++ st/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
> @@ -2,6 +2,7 @@
>     Copyright 2006 - 2016 Unified EFI, Inc.<BR>   Copyright (c) 2011 - 2016, ARM
> Ltd. All rights reserved.<BR>+  Copyright (c) 2021, 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@@ -37,7 +38,7 @@ SoftwareBreak (
>    void   ) {-  // Not ported to ARM yet+  // Not ported to RISC-V yet   ASSERT
> (FALSE); } @@ -99,9 +100,7 @@
> BBTestRegisterExceptionCallbackFunctionManualTest (
>    // Invoke RegisterExceptionCallback() to install an interrupt handler
> function.   //   InvokedExceptionCallback = FALSE;-  // FIXME: Is it normal that
> we use EXCEPT_IA32_BREAKPOINT here?-  // Shouldn't we define proper
> constants for ARM exceptions in DebugSupportProtocol.h file?-  Status =
> DebugSupport->RegisterExceptionCallback (DebugSupport, 0,
> ExceptionCallback, EXCEPT_IA32_BREAKPOINT);+  Status = DebugSupport-
> >RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback,
> EXCEPT_RISCV_BREAKPOINT);    if ((Status == EFI_SUCCESS) || (Status ==
> EFI_ALREADY_STARTED)) {     AssertionType =
> EFI_TEST_ASSERTION_PASSED;@@ -205,7 +204,7 @@
> BBTestRegisterExceptionCallbackFunctionManualTest (
>    // Assertion Point 3.4.2.3   // Invoke RegisterExceptionCallback() to install
> another interrupt handler function.   //-  Status = DebugSupport-
> >RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback1,
> EXCEPT_IA32_BREAKPOINT);+  Status = DebugSupport-
> >RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback1,
> EXCEPT_RISCV_BREAKPOINT);    if (Status != EFI_ALREADY_STARTED)
> {     AssertionType = EFI_TEST_ASSERTION_FAILED;@@ -228,7 +227,7 @@
> BBTestRegisterExceptionCallbackFunctionManualTest (
>    // Assertion Point 3.4.2.4   // Invoke RegisterExceptionCallback() to unstall
> the interrupt handler function.   //-  Status = DebugSupport-
> >RegisterExceptionCallback (DebugSupport, 0, NULL,
> EXCEPT_IA32_BREAKPOINT);+  Status = DebugSupport-
> >RegisterExceptionCallback (DebugSupport, 0, NULL,
> EXCEPT_RISCV_BREAKPOINT);    if (EFI_ERROR(Status)) {     AssertionType =
> EFI_TEST_ASSERTION_FAILED;@@ -273,4 +272,3 @@
> BBTestRegisterExceptionCallbackFunctionManualTest (
>     return EFI_SUCCESS; }-diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c
> index 8334f601..8b23d91b 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe
> +++ st/Riscv64/PlatformIsa.c
> @@ -2,6 +2,7 @@
>     Copyright 2006 - 2012 Unified EFI, Inc.<BR>   Copyright (c) 2011 - 2012, ARM
> Ltd. All rights reserved.<BR>+  Copyright (c) 2021, 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@@ -26,5 +27,4 @@ Abstract:
>   #include "DebugSupportBBTestMain.h" -
> EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaAArch64;-
> +EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaRiscv64;diff --git
> a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h
> index ff781aee..144f812a 100644
> --- a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h
> +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv
> +++ 64/EntsLibPlat.h
> @@ -2,6 +2,7 @@
>     Copyright 2006 - 2012 Unified EFI, Inc.<BR>   Copyright (c) 2010 - 2012, ARM
> Ltd. All rights reserved.<BR>+  Copyright (c) 2021 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@@ -20,7 +21,7 @@ Module Name:
>   Abstract: -  AArch64 specific defines+  RISCV64 specific defines  --*/ --
> 2.30.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms
  2021-03-04  3:21 ` [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms Daniel Schaefer
@ 2021-03-04  7:50   ` Abner Chang
  2021-03-30 12:26   ` [edk2-devel] " Sunny Wang
  1 sibling, 0 replies; 13+ messages in thread
From: Abner Chang @ 2021-03-04  7:50 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt

Reviewed-by: Abner Chang <abner.chang@hpe.com>

> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Thursday, March 4, 2021 11:21 AM
> To: devel@edk2.groups.io
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao
> <gaojie@byosoft.com.cn>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Eric Jin <eric.jin@intel.com>; Arvin Chen
> <arvinx.chen@intel.com>; Leif Lindholm <leif@nuviainc.com>; Heinrich
> Schuchardt <xypron.glpk@gmx.de>; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> Subject: [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC
> platforms
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042
> 
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
> Cc: Barton Gao <gaojie@byosoft.com.cn>
> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Cc: Eric Jin <eric.jin@intel.com>
> Cc: Arvin Chen <arvinx.chen@intel.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Abner Chang <abner.chang@hpe.com>
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  uefi-sct/SctPkg/UEFI/IHV_SCT.dsc  | 15 ++++++++-------  uefi-
> sct/SctPkg/UEFI/UEFI_SCT.dsc | 15 ++++++++-------
>  2 files changed, 16 insertions(+), 14 deletions(-)
> 
> diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-
> sct/SctPkg/UEFI/IHV_SCT.dsc
> index 94bb5c36..91116ca7 100644
> --- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
> +++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
> @@ -69,15 +69,16 @@
>    MSFT:*_*_X64_APP_FLAGS   = /D EFIX64
>    MSFT:*_*_X64_PP_FLAGS    = /D EFIX64
>  -#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -
> ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -
> mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -
> D MDE_CPU_X32
> -   GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
> +   GCC:*_*_*_CC_FLAGS        = -ffreestanding -nostdinc -nostdlib -Wno-
> error+#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -mno-
> red-zone -Wno-address -mno-stack-arg-probe "-
> DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32+
> GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) #
> GCC:*_*_IA32_VFRPP_FLAGS  = -D EFI32 $(GCC_VER_MACRO) #
> GCC:*_*_IA32_APP_FLAGS    = -D EFI32 $(GCC_VER_MACRO) #
> GCC:*_*_IA32_PP_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -#
> GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -ffreestanding
> -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-
> arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -
> mabi=ms -D MDE_CPU_X64
> +#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -mno-red-
> zone -Wno-address -mno-stack-arg-probe "-
> DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D
> MDE_CPU_X64 -   GCC:*_*_X64_CC_FLAGS     = -D EFIX64
> $(GCC_VER_MACRO) -Wno-error +   GCC:*_*_X64_CC_FLAGS     = -D EFIX64
> $(GCC_VER_MACRO) #  GCC:*_*_X64_VFRPP_FLAGS  = -D EFIX64
> $(GCC_VER_MACRO) #  GCC:*_*_X64_APP_FLAGS    = -D EFIX64
> $(GCC_VER_MACRO) #  GCC:*_*_X64_PP_FLAGS     = -D EFIX64
> $(GCC_VER_MACRO)@@ -85,7 +86,7 @@
>     #TODO: OM - fixme RVCT:*_*_ARM_CC_FLAGS = -D EFIARM
> $(GCC_VER_MACRO)   *_*_ARM_CC_FLAGS = -D EFIARM-
> GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-
> protector -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -
> Wno-error=unused-but-set-variable -Wno-error=implicit-function-
> declaration -Wno-error+  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM
> $(GCC_VER_MACRO) -fno-stack-protector   *_*_ARM_VFRPP_FLAGS   = -D
> EFIARM $(GCC_VER_MACRO)   *_*_ARM_APP_FLAGS     = -D EFIARM
> $(GCC_VER_MACRO)   *_*_ARM_PP_FLAGS      = -D EFIARM
> $(GCC_VER_MACRO)@@ -104,14 +105,14 @@
>    RVCT:*_*_ARM_CC_FLAGS    = --diag_remark=167 --
> diag_suppress=167,1295,188,550,1,68,111,177    *_*_AARCH64_CC_FLAGS
> = -D EFIAARCH64 $(GCC_VER_MACRO)-  GCC:*_*_AARCH64_CC_FLAGS     = -
> D EFIAARCH64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -
> Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-
> error+  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64
> $(GCC_VER_MACRO)   *_*_AARCH64_VFRPP_FLAGS      = -D EFIAARCH64
> $(GCC_VER_MACRO)   *_*_AARCH64_APP_FLAGS        = -D EFIAARCH64
> $(GCC_VER_MACRO)   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64
> $(GCC_VER_MACRO)   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak
> *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)-
> GCC:*_*_RISCV64_CC_FLAGS  = -D EFIRISCV64 $(GCC_VER_MACRO) -
> ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-
> error=unused-but-set-variable -Wno-error+  GCC:*_*_RISCV64_CC_FLAGS
> = -D EFIRISCV64 $(GCC_VER_MACRO)   *_*_RISCV64_VFRPP_FLAGS      = -D
> EFIRISCV64 $(GCC_VER_MACRO)   *_*_RISCV64_APP_FLAGS        = -D
> EFIRISCV64 $(GCC_VER_MACRO)   *_*_RISCV64_PP_FLAGS         = -D
> EFIRISCV64 $(GCC_VER_MACRO)diff --git a/uefi-
> sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
> index e13e40e4..3bb57d26 100644
> --- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
> +++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
> @@ -72,14 +72,15 @@
>    MSFT:*_*_X64_APP_FLAGS   = /D EFIX64
>    MSFT:*_*_X64_PP_FLAGS    = /D EFIX64
>  -#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -
> ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -
> mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -
> D MDE_CPU_X32
> -  GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
> +   GCC:*_*_*_CC_FLAGS        = -ffreestanding -nostdinc -nostdlib -Wno-
> error+#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -mno-
> red-zone -Wno-address -mno-stack-arg-probe "-
> DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
> +  GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) #
> GCC:*_*_IA32_VFRPP_FLAGS  = -D EFI32 $(GCC_VER_MACRO) #
> GCC:*_*_IA32_APP_FLAGS    = -D EFI32 $(GCC_VER_MACRO) #
> GCC:*_*_IA32_PP_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -#
> GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -ffreestanding
> -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-
> arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -
> mabi=ms -D MDE_CPU_X64
> -   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
> +#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -mno-red-
> zone -Wno-address -mno-stack-arg-probe "-
> DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D
> MDE_CPU_X64
> +   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) #
> GCC:*_*_X64_VFRPP_FLAGS  = -D EFIX64 $(GCC_VER_MACRO) #
> GCC:*_*_X64_APP_FLAGS    = -D EFIX64 $(GCC_VER_MACRO) #
> GCC:*_*_X64_PP_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)@@ -87,7 +88,7
> @@
>     #TODO: OM - fixme RVCT:*_*_ARM_CC_FLAGS = -D EFIARM
> $(GCC_VER_MACRO)   *_*_ARM_CC_FLAGS = -D EFIARM-
> GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-
> protector -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -
> Wno-error=unused-but-set-variable -Wno-error=implicit-function-
> declaration -Wno-error+  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM
> $(GCC_VER_MACRO) -fno-stack-protector   *_*_ARM_VFRPP_FLAGS   = -D
> EFIARM $(GCC_VER_MACRO)   *_*_ARM_APP_FLAGS     = -D EFIARM
> $(GCC_VER_MACRO)   *_*_ARM_PP_FLAGS      = -D EFIARM
> $(GCC_VER_MACRO)@@ -106,14 +107,14 @@
>    RVCT:*_*_ARM_CC_FLAGS    = --diag_remark=167 --
> diag_suppress=167,1295,188,550,1,68,111,177    *_*_AARCH64_CC_FLAGS
> = -D EFIAARCH64 $(GCC_VER_MACRO)-  GCC:*_*_AARCH64_CC_FLAGS     = -
> D EFIAARCH64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -
> Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-
> error+  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64
> $(GCC_VER_MACRO)   *_*_AARCH64_VFRPP_FLAGS      = -D EFIAARCH64
> $(GCC_VER_MACRO)   *_*_AARCH64_APP_FLAGS        = -D EFIAARCH64
> $(GCC_VER_MACRO)   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64
> $(GCC_VER_MACRO)   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak
> *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)-
> GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO) -
> ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-
> error=unused-but-set-variable -Wno-error+  GCC:*_*_RISCV64_CC_FLAGS
> = -D EFIRISCV64 $(GCC_VER_MACRO)   *_*_RISCV64_VFRPP_FLAGS      = -D
> EFIRISCV64 $(GCC_VER_MACRO)   *_*_RISCV64_APP_FLAGS        = -D
> EFIRISCV64 $(GCC_VER_MACRO)   *_*_RISCV64_PP_FLAGS         = -D
> EFIRISCV64 $(GCC_VER_MACRO)--
> 2.30.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-test PATCHv3 5/5] SctPkg: Remove trailing whitespace
  2021-03-04  3:21 ` [edk2-test PATCHv3 5/5] SctPkg: Remove trailing whitespace Daniel Schaefer
@ 2021-03-04  7:51   ` Abner Chang
  0 siblings, 0 replies; 13+ messages in thread
From: Abner Chang @ 2021-03-04  7:51 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt

Reviewed-by: Abner Chang <abner.chang@hpe.com>

> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Thursday, March 4, 2021 11:21 AM
> To: devel@edk2.groups.io
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao
> <gaojie@byosoft.com.cn>; Samer El-Haj-Mahmoud <Samer.El-Haj-
> Mahmoud@arm.com>; Eric Jin <eric.jin@intel.com>; Arvin Chen
> <arvinx.chen@intel.com>; Leif Lindholm <leif@nuviainc.com>; Heinrich
> Schuchardt <xypron.glpk@gmx.de>; Chang, Abner (HPS SW/FW Technologist)
> <abner.chang@hpe.com>
> Subject: [edk2-test PATCHv3 5/5] SctPkg: Remove trailing whitespace
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042
> 
> Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
> Cc: Barton Gao <gaojie@byosoft.com.cn>
> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Cc: Eric Jin <eric.jin@intel.com>
> Cc: Arvin Chen <arvinx.chen@intel.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Abner Chang <abner.chang@hpe.com>
> Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> Reviewed-by: G Edhaya Chandran <Edhaya.Chandran@arm.com>
> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
> ---
>  uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h
> | 4 ++--
>  uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c
> | 6 +++---
>  uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> | 4 ++--
>  uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
> | 6 +++---
>  uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S
> | 6 +++---
>  uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c
> | 6 +++---
>  uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> | 6 +++---
>  uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> | 6 +++---
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c
> | 8 ++++----
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c
> | 8 ++++----
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c
> | 8 ++++----
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h
> | 8 ++++----
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> | 6 +++---
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
> | 8 ++++----
>  uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> | 8 ++++----
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestCacheFunction.c             | 6 +++---
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestExceptionCallbackFunction.c | 7 +++----
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/PlatformIsa.c                                 | 6 +++---
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestCacheFunction.c             | 6 +++---
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c | 6 +++---
>  uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c                                 | 6 +++---
>  uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLib
> Plat.h                                         | 6 +++---
>  uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat
> .c                                            | 6 +++---
>  uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h                                         | 6 +++---
>  uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.
> c                                            | 6 +++---
>  25 files changed, 79 insertions(+), 80 deletions(-)
> 
> diff --git a/uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h b/uefi-
> sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h
> index ee7c656b..b7832e18 100644
> --- a/uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h
> +++ b/uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c b/uefi-
> sct/SctPkg/Library/SctLib/Aarch64/initplat.c
> index a48bb2f3..1c247c91 100644
> --- a/uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c
> +++ b/uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-
> sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> index 69e7f904..5d527ac2 100644
> --- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
> @@ -6,12 +6,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c b/uefi-
> sct/SctPkg/Library/SctLib/Riscv64/initplat.c
> index a48bb2f3..1c247c91 100644
> --- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
> +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S b/uefi-
> sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S
> index d223b36b..a2d7ed71 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S
> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S
> @@ -5,12 +5,12 @@
>  #
> 
>  #  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
> 
> +#  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.
> 
> -#
> 
> +#
> 
>  ##
> 
>  #
> 
>  #
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c b/uefi-
> sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c
> index 397b3514..3edf277e 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-
> sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> index ae33da18..6b727d6e 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
> @@ -6,12 +6,12 @@
>  #
> 
>  #  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
> 
> +#  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.
> 
> -#
> 
> +#
> 
>  ##
> 
>  #
> 
>  #
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-
> sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> index 00b59594..c85ea27b 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
> @@ -6,12 +6,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c
> index 6161d596..122e3531 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c
> @@ -1,16 +1,16 @@
>  /** @file
> 
> 
> 
>    Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> 
> -  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
> 
> +  Copyright (c) 2011 - 2012 ARM Ltd. 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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
> 
> 
>  /*++
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c
> index cc8d9869..cb9771b1 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c
> @@ -1,16 +1,16 @@
>  /** @file
> 
> 
> 
>    Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> 
> -  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
> 
> +  Copyright (c) 2011 - 2012 ARM Ltd. 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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
> 
> 
>  /*++
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c
> index b925e151..e215d723 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c
> @@ -1,16 +1,16 @@
>  /** @file
> 
> 
> 
>    Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> 
> -  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
> 
> +  Copyright (c) 2011 - 2012 ARM Ltd. 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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
> 
> 
>  /*++
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h
> index 1e78b3e4..10ab372a 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h
> @@ -1,16 +1,16 @@
>  /** @file
> 
> 
> 
>    Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> 
> -  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
> 
> +  Copyright (c) 2011 - 2012 ARM Ltd. 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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
> 
> 
>  /*++
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> index 2991935a..b3e13f63 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
> @@ -6,12 +6,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
> 
> 
>  /*++
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
> index cc8d9869..cb9771b1 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
> @@ -1,16 +1,16 @@
>  /** @file
> 
> 
> 
>    Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> 
> -  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
> 
> +  Copyright (c) 2011 - 2012 ARM Ltd. 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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
> 
> 
>  /*++
> 
> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-
> sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> index 255cb9a6..13cd0bc6 100644
> --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
> @@ -1,17 +1,17 @@
>  /** @file
> 
> 
> 
>    Copyright 2006 - 2012 Unified EFI, Inc.<BR>
> 
> -  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
> 
> +  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>
> 
>    (C) Copyright 2021 Hewlett Packard Enterprise Development LP<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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
> 
> 
>  /*++
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestCacheFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestCacheFunction.c
> index 96ee7b57..6b54a25f 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestCacheFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestCacheFunction.c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestExceptionCallbackFunction.c
> index c27c0c0c..ab09a19a 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestExceptionCallbackFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/DebugSupportBBTestExceptionCallbackFunction.c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> @@ -273,4 +273,3 @@ BBTestRegisterExceptionCallbackFunctionManualTest
> (
> 
> 
>    return EFI_SUCCESS;
> 
>  }
> 
> -
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/PlatformIsa.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/PlatformIsa.c
> index 8334f601..3178fb60 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/PlatformIsa.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch6
> 4/PlatformIsa.c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestCacheFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestCacheFunction.c
> index 96ee7b57..6b54a25f 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestCacheFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestCacheFunction.c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c
> index c6e72806..6338008e 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /DebugSupportBBTestExceptionCallbackFunction.c
> @@ -6,12 +6,12 @@
> 
> 
>    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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c
> index 8b23d91b..d91f520e 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64
> /PlatformIsa.c
> @@ -6,12 +6,12 @@
> 
> 
>    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
> 
> +  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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLib
> Plat.h b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLib
> Plat.h
> index ff781aee..91839324 100644
> --- a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLib
> Plat.h
> +++ b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/EntsLib
> Plat.h
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat
> .c b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat
> .c
> index 70a509a4..b255e811 100644
> --- a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat
> .c
> +++ b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Aarch64/InitPlat
> .c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h
> index 144f812a..1dcd458e 100644
> --- a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h
> +++ b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLib
> Plat.h
> @@ -6,12 +6,12 @@
> 
> 
>    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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> diff --git a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.
> c b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.
> c
> index 70a509a4..b255e811 100644
> --- a/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.
> c
> +++ b/uefi-
> sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.
> c
> @@ -5,12 +5,12 @@
> 
> 
>    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
> 
> +  which accompanies this distribution.  The full text of the license may be
> found a
> 
>    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.
> 
> -
> 
> +
> 
>  **/
> 
>  /*++
> 
> 
> 
> --
> 2.30.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources
  2021-03-04  3:21 ` [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources Daniel Schaefer
@ 2021-03-30 12:25   ` Sunny Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Sunny Wang @ 2021-03-30 12:25 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt,
	Chang, Abner (HPS SW/FW Technologist)

Looks good to me. This only affects RISCV. Therefore, as long as you build and run SCT on the RISCV platform, this change should be fine.
Reviewed-by: Sunny Wang <sunny.wang@arm.com>

Best Regards,
Sunny Wang

-----Original Message-----
From: Schaefer, Daniel <daniel.schaefer@hpe.com>
Sent: Thursday, March 4, 2021 11:21 AM
To: devel@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Eric Jin <eric.jin@intel.com>; Arvin Chen <arvinx.chen@intel.com>; Leif Lindholm <leif@nuviainc.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
Subject: [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources

The sources were copied from Aarch64. Follow-up commit will adapt them for Riscv64.

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h                                                                        |  32 +++
 uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c                                                                          |  45 ++++
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S                                                                           |  44 ++++
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c                                                                       | 182 +++++++++++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c                                                                            |  88 +++++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c                                                                             |  68 +++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c                                                                               | 134 ++++++++++
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h                                                                               |  48 ++++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c             | 137 ++++++++++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c | 276 ++++++++++++++++++++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c                                 |  30 +++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h                                         |  55 ++++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c                                            |  55 ++++
 13 files changed, 1194 insertions(+)

diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
new file mode 100644
index 00000000..ee7c656b
--- /dev/null
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
@@ -0,0 +1,32 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2012, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  SctLibPlat.h

+

+Abstract:

+

+  AArch64 specific defines

+

+--*/

+

+#ifndef _EFI_LIB_PLAT_H_

+#define _EFI_LIB_PLAT_H_

+

+#define MIN_ALIGNMENT_SIZE  8

+

+#endif

diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
new file mode 100644
index 00000000..a48bb2f3
--- /dev/null
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/initplat.c
@@ -0,0 +1,45 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2012, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  initplat.c

+

+Abstract:

+

+  Math routines for compatibility with native EFI library routines.

+

+--*/

+

+#include "SctLibInternal.h"

+

+VOID

+InitializeLibPlatform (

+    IN EFI_HANDLE           ImageHandle,

+    IN EFI_SYSTEM_TABLE     *SystemTable

+    )

+

+{

+  // No platform-specific initializations

+}

+

+UINT64

+SctReadTsc (

+  VOID

+  )

+{

+  return 0;

+}

diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
new file mode 100644
index 00000000..d223b36b
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
@@ -0,0 +1,44 @@
+## @file

+#

+#  Copyright 2010 - 2012 Unified EFI, Inc.<BR>

+#  Copyright (c) 2012, ARM Ltd. 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.

+#

+##

+#

+#

+#/*++

+#

+# Module Name:

+#

+#  GoVirtual.S

+#

+#--*/

+#start of the code section

+.text

+/* FIXME: Should alignment be different on Aarch64? */

+.align 3

+

+.global JumpToTestFunc

+.type JumpToTestFunc, %function

+

+#----------------------------------------------------------------------
+--------

+# VOID

+# JumpToTestFunc (

+#   IN  UINTN  FuncPointer,

+#   IN  UNITN  ConfigInfo

+#   )

+#

+JumpToTestFunc:

+       mov x2, x0

+       mov x0, x1

+

+       // Jump to Virtual function

+       blr x2

diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
new file mode 100644
index 00000000..397b3514
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
@@ -0,0 +1,182 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2012, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  VirtualMemory.c

+

+--*/

+

+#include "SCRTApp.h"

+

+#define VIRT_TO_PHYS_OFFSET       (0x80000000)     //2G

+

+BOOLEAN     HighAddress = FALSE;

+UINTN       PageTable   = 0;

+

+

+VOID

+ConvertRuntimeFuncPtr (

+  IN OUT UINTN      *VirtualFunc

+  )

+/*++

+

+Routine Description:

+

+  Change RuntimeTestFunc physical address to virtual address

+

+Arguments:

+

+  VirtualFunc  - On input, RuntimeTestFunc physical address.

+                 On output, RuntimeTest virtual address.

+

+Returns:

+

+  NONE

+

+--*/

+{

+       /*Note: It is presumed that on ARM v5, V6 and V7 architectures

+        * the MMU is configured and enabled in PEI phase. As
+ VirtualFunc

+        * is already mapped to virtual memory, don't have to do anything here.

+        */

+  /* FIXME: Is it the same on ARM v8? */

+}

+

+

+EFI_STATUS

+DoMemoryAllocation (

+  IN UINTN PhysicalFunc

+  )

+/*++

+

+Routine Description:

+

+  Allocate memory and create the PageTable to set up physical-virtual map.

+

+Arguments:

+

+  PhysicalFunc  - Physical address where RuntimeTestFunc locates.

+

+Returns:

+

+  EFI_STATUS

+

+--*/

+{

+  EFI_STATUS                  Status;

+  EFI_PHYSICAL_ADDRESS        AllocateMemory;

+

+  //create new page tables or use existing page tables.

+  //

+  // Allocate PageTable memory close to this Application image location
+ in

+  // the system memory. In this way, it is safe for page table memory.

+  //

+  AllocateMemory = PhysicalFunc;

+

+  Status = tBS->AllocatePages (

+                  AllocateMaxAddress,

+                  EfiRuntimeServicesData,

+                  1,

+                  &AllocateMemory

+                  );

+

+  if (EFI_ERROR(Status)) {

+    return Status;

+  }

+

+  PageTable = (UINTN)AllocateMemory;

+  return EFI_SUCCESS;

+}

+

+

+VOID

+PrepareVirtualAddressMap (

+  IN UINTN                       MemoryMapSize,

+  IN UINTN                       DescriptorSize,

+  IN EFI_MEMORY_DESCRIPTOR       *MemoryMap,

+  IN EFI_MEMORY_DESCRIPTOR       *VirtualMemoryMap,

+  IN OUT UINTN                   *VirtualMapSize

+  )

+/*++

+

+Routine Description:

+

+  Construct VirtualAddressMap from physical address to virtual address

+

+Arguments:

+

+  MemoryMapSize     - The size, in bytes, of the MemoryMap buffer

+  DescriptorSize    - The size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR

+  MemoryMap         - A pointer to the current memory map

+  VirtualMemoryMap  - A pointer to the modified virtual memory map

+  VirtualMapSize    - A pointer to the size, in bytes, of the VirtualMemoryMap buffer

+

+Returns:

+

+  NONE

+

+--*/

+{

+  UINTN    Index;

+  *VirtualMapSize        = 0;

+

+  //

+  // Copy entries that need runtime mapping to construct
+ virtualMemoryMap

+  //

+  for (Index = 0; Index < (MemoryMapSize / DescriptorSize); Index++) {

+    if ((MemoryMap->Attribute & EFI_MEMORY_RUNTIME) ==
+ EFI_MEMORY_RUNTIME) {

+      SctCopyMem ((VOID *) VirtualMemoryMap, (VOID *) MemoryMap,
+ DescriptorSize);

+      VirtualMemoryMap->VirtualStart  =
+ VirtualMemoryMap->PhysicalStart;

+      *VirtualMapSize += DescriptorSize;

+      VirtualMemoryMap = NextMemoryDescriptor (VirtualMemoryMap,
+ DescriptorSize);

+    }

+

+    MemoryMap = NextMemoryDescriptor (MemoryMap, DescriptorSize);

+  }

+}

+

+

+

+VOID

+JumpVirtualMode(

+  IN UINTN VirtualFunc,

+  IN UINTN HandOffAddr

+  )

+/*++

+

+Routine Description:

+

+  Enable virtual addressing mode, and jump to RuntimeTestFunc in
+ virtual address

+

+Arguments:

+

+  VirtualFunc  - RuntimeTestFunc virtual address

+  HandOffAddr  - Configuration Data Address

+

+Returns:

+

+  NONE

+

+--*/

+{

+  //

+  // Note: It is assumed that the MMU and page tables are configured on
+ ARM platforms

+  // based on ARM v5 v6 and v7 architecture.

+  //

+  /* FIXME: Is it the same on ARM v8? */

+       JumpToTestFunc(VirtualFunc, HandOffAddr);

+}

diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
new file mode 100644
index 00000000..6161d596
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
@@ -0,0 +1,88 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2012 ARM Ltd. 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.

+

+**/

+

+/*++

+

+Module Name:

+

+  Debug.c

+

+--*/

+

+#include "SCRTDriver.h"

+

+UINTN                 mHandOffPtr        =  0;

+EFI_PHYSICAL_ADDRESS  mIoPortSpaceAddress = 0;

+

+

+EFI_STATUS

+ConsumeHandOff (

+  IN  UINTN         HandOffAddr,

+  OUT CONF_INFO     *ConfigData

+  )

+{

+   RUNTIME_HANDOFF   *HandOffPtr;

+   //

+   // First fix the memory address of hand off data.

+   //

+   FixAddress(&HandOffAddr);

+   mHandOffPtr = HandOffAddr;

+   HandOffPtr  = (RUNTIME_HANDOFF*)mHandOffPtr;

+   *ConfigData =  HandOffPtr->ConfigureInfo;

+

+   if (!HandOffPtr->DebuggerInfo.MmioFlag){

+     //

+     // If debug port is I/O mapped, fix IoBase Address.

+     //

+     FixAddress(&HandOffPtr->DebuggerInfo.IoBase);

+     mIoPortSpaceAddress = HandOffPtr->DebuggerInfo.IoBase;

+   } else {

+     //

+     // If debug port is MMIO, fix MmioBase Address.

+     //

+     FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);

+   }

+

+   return EFI_SUCCESS;

+}

+

+

+EFI_STATUS

+Send2UART (

+  CHAR8                *String

+  )

+{

+  //

+  // TODO: On ARM platforms use platform specific functions to

+  // write the data to UART.

+  //

+  return EFI_SUCCESS;

+}

+

+

+

+EFI_STATUS

+DebugWorker (

+  IN CHAR8    *String

+  )

+{

+  EFI_STATUS    Status;

+

+  //

+  // Send text message to registered UART.

+  //

+  Status = Send2UART(String);

+  return Status;

+}

diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
new file mode 100644
index 00000000..cc8d9869
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Dump.c
@@ -0,0 +1,68 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2012 ARM Ltd. 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.

+

+**/

+

+/*++

+

+Module Name:

+

+  Dump.c

+

+--*/

+

+#include "SCRTDriver.h"

+

+VOID

+DumpRuntimeTable()

+{

+  SctAPrint ("\n================Dump Runtime Table===============\n");

+  SctAPrint ("Header Signature = 0x%x\n", VRT->Hdr.Signature);

+

+  SctAPrint ("\n================GetTime Service==============\n");

+  SctAPrint ("GetTime @ 0x%x\n", VRT->GetTime);

+

+  SctAPrint ("\n================SetTime Service==============\n");

+  SctAPrint ("SetTime @ 0x%x\n", VRT->SetTime);

+

+  SctAPrint ("\n================GetWakeupTime
+ Service==============\n");

+  SctAPrint ("GetWakeupTime @ 0x%x\n", VRT->GetWakeupTime);

+

+  SctAPrint ("\n================SetWakeupTime
+ Service==============\n");

+  SctAPrint ("SetWakeupTime @ 0x%x\n", VRT->SetWakeupTime);

+

+  SctAPrint ("\n================GetVariable Service==============\n");

+  SctAPrint ("GetVariable @ 0x%x\n", VRT->GetVariable);

+

+  SctAPrint ("\n================GetNextVariableName
+ Service==============\n");

+  SctAPrint ("GetNextVariableName @ 0x%x\n", VRT->GetNextVariableName);

+

+  SctAPrint ("\n================SetVariable Service==============\n");

+  SctAPrint ("SetVariable @ 0x%x\n", VRT->SetVariable);

+

+  SctAPrint ("\n================GetNextHighMonotonicCount
+ Service==============\n");

+  SctAPrint ("GetNextHighMonotonicCount @ 0x%x\n",
+ VRT->GetNextHighMonotonicCount);

+

+  SctAPrint ("\n================ResetSystem Service==============\n");

+  SctAPrint ("ResetSystem @ 0x%x\n", VRT->ResetSystem);

+#if 0

+  SctAPrint ("\n================UpdateCapsule
+ Service==============\n");

+  SctAPrint ("UpdateCapsule @ 0x%x\n", VRT->UpdateCapsule);

+

+  SctAPrint ("\n================QueryCapsuleCapabilities
+ Service==============\n");

+  SctAPrint ("QueryCapsuleCapabilities @ 0x%x\n",
+ VRT->QueryCapsuleCapabilities);

+

+  SctAPrint ("\n================QueryVariableInfo
+ Service==============\n");

+  SctAPrint ("QueryVariableInfo @ 0x%x\n", VRT->QueryVariableInfo);

+#endif

+}

diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
new file mode 100644
index 00000000..b925e151
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
@@ -0,0 +1,134 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2012 ARM Ltd. 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.

+

+**/

+

+/*++

+

+Module Name:

+

+  Io.c

+

+--*/

+

+#include "Io.h"

+

+EFI_STATUS

+EFIAPI

+CpuIoServiceWrite (

+  IN EFI_PEI_CPU_IO_PPI_WIDTH  Width,

+  IN UINT64                     UserAddress,

+  IN UINTN                      Count,

+  IN VOID                       *UserBuffer

+  )

+/*++

+

+Routine Description:

+

+  Perform the port I/O write service

+

+Arguments:

+

+  Width   - Width of the port I/O operation

+  Address - Base address of the port I/O operation

+  Count   - Count of the number of accesses to perform

+  Buffer  - Pointer to the source buffer from which to write data

+

+Returns:

+

+  EFI_SUCCESS           - The data was written.

+  EFI_INVALID_PARAMETER - Width is invalid.

+  EFI_INVALID_PARAMETER - Buffer is NULL.

+  EFI_UNSUPPORTED       - The Buffer is not aligned for the given Width.

+  EFI_UNSUPPORTED       - The address range specified by Address, Width,

+                          and Count is not valid.

+

+--*/

+{

+  return EFI_UNSUPPORTED;

+}

+

+

+EFI_STATUS

+EfiIoWrite (

+  IN     EFI_PEI_CPU_IO_PPI_WIDTH  Width,

+  IN     UINT64                     Address,

+  IN     UINTN                      Count,

+  IN OUT VOID                       *Buffer

+  )

+/*++

+

+Routine Description:

+  Perform an IO write into Buffer.

+

+Arguments:

+  Width   - Width of write transaction, and repeat operation to use

+  Address - IO address to write

+  Count   - Number of times to write the IO address.

+  Buffer  - Buffer to write data from. size is Width * Count

+

+Returns:

+  Status code

+

+--*/

+{

+  return CpuIoServiceWrite(Width, Address, Count, Buffer);

+}

+

+

+EFI_STATUS

+EfiIoRead (

+  IN     EFI_PEI_CPU_IO_PPI_WIDTH  Width,

+  IN     UINT64                     Address,

+  IN     UINTN                      Count,

+  IN OUT VOID                       *Buffer

+  )

+/*++

+

+Routine Description:

+  Perform an IO read into Buffer.

+

+Arguments:

+  Width   - Width of read transaction, and repeat operation to use

+  Address - IO address to read

+  Count   - Number of times to read the IO address.

+  Buffer  - Buffer to read data into. size is Width * Count

+

+Returns:

+  Status code

+

+--*/

+{

+  return EFI_UNSUPPORTED;

+}

+

+

+VOID

+FixAddress (

+  IN UINTN     *PhyAddress

+  )

+{

+               //

+               //Note: On ARM platforms don't have to do this as all the functions are virtually mapped.

+               //

+}

+

+// Quick port to ARM

+

+VOID

+Port80 (

+  UINT8 Number

+  )

+{

+  //EFI_SCT_DEBUG ((EFI_SCT_D_ERROR, L"Port80 %02x", Number));

+}

diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
new file mode 100644
index 00000000..1e78b3e4
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
@@ -0,0 +1,48 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2012 ARM Ltd. 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.

+

+**/

+

+/*++

+

+Module Name:

+

+  Debug.h

+

+--*/

+

+#ifndef _IA32_IO_ACCESS_H

+#define _IA32_IO_ACCESS_H

+

+#include "SCRTDriver.h"

+

+#define IA32_MAX_IO_ADDRESS   0xFFFF

+

+#define IA32API

+

+

+typedef union {

+  UINT8  VOLATILE  *buf;

+  UINT8  VOLATILE  *ui8;

+  UINT16 VOLATILE  *ui16;

+  UINT32 VOLATILE  *ui32;

+  UINT64 VOLATILE  *ui64;

+  UINTN  VOLATILE  ui;

+} PTR;

+

+// This address is assuming a pure PC architecture. Not required?

+#define   VIRT_TO_PHYS_OFFSET            (0x80000000)     //2G

+

+

+

+#endif

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestCacheFunction.c
new file mode 100644
index 00000000..96ee7b57
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe
+++ st/Riscv64/DebugSupportBBTestCacheFunction.c
@@ -0,0 +1,137 @@
+/** @file

+

+  Copyright 2006 - 2016 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2016, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  DebugSupportBBTestCacheFunction.c

+

+Abstract:

+

+  Interface Function Test Cases of Debug Support Protocol

+

+--*/

+

+

+#include "DebugSupportBBTestMain.h"

+

+/**

+ *  Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache() Function Test.

+ *  @param This a pointer of EFI_BB_TEST_PROTOCOL.

+ *  @param ClientInterface a pointer to the interface to be tested.

+ *  @param TestLevel test "thoroughness" control.

+ *  @param SupportHandle a handle containing protocols required.

+ *  @return EFI_SUCCESS Finish the test successfully.

+ */

+//

+// TDS 3.5

+//

+EFI_STATUS

+BBTestInvalidateInstructionCacheFunctionAutoTest (

+  IN EFI_BB_TEST_PROTOCOL       *This,

+  IN VOID                       *ClientInterface,

+  IN EFI_TEST_LEVEL             TestLevel,

+  IN EFI_HANDLE                 SupportHandle

+  )

+{

+  EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib;

+  EFI_STATUS                           Status;

+  EFI_DEBUG_SUPPORT_PROTOCOL           *DebugSupport;

+  EFI_TEST_ASSERTION                   AssertionType;

+  UINT64                               Start;

+  UINT64                               Length;

+  UINTN                                MaxProcessorIndex;

+  UINTN                                ProcessorIndex;

+

+  //

+  // Get the Standard Library Interface

+  //

+  Status = gtBS->HandleProtocol (

+                   SupportHandle,

+                   &gEfiStandardTestLibraryGuid,

+                   (VOID **) &StandardLib

+                   );

+

+  if (EFI_ERROR(Status)) {

+    StandardLib->RecordAssertion (

+                   StandardLib,

+                   EFI_TEST_ASSERTION_FAILED,

+                   gTestGenericFailureGuid,

+                   L"BS.HandleProtocol - Handle standard test library",

+                   L"%a:%d:Status - %r",

+                   __FILE__,

+                   (UINTN)__LINE__,

+                   Status

+                   );

+    return Status;

+  }

+

+  DebugSupport = (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface;

+

+  if (DebugSupport->Isa != PlatformIsa) {

+    return EFI_SUCCESS;

+  }

+

+  Status = DebugSupport->GetMaximumProcessorIndex (DebugSupport,
+ &MaxProcessorIndex);

+  if (EFI_ERROR(Status)) {

+    StandardLib->RecordAssertion (

+                   StandardLib,

+                   EFI_TEST_ASSERTION_FAILED,

+                   gTestGenericFailureGuid,

+
+ L"EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex",

+                   L"%a:%d:Status - %r",

+                   __FILE__,

+                   (UINTN)__LINE__,

+                   Status

+                   );

+    return Status;

+  }

+

+  for (ProcessorIndex = 0; ProcessorIndex <= MaxProcessorIndex;
+ ProcessorIndex++) {

+

+    //

+    // Assertion Point 3.5.2.1

+    // Invoke InvalidateInstructionCache and verify interface correctness.

+    //

+

+    // The Physical base of the memory range to be invalidated.

+    Start  = 0x0;

+

+    // The minimum number of bytes in the processor's instruction cache to be invalidated.

+    Length = 0x0;

+

+    Status = DebugSupport->InvalidateInstructionCache (DebugSupport,
+ ProcessorIndex, (VOID*)&Start, Length);

+

+    if (EFI_ERROR(Status)) {

+      AssertionType = EFI_TEST_ASSERTION_FAILED;

+    } else {

+      AssertionType = EFI_TEST_ASSERTION_PASSED;

+    }

+

+    StandardLib->RecordAssertion (

+                 StandardLib,

+                 AssertionType,

+                 gDebugSupportBBTestFunctionAssertionGuid015,

+
+ L"EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache - Invoke this
+ function and verify interface correctness",

+                 L"%a:%d:Status - %r",

+                 __FILE__,

+                 (UINTN)__LINE__,

+                 Status

+                 );

+  }

+

+  return EFI_SUCCESS;

+}

+

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
new file mode 100644
index 00000000..c27c0c0c
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe
+++ st/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
@@ -0,0 +1,276 @@
+/** @file

+

+  Copyright 2006 - 2016 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2016, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  DebugSupportBBExceptionCallbackFunction.c

+

+Abstract:

+

+  Interface Function Test Cases of Debug Support Protocol

+

+--*/

+

+

+#include "DebugSupportBBTestMain.h"

+

+extern volatile  UINTN InvokedExceptionCallback;

+extern volatile  UINTN InvokedPeriodicCallback;

+

+extern EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa;

+

+void

+SoftwareBreak (

+  void

+  )

+{

+  // Not ported to ARM yet

+  ASSERT (FALSE);

+}

+

+/**

+ *  Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback() Function Test.

+ *  @param This a pointer of EFI_BB_TEST_PROTOCOL.

+ *  @param ClientInterface a pointer to the interface to be tested.

+ *  @param TestLevel test "thoroughness" control.

+ *  @param SupportHandle a handle containing protocols required.

+ *  @return EFI_SUCCESS Finish the test successfully.

+ */

+//

+// TDS 3.4

+//

+EFI_STATUS

+BBTestRegisterExceptionCallbackFunctionManualTest (

+  IN EFI_BB_TEST_PROTOCOL       *This,

+  IN VOID                       *ClientInterface,

+  IN EFI_TEST_LEVEL             TestLevel,

+  IN EFI_HANDLE                 SupportHandle

+  )

+{

+  EFI_STANDARD_TEST_LIBRARY_PROTOCOL   *StandardLib;

+  EFI_STATUS                           Status;

+  EFI_DEBUG_SUPPORT_PROTOCOL           *DebugSupport;

+  EFI_TEST_ASSERTION                   AssertionType;

+

+  DebugSupport = (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface;

+

+  if (DebugSupport->Isa != PlatformIsa) {

+    return EFI_SUCCESS;

+  }

+

+  //

+  // Get the Standard Library Interface

+  //

+  Status = gtBS->HandleProtocol (

+                   SupportHandle,

+                   &gEfiStandardTestLibraryGuid,

+                   (VOID **) &StandardLib

+                   );

+

+  if (EFI_ERROR(Status)) {

+    StandardLib->RecordAssertion (

+                   StandardLib,

+                   EFI_TEST_ASSERTION_FAILED,

+                   gTestGenericFailureGuid,

+                   L"BS.HandleProtocol - Handle standard test library",

+                   L"%a:%d:Status - %r",

+                   __FILE__,

+                   (UINTN)__LINE__,

+                   Status

+                   );

+    return Status;

+  }

+

+  //

+  // Assertion Point 3.4.2.1

+  // Invoke RegisterExceptionCallback() to install an interrupt handler function.

+  //

+  InvokedExceptionCallback = FALSE;

+  // FIXME: Is it normal that we use EXCEPT_IA32_BREAKPOINT here?

+  // Shouldn't we define proper constants for ARM exceptions in DebugSupportProtocol.h file?

+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0,
+ ExceptionCallback, EXCEPT_IA32_BREAKPOINT);

+

+  if ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED)) {

+    AssertionType = EFI_TEST_ASSERTION_PASSED;

+  } else {

+    AssertionType = EFI_TEST_ASSERTION_FAILED;

+  }

+

+  StandardLib->RecordAssertion (

+                 StandardLib,

+                 AssertionType,

+                 gDebugSupportBBTestFunctionAssertionGuid009,

+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback
+ - Invoke this function and verify interface correctness",

+                 L"%a:%d:Status - %r",

+                 __FILE__,

+                 (UINTN)__LINE__,

+                 Status

+                 );

+

+  //

+  // If the callback function is already registed, return

+  //

+  if (EFI_ERROR(Status)) {

+    return EFI_SUCCESS;

+  }

+

+  //

+  // Test the callback function registed.

+  //

+

+  //

+  // Call SoftwareBreak to invoke the interrupt handler function.

+  //

+  SoftwareBreak ();

+

+  if (InvokedExceptionCallback == FALSE) {

+    AssertionType = EFI_TEST_ASSERTION_FAILED;

+  } else {

+    AssertionType = EFI_TEST_ASSERTION_PASSED;

+  }

+

+  StandardLib->RecordAssertion (

+                 StandardLib,

+                 AssertionType,

+                 gDebugSupportBBTestFunctionAssertionGuid010,

+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback
+ - Verify the callback function was invoked.",

+                 L"%a:%d:Status - %r",

+                 __FILE__,

+                 (UINTN)__LINE__,

+                 Status

+                 );

+

+  //

+  // Assertion Point 3.4.2.2

+  // Invoke RegisterPeriodicCallback() to install the Periodic interrupt handler function.

+  // Verify the two callback functions can be both invoked.

+  //

+  InvokedExceptionCallback = FALSE;

+  InvokedPeriodicCallback  = FALSE;

+

+  Status = DebugSupport->RegisterPeriodicCallback (DebugSupport, 0,
+ PeriodicCallback);

+  if (EFI_ERROR(Status)) {

+    return Status;

+  }

+

+  //

+  // Wait the PeriodicCallback to be invoked.

+  //

+  gtBS->Stall (500000);

+

+  //

+  // Call SoftwareBreak to invoke the interrupt handler function.

+  //

+  SoftwareBreak ();

+

+  if ((InvokedExceptionCallback == TRUE) && (InvokedPeriodicCallback ==
+ TRUE)) {

+    AssertionType = EFI_TEST_ASSERTION_PASSED;

+  } else {

+    AssertionType = EFI_TEST_ASSERTION_FAILED;

+  }

+

+  StandardLib->RecordAssertion (

+                 StandardLib,

+                 AssertionType,

+                 gDebugSupportBBTestFunctionAssertionGuid011,

+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback
+ - Verify the two callback functions can be both invoked.",

+                 L"%a:%d:Status - %r",

+                 __FILE__,

+                 (UINTN)__LINE__,

+                 Status

+                 );

+

+  //

+  // Uninstall the Periodic callback function.

+  //

+  Status = DebugSupport->RegisterPeriodicCallback (DebugSupport, 0,
+ NULL);

+  if (EFI_ERROR(Status)) {

+    return Status;

+  }

+

+  //

+  // Assertion Point 3.4.2.3

+  // Invoke RegisterExceptionCallback() to install another interrupt handler function.

+  //

+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0,
+ ExceptionCallback1, EXCEPT_IA32_BREAKPOINT);

+

+  if (Status != EFI_ALREADY_STARTED) {

+    AssertionType = EFI_TEST_ASSERTION_FAILED;

+  } else {

+    AssertionType = EFI_TEST_ASSERTION_PASSED;

+  }

+

+  StandardLib->RecordAssertion (

+                 StandardLib,

+                 AssertionType,

+                 gDebugSupportBBTestFunctionAssertionGuid012,

+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback
+ - Register another callback function.",

+                 L"%a:%d:Status - %r",

+                 __FILE__,

+                 (UINTN)__LINE__,

+                 Status

+                 );

+

+  //

+  // Assertion Point 3.4.2.4

+  // Invoke RegisterExceptionCallback() to unstall the interrupt handler function.

+  //

+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0,
+ NULL, EXCEPT_IA32_BREAKPOINT);

+

+  if (EFI_ERROR(Status)) {

+    AssertionType = EFI_TEST_ASSERTION_FAILED;

+  } else {

+    AssertionType = EFI_TEST_ASSERTION_PASSED;

+  }

+

+  StandardLib->RecordAssertion (

+                 StandardLib,

+                 AssertionType,

+                 gDebugSupportBBTestFunctionAssertionGuid013,

+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback
+ - Invoke this function to uninstall the interrupt handler function",

+                 L"%a:%d:Status - %r",

+                 __FILE__,

+                 (UINTN)__LINE__,

+                 Status

+                 );

+

+  InvokedExceptionCallback = FALSE;

+

+  //

+  // Call SoftwareBreak to invoke the interrupt handler function.

+  //

+  SoftwareBreak ();

+

+  if (InvokedExceptionCallback != FALSE) {

+    AssertionType = EFI_TEST_ASSERTION_FAILED;

+  } else {

+    AssertionType = EFI_TEST_ASSERTION_PASSED;

+  }

+

+  StandardLib->RecordAssertion (

+                 StandardLib,

+                 AssertionType,

+                 gDebugSupportBBTestFunctionAssertionGuid014,

+                 L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback
+ - Verify the callback function wasn't invoked",

+                 L"%a:%d:Status - %r",

+                 __FILE__,

+                 (UINTN)__LINE__,

+                 Status

+                 );

+

+  return EFI_SUCCESS;

+}

+

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
new file mode 100644
index 00000000..8334f601
--- /dev/null
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe
+++ st/Riscv64/PlatformIsa.c
@@ -0,0 +1,30 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2011 - 2012, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  PlatformIsa.c

+

+Abstract:

+

+  Platform related Isa definition.

+

+--*/

+

+#include "DebugSupportBBTestMain.h"

+

+EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaAArch64;

+

diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
new file mode 100644
index 00000000..ff781aee
--- /dev/null
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv
+++ 64/EntsLibPlat.h
@@ -0,0 +1,55 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2010 - 2012, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  EntsLibPlat.h

+

+Abstract:

+

+  AArch64 specific defines

+

+--*/

+

+#ifndef _EFI_LIB_PLAT_H_

+#define _EFI_LIB_PLAT_H_

+

+#define MIN_ALIGNMENT_SIZE  8

+

+VOID

+EntsInitializeLibPlatform (

+  IN EFI_HANDLE           ImageHandle,

+  IN EFI_SYSTEM_TABLE     *SystemTable

+  )

+/*++

+

+Routine Description:

+

+  Initialize platform.

+

+Arguments:

+

+  ImageHandle           - The image handle.

+  SystemTable           - The system table.

+

+Returns:

+

+  None.

+

+--*/

+;

+

+#endif

diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/InitPlat.c
new file mode 100644
index 00000000..70a509a4
--- /dev/null
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv
+++ 64/InitPlat.c
@@ -0,0 +1,55 @@
+/** @file

+

+  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

+  Copyright (c) 2010 - 2012, ARM Ltd. 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.

+

+**/

+/*++

+

+Module Name:

+

+  InitPlat.c

+

+Abstract:

+

+  Math routines for compatibility with native EFI library routines.

+

+--*/

+

+#include "Efi.h"

+#include "EntsLibPlat.h"

+

+VOID

+EntsInitializeLibPlatform (

+  IN EFI_HANDLE           ImageHandle,

+  IN EFI_SYSTEM_TABLE     *SystemTable

+  )

+/*++

+

+Routine Description:

+

+  Initialize platform.

+

+Arguments:

+

+  ImageHandle           - The image handle.

+  SystemTable           - The system table.

+

+Returns:

+

+  None.

+

+--*/

+{

+  //

+  // No platform-specific initializations

+  //

+}

--
2.30.0

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64
  2021-03-04  3:21 ` [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64 Daniel Schaefer
  2021-03-04  7:50   ` Abner Chang
@ 2021-03-30 12:25   ` Sunny Wang
  1 sibling, 0 replies; 13+ messages in thread
From: Sunny Wang @ 2021-03-30 12:25 UTC (permalink / raw)
  To: Schaefer, Daniel, devel@edk2.groups.io
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt,
	Chang, Abner (HPS SW/FW Technologist), Sunny Wang

Looks good to me.
Same comment as patch 1/5. This only affects RISCV. Therefore, as long as you build and run SCT on the RISCV platform, this change should be fine.
Reviewed-by: Sunny Wang <sunny.wang@arm.com>

-----Original Message-----
From: Schaefer, Daniel <daniel.schaefer@hpe.com>
Sent: Thursday, March 4, 2021 11:21 AM
To: devel@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Eric Jin <eric.jin@intel.com>; Arvin Chen <arvinx.chen@intel.com>; Leif Lindholm <leif@nuviainc.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
Subject: [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h                                                                        |  3 +-
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S                                                                           |  9 ++--
 uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c                                                                       | 16 +++----
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c                                                                            | 22 +++------
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c                                                                               |  7 +--
 uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h                                                                               | 48 --------------------
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c | 12 ++---
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c                                 |  4 +-
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h                                         |  3 +-
 9 files changed, 32 insertions(+), 92 deletions(-)

diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
index ee7c656b..69e7f904 100644
--- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
+++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h
@@ -2,6 +2,7 @@


   Copyright 2006 - 2012 Unified EFI, Inc.<BR>

   Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.<BR>

+  Copyright (c) 2021, 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

@@ -20,7 +21,7 @@ Module Name:


 Abstract:



-  AArch64 specific defines

+  RISCV64 specific defines



 --*/



diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
index d223b36b..ae33da18 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
@@ -2,6 +2,7 @@
 #

 #  Copyright 2010 - 2012 Unified EFI, Inc.<BR>

 #  Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>

+#  Copyright (c) 2021, Hewlett Packard Enterprise Development LP.<BR>

 #

 #  This program and the accompanying materials

 #  are licensed and made available under the terms and conditions of the BSD License

@@ -23,8 +24,6 @@
 #--*/

 #start of the code section

 .text

-/* FIXME: Should alignment be different on Aarch64? */

-.align 3



 .global JumpToTestFunc

 .type JumpToTestFunc, %function

@@ -37,8 +36,8 @@
 #   )

 #

 JumpToTestFunc:

-       mov x2, x0

-       mov x0, x1

+       mv x2, x0

+       mv x0, x1



        // Jump to Virtual function

-       blr x2

+       jalr x2

diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
index 397b3514..00b59594 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c
@@ -2,6 +2,7 @@


   Copyright 2006 - 2012 Unified EFI, Inc.<BR>

   Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>

+  Copyright (c) 2021, 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

@@ -22,9 +23,6 @@ Module Name:


 #include "SCRTApp.h"



-#define VIRT_TO_PHYS_OFFSET       (0x80000000)     //2G

-

-BOOLEAN     HighAddress = FALSE;

 UINTN       PageTable   = 0;





@@ -49,11 +47,10 @@ Returns:


 --*/

 {

-       /*Note: It is presumed that on ARM v5, V6 and V7 architectures

-        * the MMU is configured and enabled in PEI phase. As VirtualFunc

-        * is already mapped to virtual memory, don't have to do anything here.

+  /* Note: It is presumed that on RISCV architectures the MMU is configured and

+   * enabled in PEI phase. As VirtualFunc is already mapped to virtual memory,

+   * don't have to do anything here.

         */

-  /* FIXME: Is it the same on ARM v8? */

 }





@@ -174,9 +171,8 @@ Returns:
 --*/

 {

   //

-  // Note: It is assumed that the MMU and page tables are configured on ARM platforms

-  // based on ARM v5 v6 and v7 architecture.

+  // Note: It is assumed that the MMU and page tables are configured on RISC-V

+  // platforms.

   //

-  /* FIXME: Is it the same on ARM v8? */

        JumpToTestFunc(VirtualFunc, HandOffAddr);

 }

diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
index 6161d596..2991935a 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c
@@ -1,7 +1,8 @@
 /** @file



   Copyright 2006 - 2012 Unified EFI, Inc.<BR>

-  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>

+  Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>

+  Copyright (c) 2021 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

@@ -24,7 +25,6 @@ Module Name:
 #include "SCRTDriver.h"



 UINTN                 mHandOffPtr        =  0;

-EFI_PHYSICAL_ADDRESS  mIoPortSpaceAddress = 0;





 EFI_STATUS

@@ -42,18 +42,10 @@ ConsumeHandOff (
    HandOffPtr  = (RUNTIME_HANDOFF*)mHandOffPtr;

    *ConfigData =  HandOffPtr->ConfigureInfo;



-   if (!HandOffPtr->DebuggerInfo.MmioFlag){

-     //

-     // If debug port is I/O mapped, fix IoBase Address.

-     //

-     FixAddress(&HandOffPtr->DebuggerInfo.IoBase);

-     mIoPortSpaceAddress = HandOffPtr->DebuggerInfo.IoBase;

-   } else {

-     //

-     // If debug port is MMIO, fix MmioBase Address.

-     //

-     FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);

-   }

+   //

+   // Fix MmioBase Address.

+   //

+   FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);



    return EFI_SUCCESS;

 }

@@ -65,7 +57,7 @@ Send2UART (
   )

 {

   //

-  // TODO: On ARM platforms use platform specific functions to

+  // TODO: On RISC-V platforms use platform specific functions to

   // write the data to UART.

   //

   return EFI_SUCCESS;

diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
index b925e151..255cb9a6 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c
@@ -2,6 +2,7 @@


   Copyright 2006 - 2012 Unified EFI, Inc.<BR>

   Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.<BR>

+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>



   This program and the accompanying materials

   are licensed and made available under the terms and conditions of the BSD License

@@ -21,7 +22,7 @@ Module Name:


 --*/



-#include "Io.h"

+#include "SCRTDriver.h"



 EFI_STATUS

 EFIAPI

@@ -119,11 +120,11 @@ FixAddress (
   )

 {

                //

-               //Note: On ARM platforms don't have to do this as all the functions are virtually mapped.

+               //Note: On RISC-V platforms don't have to do this as all the functions are virtually mapped.

                //

 }



-// Quick port to ARM

+// Quick port to RISC-V. It doesn't have traditional I/O-Port 80h POST Codes



 VOID

 Port80 (

diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
deleted file mode 100644
index 1e78b3e4..00000000
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file

-

-  Copyright 2006 - 2012 Unified EFI, Inc.<BR>

-  Copyright (c) 2011 - 2012 ARM Ltd. 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.

-

-**/

-

-/*++

-

-Module Name:

-

-  Debug.h

-

---*/

-

-#ifndef _IA32_IO_ACCESS_H

-#define _IA32_IO_ACCESS_H

-

-#include "SCRTDriver.h"

-

-#define IA32_MAX_IO_ADDRESS   0xFFFF

-

-#define IA32API

-

-

-typedef union {

-  UINT8  VOLATILE  *buf;

-  UINT8  VOLATILE  *ui8;

-  UINT16 VOLATILE  *ui16;

-  UINT32 VOLATILE  *ui32;

-  UINT64 VOLATILE  *ui64;

-  UINTN  VOLATILE  ui;

-} PTR;

-

-// This address is assuming a pure PC architecture. Not required?

-#define   VIRT_TO_PHYS_OFFSET            (0x80000000)     //2G

-

-

-

-#endif

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
index c27c0c0c..c6e72806 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
@@ -2,6 +2,7 @@


   Copyright 2006 - 2016 Unified EFI, Inc.<BR>

   Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.<BR>

+  Copyright (c) 2021, 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

@@ -37,7 +38,7 @@ SoftwareBreak (
   void

   )

 {

-  // Not ported to ARM yet

+  // Not ported to RISC-V yet

   ASSERT (FALSE);

 }



@@ -99,9 +100,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
   // Invoke RegisterExceptionCallback() to install an interrupt handler function.

   //

   InvokedExceptionCallback = FALSE;

-  // FIXME: Is it normal that we use EXCEPT_IA32_BREAKPOINT here?

-  // Shouldn't we define proper constants for ARM exceptions in DebugSupportProtocol.h file?

-  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback, EXCEPT_IA32_BREAKPOINT);

+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback, EXCEPT_RISCV_BREAKPOINT);



   if ((Status == EFI_SUCCESS) || (Status == EFI_ALREADY_STARTED)) {

     AssertionType = EFI_TEST_ASSERTION_PASSED;

@@ -205,7 +204,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
   // Assertion Point 3.4.2.3

   // Invoke RegisterExceptionCallback() to install another interrupt handler function.

   //

-  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback1, EXCEPT_IA32_BREAKPOINT);

+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, ExceptionCallback1, EXCEPT_RISCV_BREAKPOINT);



   if (Status != EFI_ALREADY_STARTED) {

     AssertionType = EFI_TEST_ASSERTION_FAILED;

@@ -228,7 +227,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest (
   // Assertion Point 3.4.2.4

   // Invoke RegisterExceptionCallback() to unstall the interrupt handler function.

   //

-  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NULL, EXCEPT_IA32_BREAKPOINT);

+  Status = DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NULL, EXCEPT_RISCV_BREAKPOINT);



   if (EFI_ERROR(Status)) {

     AssertionType = EFI_TEST_ASSERTION_FAILED;

@@ -273,4 +272,3 @@ BBTestRegisterExceptionCallbackFunctionManualTest (


   return EFI_SUCCESS;

 }

-

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
index 8334f601..8b23d91b 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c
@@ -2,6 +2,7 @@


   Copyright 2006 - 2012 Unified EFI, Inc.<BR>

   Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.<BR>

+  Copyright (c) 2021, 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

@@ -26,5 +27,4 @@ Abstract:


 #include "DebugSupportBBTestMain.h"



-EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaAArch64;

-

+EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa = IsaRiscv64;

diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
index ff781aee..144f812a 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsLibPlat.h
@@ -2,6 +2,7 @@


   Copyright 2006 - 2012 Unified EFI, Inc.<BR>

   Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.<BR>

+  Copyright (c) 2021 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

@@ -20,7 +21,7 @@ Module Name:


 Abstract:



-  AArch64 specific defines

+  RISCV64 specific defines



 --*/



--
2.30.0

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support
  2021-03-04  3:21 ` [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support Daniel Schaefer
@ 2021-03-30 12:26   ` Sunny Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Sunny Wang @ 2021-03-30 12:26 UTC (permalink / raw)
  To: devel@edk2.groups.io, daniel.schaefer@hpe.com
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang,
	Sunny Wang

Looks good to me. Same comment as the patches 1/5 and 2/5.
Reviewed-by: Sunny Wang <sunny.wang@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Daniel Schaefer
Sent: Thursday, March 4, 2021 11:21 AM
To: devel@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Eric Jin <eric.jin@intel.com>; Arvin Chen <arvinx.chen@intel.com>; Leif Lindholm <leif@nuviainc.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>; Abner Chang <abner.chang@hpe.com>
Subject: [edk2-devel] [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h                                      |  4 ++
 uefi-sct/SctPkg/Library/SctLib/SctLib.inf                                                   |  6 ++
 uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf                                                    |  5 ++
 uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf                                              |  6 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf |  6 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf               |  4 ++
 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf                 |  4 ++
 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf                    |  5 ++
 uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile                                             |  4 ++
 uefi-sct/SctPkg/UEFI/IHV_SCT.dsc                                                            | 17 +++++-
 uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h                                                | 61 +++++++++++++++++++-
 uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc                                                           | 18 +++++-
 uefi-sct/SctPkg/build.sh                                                                    | 11 +++-
 13 files changed, 144 insertions(+), 7 deletions(-)

diff --git a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
index a7815580..02f0283e 100644
--- a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
+++ b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h
@@ -3,6 +3,7 @@
   Copyright 2006 - 2017 Unified EFI, Inc.<BR>
   Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
   Portions copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>

   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License @@ -32,6 +33,9 @@  #elif defined(EFIAARCH64)
   #define INSTALL_SCT_PLATFORM_SHORT_NAME   L"aarch64"
   #define INSTALL_SCT_PLATFORM_NAME         L"AARCH64"
+#elif defined(EFIRISCV64)
+  #define INSTALL_SCT_PLATFORM_SHORT_NAME   L"riscv64"
+  #define INSTALL_SCT_PLATFORM_NAME         L"RISCV64"
 #else
   #error "Architecture not supported"
 #endif
diff --git a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
index 23cb77fb..7527b203 100644
--- a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
+++ b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>  #  Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved.<BR>  #  Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -62,6 +63,11 @@
   Aarch64/initplat.c
   Math.c

+[sources.RISCV64]
+  Riscv64/SctLibPlat.h
+  Riscv64/initplat.c
+  Math.c
+
 [sources.ia32]
   ia32/SctLibPlat.h
   ia32/initplat.c
diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
index 7aca6e30..8104a4ef 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -39,6 +40,10 @@
   Aarch64/GoVirtual.asm | RVCT
   Aarch64/GoVirtual.S | GCC

+[sources.RISCV64]
+  Riscv64/VirtualMemory.c
+  Riscv64/GoVirtual.S | GCC
+
 [sources.ia32]
   ia32/VirtualMemory.c
   ia32/GoVirtual.asm | MSFT
diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
index ad0eb0f8..a3ef454e 100644
--- a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
+++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -69,6 +70,11 @@
   Aarch64/Dump.c
   Aarch64/Debug.c

+[sources.RISCV64]
+  Riscv64/Io.c
+  Riscv64/Dump.c
+  Riscv64/Debug.c
+
 [sources.common]
   Guid.h
   Guid.c
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
index 799f86fd..03bf7ccf 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTe
+++ st/DebugSupportBBTest.inf
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2012 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>  #  Copyright (c) 2019, ARM Ltd. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -67,6 +68,11 @@
   Aarch64/DebugSupportBBTestExceptionCallbackFunction.c
   Aarch64/DebugSupportBBTestCacheFunction.c

+[sources.RISCV64]
+  Riscv64/PlatformIsa.c
+  Riscv64/DebugSupportBBTestExceptionCallbackFunction.c
+  Riscv64/DebugSupportBBTestCacheFunction.c
+
 [Packages]
   SctPkg/SctPkg.dec
   SctPkg/UEFI/UEFI.dec
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf
index e8118739..95ae593e 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb
+++ 2HcTest.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -55,6 +56,9 @@  #[sources.Aarch64]  #  IPF/TimerInterrupt.c

+#[sources.Riscv64]
+#  IPF/TimerInterrupt.c
+
 [Packages]
   MdePkg/MdePkg.dec
   SctPkg/SctPkg.dec
diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf
index efc438c1..d3bcd5ce 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbH
+++ cTest.inf
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2012 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -55,6 +56,9 @@  [sources.Aarch64]
   Aarch64/TimerInterrupt.c

+[sources.RISCV64]
+  Riscv64/TimerInterrupt.c
+
 [Packages]
   MdePkg/MdePkg.dec
   SctPkg/SctPkg.dec
diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf
index 23f12d1a..b60e90b2 100644
--- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsL
+++ ib.inf
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2012 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>  #  Copyright (c) 2019, ARM Ltd. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -66,6 +67,10 @@
   Aarch64/EntsLibPlat.h
   Aarch64/InitPlat.c

+[sources.RISCV64]
+  Riscv64/EntsLibPlat.h
+  Riscv64/InitPlat.c
+
 [Packages]
   MdePkg/MdePkg.dec
   SctPkg/SctPkg.dec
diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile b/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile
index c235f313..c492d441 100644
--- a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile
+++ b/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile
@@ -1,6 +1,7 @@
 #
 #  Copyright 2006 - 2010 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 Intel Corporation. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -31,6 +32,9 @@ ifndef ARCH
   ifneq (,$(findstring arm,$(uname_m)))
     ARCH=ARM
   endif
+  ifneq (,$(findstring riscv64,$(uname_m)))
+    ARCH=RISCV64
+  endif
   ifndef ARCH
     $(info Could not detected ARCH from uname results)
     $(error ARCH is not defined!)
diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
index f9e86264..94bb5c36 100644
--- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
@@ -3,6 +3,7 @@
 #  Copyright 2006 - 2016 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>  #  Copyright (c) 2019,Microchip Technology Inc.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -42,7 +43,7 @@
   PLATFORM_VERSION               = 0.1
   DSC_SPECIFICATION              = 0x00010005
   OUTPUT_DIRECTORY               = Build/IhvSct
-  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64
+  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64|RISCV64
   BUILD_TARGETS                  = DEBUG|RELEASE
   SKUID_IDENTIFIER               = DEFAULT

@@ -109,6 +110,12 @@
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak

+  *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+  GCC:*_*_RISCV64_CC_FLAGS  = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+
   DEBUG_*_*_CC_FLAGS  = -DEFI_DEBUG
   RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG

@@ -124,6 +131,9 @@
 [Libraries.AARCH64]
   ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

+[Libraries.RISCV64]
+  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 [Libraries.IA32,Libraries.X64]

 [LibraryClasses.common]
@@ -146,6 +156,9 @@
 [LibraryClasses.AARCH64]
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

+[LibraryClasses.RISCV64]
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 [LibraryClasses.IA32]

 ###############################################################################
@@ -228,4 +241,4 @@ SctPkg/TestInfrastructure/SCT/Framework/Sct.inf

 [Components.IA32, Components.X64]
 SctPkg/TestCase/UEFI/IHV/Protocol/PlatformDriverOverride/BlackBoxTest/IhvPlatformDriverOverrideBBTest.inf
-SctPkg/TestCase/UEFI/IHV/Protocol/PlatformToDriverConfiguration/BlackBoxTest/IhvPlatformToDriverConfigurationBBTest.inf
\ No newline at end of file
+SctPkg/TestCase/UEFI/IHV/Protocol/PlatformToDriverConfiguration/BlackBo
+xTest/IhvPlatformToDriverConfigurationBBTest.inf
diff --git a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h b/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h
index 7fba87ae..1963d619 100644
--- a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h
+++ b/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h
@@ -2,6 +2,7 @@

   Copyright 2006 - 2016 Unified EFI, Inc.<BR>
   Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>

   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License @@ -607,6 +608,60 @@ typedef struct {
   UINT64  FAR;  // Fault Address Register  } EFI_SYSTEM_CONTEXT_AARCH64;

+///
+/// RISC-V processor exception types.
+///
+#define EXCEPT_RISCV_INST_MISALIGNED              0
+#define EXCEPT_RISCV_INST_ACCESS_FAULT            1
+#define EXCEPT_RISCV_ILLEGAL_INST                 2
+#define EXCEPT_RISCV_BREAKPOINT                   3
+#define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED      4
+#define EXCEPT_RISCV_LOAD_ACCESS_FAULT            5
+#define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6
+#define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT       7
+#define EXCEPT_RISCV_ENV_CALL_FROM_UMODE          8
+#define EXCEPT_RISCV_ENV_CALL_FROM_SMODE          9
+#define EXCEPT_RISCV_ENV_CALL_FROM_HMODE          10
+#define EXCEPT_RISCV_ENV_CALL_FROM_MMODE          11
+
+#define EXCEPT_RISCV_SOFTWARE_INT       0x0
+#define EXCEPT_RISCV_TIMER_INT          0x1
+
+typedef struct {
+  UINT64  X0;
+  UINT64  X1;
+  UINT64  X2;
+  UINT64  X3;
+  UINT64  X4;
+  UINT64  X5;
+  UINT64  X6;
+  UINT64  X7;
+  UINT64  X8;
+  UINT64  X9;
+  UINT64  X10;
+  UINT64  X11;
+  UINT64  X12;
+  UINT64  X13;
+  UINT64  X14;
+  UINT64  X15;
+  UINT64  X16;
+  UINT64  X17;
+  UINT64  X18;
+  UINT64  X19;
+  UINT64  X20;
+  UINT64  X21;
+  UINT64  X22;
+  UINT64  X23;
+  UINT64  X24;
+  UINT64  X25;
+  UINT64  X26;
+  UINT64  X27;
+  UINT64  X28;
+  UINT64  X29;
+  UINT64  X30;
+  UINT64  X31;
+} EFI_SYSTEM_CONTEXT_RISCV64;
+
 //
 // Universal EFI_SYSTEM_CONTEXT definition  // @@ -618,6 +673,7 @@ union {
   EFI_SYSTEM_CONTEXT_IPF                  *SystemContextIpf;
   EFI_SYSTEM_CONTEXT_ARM                  *SystemContextArm;
   EFI_SYSTEM_CONTEXT_AARCH64              *SystemContextAArch64;
+  EFI_SYSTEM_CONTEXT_RISCV64              *SystemContextRiscV64;
 } EFI_SYSTEM_CONTEXT;

 //
@@ -645,6 +701,8 @@ VOID
 #define IMAGE_FILE_MACHINE_EBC             0x0EBC
 #define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED  0x01c2
 #define IMAGE_FILE_MACHINE_ARM64           0xAA64
+#define IMAGE_FILE_MACHINE_RISCV64         0x5064
+

 typedef
 enum {
@@ -653,7 +711,8 @@ enum {
   IsaIpf  = IMAGE_FILE_MACHINE_IA64,
   IsaEbc  = IMAGE_FILE_MACHINE_EBC,
   IsaArm  = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2
-  IsaAArch64  = IMAGE_FILE_MACHINE_ARM64       ///< 0xAA64
+  IsaAArch64  = IMAGE_FILE_MACHINE_ARM64,      ///< 0xAA64
+  IsaRiscv64  = IMAGE_FILE_MACHINE_RISCV64     ///< 0x5064
 } EFI_INSTRUCTION_SET_ARCHITECTURE;

 typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;; diff --git a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
index 2e97687b..e13e40e4 100644
--- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
@@ -2,7 +2,7 @@
 #
 #  Copyright 2006 - 2017 Unified EFI, Inc.<BR>  #  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> -#  (C) Copyright 2017 Hewlett Packard Enterprise Development LP<BR>
+#  (C) Copyright 2017 - 2021 Hewlett Packard Enterprise Development
+LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -42,7 +42,7 @@
   PLATFORM_VERSION               = 0.1
   DSC_SPECIFICATION              = 0x00010005
   OUTPUT_DIRECTORY               = Build/UefiSct
-  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64
+  SUPPORTED_ARCHITECTURES        = IA32|X64|ARM|AARCH64|RISCV64
   BUILD_TARGETS                  = DEBUG|RELEASE
   SKUID_IDENTIFIER               = DEFAULT

@@ -112,6 +112,12 @@
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak

+  *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
+  *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
+
   DEBUG_*_*_CC_FLAGS  = -DEFI_DEBUG
   RELEASE_*_*_CC_FLAGS  = -DMDEPKG_NDEBUG

@@ -129,6 +135,9 @@
 [Libraries.AARCH64]
   ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

+[Libraries.RISCV64]
+  ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 [LibraryClasses.common]
   UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
@@ -157,6 +166,9 @@
 [LibraryClasses.AARCH64]
   NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf

+[LibraryClasses.RISCV64]
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
 ###############################################################################
 #
 # These are the components that will be built by the master makefile @@ -483,4 +495,4 @@ SctPkg/TestCase/RIVL/Protocol/Http/Http/HttpENTSTest.inf
 SctPkg/TestCase/RIVL/Protocol/Http/HttpServiceBinding/HttpServiceBindingENTSTest.inf

 [Components.IA32, Components.X64]
-SctPkg/TestCase/UEFI/EFI/Generic/ExeMode/BlackBoxTest/ExeModeBBTest.inf
\ No newline at end of file
+SctPkg/TestCase/UEFI/EFI/Generic/ExeMode/BlackBoxTest/ExeModeBBTest.inf
diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh index 37667711..f7c5e4bd 100755
--- a/uefi-sct/SctPkg/build.sh
+++ b/uefi-sct/SctPkg/build.sh
@@ -2,6 +2,7 @@
 #
 #  Copyright 2006 - 2015 Unified EFI, Inc.<BR>  #  Copyright (c) 2011 - 2020, ARM Ltd. All rights reserved.<BR>
+#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
 #
 #  This program and the accompanying materials  #  are licensed and made available under the terms and conditions of the BSD License @@ -22,6 +23,8 @@ function get_build_arch
         BUILD_ARCH=ARM;;
     aarch64*)
         BUILD_ARCH=AARCH64;;
+    riscv64*)
+        BUILD_ARCH=RISCV64;;
     *)
         BUILD_ARCH=other;;
 esac
@@ -47,6 +50,12 @@ function set_cross_compile
     else
         TEMP_CROSS_COMPILE=arm-linux-gnueabihf-
     fi
+elif [ "$SCT_TARGET_ARCH" == "RISCV64" ]; then
+    if [ X"$CROSS_COMPILE_64" != X"" ]; then
+        TEMP_CROSS_COMPILE="$CROSS_COMPILE_64"
+    else
+        TEMP_CROSS_COMPILE=riscv64-unknown-elf-
+    fi
 else
     echo "Unsupported target architecture '$SCT_TARGET_ARCH'!" >&2
 fi
@@ -110,7 +119,7 @@ PrintUsage() {
 #Print Help
 #
 echo "Usage:"
-echo "    $0 <architecture (ARM, AARCH64, X64, etc)> \
+echo "    $0 <architecture (ARM, AARCH64, X64, RISCV64, etc)> \
 <toolchain name (RVCT or ARMGCC or GCC*)> \  [build type (RELEASE OR DEBUG, DEFAULT: DEBUG)]"
 }
--
2.30.0






IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [edk2-devel] [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms
  2021-03-04  3:21 ` [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms Daniel Schaefer
  2021-03-04  7:50   ` Abner Chang
@ 2021-03-30 12:26   ` Sunny Wang
  1 sibling, 0 replies; 13+ messages in thread
From: Sunny Wang @ 2021-03-30 12:26 UTC (permalink / raw)
  To: devel@edk2.groups.io, daniel.schaefer@hpe.com
  Cc: G Edhaya Chandran, Barton Gao, Samer El-Haj-Mahmoud, Eric Jin,
	Arvin Chen, Leif Lindholm, Heinrich Schuchardt, Abner Chang,
	Sunny Wang

Hi Daniel,

If my understanding is correct, the build flags below will be used for all the architectures. However, it looks like the compiler options "-ffreestanding -nostdinc -nostdlib" are not common enough for all the architectures. For ARM, this change is ok. However, this may not be ok for IA32 and X64.
GCC:*_*_*_CC_FLAGS        = -ffreestanding -nostdinc -nostdlib -Wno-error

In other words, "-ffreestanding -nostdinc -nostdlib" are not currently being used by IA32 and x64 CC_FLAGS. The lines for IA32 and X64 having "-ffreestanding -nostdinc -nostdlib -Wno-error" are commented out.
#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
   GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
......
#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error

Therefore, your patch changes the IA32 and X64 compiler options. Do we intend to do this? If so, you may also need to check this with Eric and Arvin. If not, you will need to update the patch to keep "-ffreestanding -nostdinc -nostdlib" in original places and have only one option "-Wno-error " in GCC:*_*_*_CC_FLAGS.

Also, good catch on meaningless compiler options -Wno-error=xxxxxxx.

Moreover, I also built SCT with this patch series and run it on my Rasberry Pi 4, and don't see any obvious issue.

Best Regards,
Sunny Wang

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Daniel Schaefer
Sent: Thursday, March 4, 2021 11:21 AM
To: devel@edk2.groups.io
Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>; Barton Gao <gaojie@byosoft.com.cn>; Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Eric Jin <eric.jin@intel.com>; Arvin Chen <arvinx.chen@intel.com>; Leif Lindholm <leif@nuviainc.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>; Abner Chang <abner.chang@hpe.com>
Subject: [edk2-devel] [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
---
 uefi-sct/SctPkg/UEFI/IHV_SCT.dsc  | 15 ++++++++-------  uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc | 15 ++++++++-------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
index 94bb5c36..91116ca7 100644
--- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc
@@ -69,15 +69,16 @@
   MSFT:*_*_X64_APP_FLAGS   = /D EFIX64
   MSFT:*_*_X64_PP_FLAGS    = /D EFIX64

-#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
-   GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
+   GCC:*_*_*_CC_FLAGS        = -ffreestanding -nostdinc -nostdlib -Wno-error
+#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
+   GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_VFRPP_FLAGS  = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_APP_FLAGS    = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_PP_FLAGS     = -D EFI32 $(GCC_VER_MACRO)

-#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
+#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64

-   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
+   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_VFRPP_FLAGS  = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_APP_FLAGS    = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_PP_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
@@ -85,7 +86,7 @@

   #TODO: OM - fixme RVCT:*_*_ARM_CC_FLAGS = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_CC_FLAGS = -D EFIARM
-  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-protector -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=implicit-function-declaration -Wno-error
+  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO)
+ -fno-stack-protector
   *_*_ARM_VFRPP_FLAGS   = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_APP_FLAGS     = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_PP_FLAGS      = -D EFIARM $(GCC_VER_MACRO)
@@ -104,14 +105,14 @@
   RVCT:*_*_ARM_CC_FLAGS    = --diag_remark=167 --diag_suppress=167,1295,188,550,1,68,111,177

   *_*_AARCH64_CC_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
-  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_VFRPP_FLAGS      = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_APP_FLAGS        = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak

   *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
-  GCC:*_*_RISCV64_CC_FLAGS  = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
diff --git a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
index e13e40e4..3bb57d26 100644
--- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
+++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc
@@ -72,14 +72,15 @@
   MSFT:*_*_X64_APP_FLAGS   = /D EFIX64
   MSFT:*_*_X64_PP_FLAGS    = /D EFIX64

-#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
-  GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
+   GCC:*_*_*_CC_FLAGS        = -ffreestanding -nostdinc -nostdlib -Wno-error
+#  GCC:*_*_IA32_CC_FLAGS     = -D EFI32 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m32 -mabi=ms -D MDE_CPU_X32
+  GCC:*_*_IA32_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_VFRPP_FLAGS  = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_APP_FLAGS    = -D EFI32 $(GCC_VER_MACRO)
 #  GCC:*_*_IA32_PP_FLAGS     = -D EFI32 $(GCC_VER_MACRO)

-#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
-   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -Wno-error
+#  GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO) -mno-red-zone -Wno-address -mno-stack-arg-probe "-DEFIAPI=__attribute__((ms_abi))" -m64 -mcmodel=large -mabi=ms -D MDE_CPU_X64
+   GCC:*_*_X64_CC_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_VFRPP_FLAGS  = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_APP_FLAGS    = -D EFIX64 $(GCC_VER_MACRO)
 #  GCC:*_*_X64_PP_FLAGS     = -D EFIX64 $(GCC_VER_MACRO)
@@ -87,7 +88,7 @@

   #TODO: OM - fixme RVCT:*_*_ARM_CC_FLAGS = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_CC_FLAGS = -D EFIARM
-  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO) -fno-stack-protector -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=implicit-function-declaration -Wno-error
+  GCC:*_*_ARM_CC_FLAGS  = -D EFIARM $(GCC_VER_MACRO)
+ -fno-stack-protector
   *_*_ARM_VFRPP_FLAGS   = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_APP_FLAGS     = -D EFIARM $(GCC_VER_MACRO)
   *_*_ARM_PP_FLAGS      = -D EFIARM $(GCC_VER_MACRO)
@@ -106,14 +107,14 @@
   RVCT:*_*_ARM_CC_FLAGS    = --diag_remark=167 --diag_suppress=167,1295,188,550,1,68,111,177

   *_*_AARCH64_CC_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
-  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_AARCH64_CC_FLAGS     = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_VFRPP_FLAGS      = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_APP_FLAGS        = -D EFIAARCH64 $(GCC_VER_MACRO)
   *_*_AARCH64_PP_FLAGS         = -D EFIAARCH64 $(GCC_VER_MACRO)
   RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak

   *_*_RISCV64_CC_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
-  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error
+  GCC:*_*_RISCV64_CC_FLAGS     = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_VFRPP_FLAGS      = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_APP_FLAGS        = -D EFIRISCV64 $(GCC_VER_MACRO)
   *_*_RISCV64_PP_FLAGS         = -D EFIRISCV64 $(GCC_VER_MACRO)
--
2.30.0






IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-30 12:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-04  3:21 [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Daniel Schaefer
2021-03-04  3:21 ` [edk2-test PATCHv3 1/5] SctPkg: Add RISCV64 support by using Aarch64 sources Daniel Schaefer
2021-03-30 12:25   ` Sunny Wang
2021-03-04  3:21 ` [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64 Daniel Schaefer
2021-03-04  7:50   ` Abner Chang
2021-03-30 12:25   ` Sunny Wang
2021-03-04  3:21 ` [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support Daniel Schaefer
2021-03-30 12:26   ` [edk2-devel] " Sunny Wang
2021-03-04  3:21 ` [edk2-test PATCHv3 4/5] SctPkg: Unify CC_FLAGS for all GCC platforms Daniel Schaefer
2021-03-04  7:50   ` Abner Chang
2021-03-30 12:26   ` [edk2-devel] " Sunny Wang
2021-03-04  3:21 ` [edk2-test PATCHv3 5/5] SctPkg: Remove trailing whitespace Daniel Schaefer
2021-03-04  7:51   ` Abner Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox