Permalink
Browse files

Add initial RISC-V support

Issue #208 (bdwgc).

* include/private/gcconfig.h [__riscv && LINUX && __riscv_xlen==32]
(RISCV32, mach_type_known): Define macro.
* include/private/gcconfig.h [__riscv && LINUX && __riscv_xlen==64]
(RISCV64, mach_type_known): Define macro.
* include/private/gcconfig.h [RISCV32 || RISCV64] (CPP_WORDSZ,
MACH_TYPE, ALIGNMENT): Likewise.
* include/private/gcconfig.h [(RISCV32 || RISCV64) && LINUX] (OS_TYPE,
DATASTART, LINUX_STACKBOTTOM, DYNAMIC_LOADING): Likewise.
* include/private/gcconfig.h [(RISCV32 || RISCV64) && LINUX]
(__data_start): Declare external variable.
  • Loading branch information...
shlevy authored and ivmai committed Feb 18, 2018
1 parent a825a2d commit 4f7f0eebd24dcde9f2b3ec2cb98913fc39bbdda3
Showing with 35 additions and 0 deletions.
  1. +35 −0 include/private/gcconfig.h
View
@@ -650,6 +650,15 @@
# endif
# define mach_type_known
# endif
# if defined(__riscv) && defined(LINUX)
# if __riscv_xlen == 32
# define RISCV32
# define mach_type_known
# elif __riscv_xlen == 64
# define RISCV64
# define mach_type_known
# endif
# endif
# if defined(SN_TARGET_PSP2)
# define mach_type_known
@@ -2970,6 +2979,32 @@
# endif
# endif
# ifdef RISCV32
# define CPP_WORDSZ 32
# define MACH_TYPE "RISC-V32"
# define ALIGNMENT 4
# ifdef LINUX
# define OS_TYPE "LINUX"
extern int __data_start[];
# define DATASTART ((ptr_t)__data_start)
# define LINUX_STACKBOTTOM
# define DYNAMIC_LOADING
# endif
# endif /* RISCV32 */
# ifdef RISCV64
# define CPP_WORDSZ 64
# define MACH_TYPE "RISC-V64"
# define ALIGNMENT 8
# ifdef LINUX
# define OS_TYPE "LINUX"
extern int __data_start[];
# define DATASTART ((ptr_t)__data_start)
# define LINUX_STACKBOTTOM
# define DYNAMIC_LOADING
# endif
# endif /* RISCV64 */
#if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
/* Use glibc's stack-end marker. */
# define USE_LIBC_PRIVATES

0 comments on commit 4f7f0ee

Please sign in to comment.