Skip to content

Commit

Permalink
Add support for sparc and sparc64 (#899)
Browse files Browse the repository at this point in the history
Fixes #893
  • Loading branch information
glaubitz committed Feb 19, 2021
1 parent 7055876 commit 3fcd00d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion absl/base/internal/direct_mmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd,
(defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
(defined(__PPC__) && !defined(__PPC64__)) || \
(defined(__riscv) && __riscv_xlen == 32) || \
(defined(__s390__) && !defined(__s390x__))
(defined(__s390__) && !defined(__s390x__)) || \
(defined(__sparc__) && !defined(__arch64__))
// On these architectures, implement mmap with mmap2.
static int pagesize = 0;
if (pagesize == 0) {
Expand Down
4 changes: 4 additions & 0 deletions absl/debugging/internal/examine_stack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ void* GetProgramCounter(void* vuc) {
return reinterpret_cast<void*>(context->uc_mcontext.psw.addr & 0x7fffffff);
#elif defined(__s390__) && defined(__s390x__)
return reinterpret_cast<void*>(context->uc_mcontext.psw.addr);
#elif defined(__sparc__) && !defined(__arch64__)
return reinterpret_cast<void*>(context->uc_mcontext.gregs[19]);
#elif defined(__sparc__) && defined(__arch64__)
return reinterpret_cast<void*>(context->uc_mcontext.mc_gregs[19]);
#elif defined(__x86_64__)
if (16 < ABSL_ARRAYSIZE(context->uc_mcontext.gregs))
return reinterpret_cast<void*>(context->uc_mcontext.gregs[16]);
Expand Down

0 comments on commit 3fcd00d

Please sign in to comment.