Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit edc4ffe

Browse files
author
John Paul Adrian Glaubitz
committedApr 7, 2020
8199138: Add RISC-V support to Zero
Reviewed-by: erikj, stuefe
1 parent b317d0e commit edc4ffe

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
 

‎make/autoconf/platform.m4

+8
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
120120
VAR_CPU_BITS=64
121121
VAR_CPU_ENDIAN=little
122122
;;
123+
riscv64)
124+
VAR_CPU=riscv64
125+
VAR_CPU_ARCH=riscv
126+
VAR_CPU_BITS=64
127+
VAR_CPU_ENDIAN=little
128+
;;
123129
s390)
124130
VAR_CPU=s390
125131
VAR_CPU_ARCH=s390
@@ -485,6 +491,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
485491
HOTSPOT_$1_CPU_DEFINE=S390
486492
elif test "x$OPENJDK_$1_CPU" = xs390x; then
487493
HOTSPOT_$1_CPU_DEFINE=S390
494+
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
495+
HOTSPOT_$1_CPU_DEFINE=RISCV
488496
elif test "x$OPENJDK_$1_CPU" != x; then
489497
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
490498
fi

‎src/hotspot/os/linux/os_linux.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
18511851
#ifndef EM_AARCH64
18521852
#define EM_AARCH64 183 /* ARM AARCH64 */
18531853
#endif
1854+
#ifndef EM_RISCV
1855+
#define EM_RISCV 243 /* RISC-V */
1856+
#endif
18541857

18551858
static const arch_t arch_array[]={
18561859
{EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
@@ -1877,6 +1880,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
18771880
{EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"},
18781881
{EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"},
18791882
{EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"},
1883+
{EM_RISCV, EM_RISCV, ELFCLASS64, ELFDATA2LSB, (char*)"RISC-V"},
18801884
};
18811885

18821886
#if (defined IA32)
@@ -1911,9 +1915,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
19111915
static Elf32_Half running_arch_code=EM_68K;
19121916
#elif (defined SH)
19131917
static Elf32_Half running_arch_code=EM_SH;
1918+
#elif (defined RISCV)
1919+
static Elf32_Half running_arch_code=EM_RISCV;
19141920
#else
19151921
#error Method os::dll_load requires that one of following is defined:\
1916-
AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, S390, SH, __sparc
1922+
AARCH64, ALPHA, ARM, AMD64, IA32, IA64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc
19171923
#endif
19181924

19191925
// Identify compatibility class for VM's architecture and library's architecture

0 commit comments

Comments
 (0)