Skip to content

Commit

Permalink
[RISCV] Allow libunwind to build for rv32e
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcaneNibble committed Aug 1, 2024
1 parent 5c8eb83 commit c5435a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libunwind/src/UnwindRegistersRestore.S
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,11 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv)
ILOAD x\i, (RISCV_ISIZE * \i)(a0)
.endr
// skip a0 for now
#if defined(__riscv_32e)
.irp i,11,12,13,14,15
#else
.irp i,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
#endif
ILOAD x\i, (RISCV_ISIZE * \i)(a0)
.endr
ILOAD x10, (RISCV_ISIZE * 10)(a0) // restore a0
Expand Down
4 changes: 4 additions & 0 deletions libunwind/src/UnwindRegistersSave.S
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,11 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
#
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
ISTORE x1, (RISCV_ISIZE * 0)(a0) // store ra as pc
#if defined(__riscv_32e)
.irp i,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
#else
.irp i,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
#endif
ISTORE x\i, (RISCV_ISIZE * \i)(a0)
.endr

Expand Down

0 comments on commit c5435a4

Please sign in to comment.