generic: groundwork for RISC-V
authorZoltan HERPAI <wigyori@uid0.hu>
Sun, 16 Dec 2018 09:45:53 +0000 (10:45 +0100)
committerZoltan HERPAI <wigyori@uid0.hu>
Wed, 22 Apr 2020 14:14:04 +0000 (16:14 +0200)
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
include/kernel.mk
include/site/riscv64 [new file with mode: 0644]
include/target.mk
target/Config.in

index 40aa1a5163e9787f370f9d41c45f025b4b2e62b2..3162ef0ea473fc657faead19be216de2a0000e3d 100644 (file)
@@ -93,6 +93,8 @@ else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el ))
   LINUX_KARCH := mips
 else ifneq (,$(findstring $(ARCH) , powerpc64 ))
   LINUX_KARCH := powerpc
+else ifneq (,$(findstring $(ARCH) , riscv64 ))
+  LINUX_KARCH := riscv
 else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 ))
   LINUX_KARCH := sh
 else ifneq (,$(findstring $(ARCH) , i386 x86_64 ))
diff --git a/include/site/riscv64 b/include/site/riscv64
new file mode 100644 (file)
index 0000000..c5aa9c5
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+. $TOPDIR/include/site/linux
+ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
+
+ac_cv_sizeof___int64=8
+ac_cv_sizeof_char=1
+ac_cv_sizeof_int=4
+ac_cv_sizeof_int16_t=2
+ac_cv_sizeof_int32_t=4
+ac_cv_sizeof_int64_t=8
+ac_cv_sizeof_long_int=8
+ac_cv_sizeof_long_long=8
+ac_cv_sizeof_long=8
+ac_cv_sizeof_off_t=8
+ac_cv_sizeof_short_int=2
+ac_cv_sizeof_short=2
+ac_cv_sizeof_size_t=8
+ac_cv_sizeof_ssize_t=8
+ac_cv_sizeof_u_int16_t=2
+ac_cv_sizeof_u_int32_t=4
+ac_cv_sizeof_u_int64_t=8
+ac_cv_sizeof_uint16_t=2
+ac_cv_sizeof_uint32_t=4
+ac_cv_sizeof_uint64_t=8
+ac_cv_sizeof_unsigned_int=4
+ac_cv_sizeof_unsigned_long=8
+ac_cv_sizeof_unsigned_long_long=8
+ac_cv_sizeof_unsigned_short=2
+ac_cv_sizeof_void_p=8
index 9bd4c14936c1438df2be87e5697f5f5568699d2b..9d811da2e2bc436c88e4f79afbeb647abd1b1d1f 100644 (file)
@@ -206,6 +206,10 @@ ifeq ($(DUMP),1)
     CPU_CFLAGS_arc700 = -mcpu=arc700
     CPU_CFLAGS_archs = -mcpu=archs
   endif
+  ifeq ($(ARCH),riscv64)
+    CPU_TYPE ?= riscv64
+    CPU_CFLAGS_riscv64:=-mabi=lp64d -march=rv64imafdc
+  endif
   ifneq ($(CPU_TYPE),)
     ifndef CPU_CFLAGS_$(CPU_TYPE)
       $(warning CPU_TYPE "$(CPU_TYPE)" doesn't correspond to a known type)
index 9fead5994f709663dc6f86d487a20469289c5686..27aaad626cd9856b8583b898e81ce2298815830e 100644 (file)
@@ -169,6 +169,10 @@ config powerpc64
        select ARCH_64BIT
        bool
 
+config riscv64
+       select ARCH_64BIT
+       bool
+
 config sh3
        bool
 
@@ -208,6 +212,7 @@ config ARCH
        default "mips64el"  if mips64el
        default "powerpc"   if powerpc
        default "powerpc64" if powerpc64
+       default "riscv64"   if riscv64
        default "sh3"       if sh3
        default "sh3eb"     if sh3eb
        default "sh4"       if sh4