Module Name: src
Committed By: matt
Date: Tue Mar 31 17:58:30 UTC 2015
Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_linux.cc
Log Message:
Add RISCV bits
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc:1.5 Thu Oct 23 19:03:38 2014
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_linux.cc Tue Mar 31 17:58:30 2015
@@ -69,6 +69,8 @@ void GetPcSpBp(void *context, uptr *pc,
# define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S8)
# elif defined(__powerpc__) || defined(__powerpc64__)
# define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_R1)
+# elif defined(__riscv__)
+# define _UC_MACHINE_FP(ucontext) __UC_MACHINE_FP(ucontext, _REG_S0)
# elif defined(__sparc__)
# define _UC_MACHINE_FP(ucontext) sp[15]
# elif defined(__sh3__)
@@ -106,6 +108,11 @@ void GetPcSpBp(void *context, uptr *pc,
// The powerpc{,64}-linux ABIs do not specify r31 as the frame
// pointer, but GCC always uses r31 when we need a frame pointer.
*bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
+# elif defined(__riscv__)
+ ucontext_t *ucontext = (ucontext_t*)context;
+ *pc = ucontext->uc_mcontext.gregs[REG_PC];
+ *bp = ucontext->uc_mcontext.gregs[REG_S0];
+ *sp = ucontext->uc_mcontext.gregs[REG_SP];
# elif defined(__sparc__)
ucontext_t *ucontext = (ucontext_t*)context;
uptr *stk_ptr;