Module Name: src Committed By: joerg Date: Tue Mar 25 00:00:55 UTC 2014
Modified Files: src/sys/lib/libunwind: Registers.hpp unwind_registers.S Log Message: Save & restore FP registers. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/lib/libunwind/Registers.hpp \ src/sys/lib/libunwind/unwind_registers.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/lib/libunwind/Registers.hpp diff -u src/sys/lib/libunwind/Registers.hpp:1.6 src/sys/lib/libunwind/Registers.hpp:1.7 --- src/sys/lib/libunwind/Registers.hpp:1.6 Mon Mar 24 21:25:03 2014 +++ src/sys/lib/libunwind/Registers.hpp Tue Mar 25 00:00:55 2014 @@ -377,6 +377,8 @@ enum { DWARF_M68K_A7 = 7, DWARF_M68K_D0 = 8, DWARF_M68K_D7 = 15, + DWARF_M68K_FP0 = 16, + DWARF_M68K_FP7 = 23, DWARF_M68K_PC = 24, REGNO_M68K_A0 = 0, @@ -384,13 +386,15 @@ enum { REGNO_M68K_D0 = 8, REGNO_M68K_D7 = 15, REGNO_M68K_PC = 16, + REGNO_M68K_FP0 = 17, + REGNO_M68K_FP7 = 24, }; class Registers_M68K { public: enum { - LAST_REGISTER = REGNO_M68K_PC, - LAST_RESTORE_REG = REGNO_M68K_PC, + LAST_REGISTER = REGNO_M68K_FP7, + LAST_RESTORE_REG = REGNO_M68K_FP7, RETURN_REG = REGNO_M68K_PC, }; @@ -401,13 +405,15 @@ public: return REGNO_M68K_A0 + (num - DWARF_M68K_A0); if (num >= DWARF_M68K_D0 && num <= DWARF_M68K_D7) return REGNO_M68K_D0 + (num - DWARF_M68K_D0); + if (num >= DWARF_M68K_FP0 && num <= DWARF_M68K_FP7) + return REGNO_M68K_FP0 + (num - DWARF_M68K_FP0); if (num == DWARF_M68K_PC) return REGNO_M68K_PC; return LAST_REGISTER + 1; } bool validRegister(int num) const { - return num >= 0 && num <= LAST_RESTORE_REG; + return num >= 0 && num <= REGNO_M68K_PC; } uint64_t getRegister(int num) const { @@ -429,16 +435,23 @@ public: void setSP(uint64_t value) { reg[REGNO_M68K_A7] = value; } bool validFloatVectorRegister(int num) const { - return false; + return num >= REGNO_M68K_FP0 && num <= REGNO_M68K_FP7; } void copyFloatVectorRegister(int num, uint64_t addr_) { + assert(validFloatVectorRegister(num)); + const void *addr = reinterpret_cast<const void *>(addr_); + memcpy(fpreg + (num - REGNO_M68K_FP0), addr, sizeof(fpreg[0])); } __dso_hidden void jumpto() const __dead; private: + typedef uint32_t fpreg_t[3]; + uint32_t reg[REGNO_M68K_PC + 1]; + uint32_t dummy; + fpreg_t fpreg[8]; }; } // namespace _Unwind Index: src/sys/lib/libunwind/unwind_registers.S diff -u src/sys/lib/libunwind/unwind_registers.S:1.6 src/sys/lib/libunwind/unwind_registers.S:1.7 --- src/sys/lib/libunwind/unwind_registers.S:1.6 Mon Mar 24 21:25:03 2014 +++ src/sys/lib/libunwind/unwind_registers.S Tue Mar 25 00:00:55 2014 @@ -346,6 +346,7 @@ END(_ZNK7_Unwind13Registers_vax6jumptoEv ENTRY(_ZN7_Unwind14Registers_M68KC1Ev) move.l 4(%sp), %a0 movem.l %d0-%d7/%a0-%a7, (%a0) + fmovem %fp0-%fp7, 72(%a0) move.l 0(%sp), %a1 move.l %a1, 64(%a0) addq.l #4, 60(%a0) @@ -358,6 +359,7 @@ ENTRY(_ZNK7_Unwind14Registers_M68K6jumpt move.l 64(%a0), %a1 move.l 60(%a0), %a2 move.l %a1, (%a2) + fmovem 72(%a0), %fp0-%fp7 movem.l (%a0), %d0-%d7/%a0-%a7 rts END(_ZNK7_Unwind14Registers_M68K6jumptoEv)