Function prototypes and defines on Memory Only PE COFF loader\r
\r
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+ Portion Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
#define IMAGE_ERROR_FAILED_RELOCATION 9\r
#define IMAGE_ERROR_FAILED_ICACHE_FLUSH 10\r
\r
+//\r
+// Macro definitions for RISC-V architecture.\r
+//\r
+#define RV_X(x, s, n) (((x) >> (s)) & ((1<<(n))-1))\r
+#define RISCV_IMM_BITS 12\r
+#define RISCV_IMM_REACH (1LL<<RISCV_IMM_BITS)\r
+#define RISCV_CONST_HIGH_PART(VALUE) \\r
+ (((VALUE) + (RISCV_IMM_REACH/2)) & ~(RISCV_IMM_REACH-1))\r
\r
//\r
// PE/COFF Loader Read Function passed in by caller\r