Skip to content

Commit f0546a5

Browse files
committed
Support aarch64 without FPU
Skip save/restore of FPU registers on targets without them. Signed-off-by: Keith Packard <[email protected]>
1 parent 9e862ae commit f0546a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libunwind/src/UnwindRegistersRestore.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
658658
ldp x26,x27, [x0, #0x0D0]
659659
ldp x28,x29, [x0, #0x0E0]
660660
ldr x30, [x0, #0x100] // restore pc into lr
661-
661+
#if defined(__ARM_FP) && __ARM_FP != 0
662662
ldp d0, d1, [x0, #0x110]
663663
ldp d2, d3, [x0, #0x120]
664664
ldp d4, d5, [x0, #0x130]
@@ -676,7 +676,7 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_arm64_jumpto)
676676
ldp d28,d29, [x0, #0x1F0]
677677
ldr d30, [x0, #0x200]
678678
ldr d31, [x0, #0x208]
679-
679+
#endif
680680
// Finally, restore sp. This must be done after the last read from the
681681
// context struct, because it is allocated on the stack, and an exception
682682
// could clobber the de-allocated portion of the stack after sp has been

libunwind/src/UnwindRegistersSave.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
746746
str x1, [x0, #0x0F8]
747747
str x30, [x0, #0x100] // store return address as pc
748748
// skip cpsr
749+
#if defined(__ARM_FP) && __ARM_FP != 0
749750
stp d0, d1, [x0, #0x110]
750751
stp d2, d3, [x0, #0x120]
751752
stp d4, d5, [x0, #0x130]
@@ -763,6 +764,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
763764
stp d28,d29, [x0, #0x1F0]
764765
str d30, [x0, #0x200]
765766
str d31, [x0, #0x208]
767+
#endif
766768
mov x0, #0 // return UNW_ESUCCESS
767769
ret
768770

0 commit comments

Comments
 (0)