Fix setjmp for RISC-V:
o The correct value for _JB_SIGMASK is 27. o The storage size for double-precision floating point register is 8 bytes. Submitted by: "James Clarke" <jrtc4@cam.ac.uk> Reviewed by: markj@ Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D16344
This commit is contained in:
parent
54150c75fc
commit
f4bf33e85c
@ -63,19 +63,19 @@ ENTRY(_setjmp)
|
||||
|
||||
#if !defined(_STANDALONE) && defined(__riscv_float_abi_double)
|
||||
/* Store the fpe registers */
|
||||
fsd fs0, (0 * 16)(a0)
|
||||
fsd fs1, (1 * 16)(a0)
|
||||
fsd fs2, (2 * 16)(a0)
|
||||
fsd fs3, (3 * 16)(a0)
|
||||
fsd fs4, (4 * 16)(a0)
|
||||
fsd fs5, (5 * 16)(a0)
|
||||
fsd fs6, (6 * 16)(a0)
|
||||
fsd fs7, (7 * 16)(a0)
|
||||
fsd fs8, (8 * 16)(a0)
|
||||
fsd fs9, (9 * 16)(a0)
|
||||
fsd fs10, (10 * 16)(a0)
|
||||
fsd fs11, (11 * 16)(a0)
|
||||
addi a0, a0, (12 * 16)
|
||||
fsd fs0, (0 * 8)(a0)
|
||||
fsd fs1, (1 * 8)(a0)
|
||||
fsd fs2, (2 * 8)(a0)
|
||||
fsd fs3, (3 * 8)(a0)
|
||||
fsd fs4, (4 * 8)(a0)
|
||||
fsd fs5, (5 * 8)(a0)
|
||||
fsd fs6, (6 * 8)(a0)
|
||||
fsd fs7, (7 * 8)(a0)
|
||||
fsd fs8, (8 * 8)(a0)
|
||||
fsd fs9, (9 * 8)(a0)
|
||||
fsd fs10, (10 * 8)(a0)
|
||||
fsd fs11, (11 * 8)(a0)
|
||||
addi a0, a0, (12 * 8)
|
||||
#endif
|
||||
|
||||
/* Return value */
|
||||
@ -116,19 +116,19 @@ ENTRY(_longjmp)
|
||||
|
||||
#if !defined(_STANDALONE) && defined(__riscv_float_abi_double)
|
||||
/* Restore the fpe registers */
|
||||
fld fs0, (0 * 16)(a0)
|
||||
fld fs1, (1 * 16)(a0)
|
||||
fld fs2, (2 * 16)(a0)
|
||||
fld fs3, (3 * 16)(a0)
|
||||
fld fs4, (4 * 16)(a0)
|
||||
fld fs5, (5 * 16)(a0)
|
||||
fld fs6, (6 * 16)(a0)
|
||||
fld fs7, (7 * 16)(a0)
|
||||
fld fs8, (8 * 16)(a0)
|
||||
fld fs9, (9 * 16)(a0)
|
||||
fld fs10, (10 * 16)(a0)
|
||||
fld fs11, (11 * 16)(a0)
|
||||
addi a0, a0, (12 * 16)
|
||||
fld fs0, (0 * 8)(a0)
|
||||
fld fs1, (1 * 8)(a0)
|
||||
fld fs2, (2 * 8)(a0)
|
||||
fld fs3, (3 * 8)(a0)
|
||||
fld fs4, (4 * 8)(a0)
|
||||
fld fs5, (5 * 8)(a0)
|
||||
fld fs6, (6 * 8)(a0)
|
||||
fld fs7, (7 * 8)(a0)
|
||||
fld fs8, (8 * 8)(a0)
|
||||
fld fs9, (9 * 8)(a0)
|
||||
fld fs10, (10 * 8)(a0)
|
||||
fld fs11, (11 * 8)(a0)
|
||||
addi a0, a0, (12 * 8)
|
||||
#endif
|
||||
|
||||
/* Load the return value */
|
||||
|
@ -77,19 +77,19 @@ ENTRY(setjmp)
|
||||
|
||||
#ifdef __riscv_float_abi_double
|
||||
/* Store the fpe registers */
|
||||
fsd fs0, (0 * 16)(a0)
|
||||
fsd fs1, (1 * 16)(a0)
|
||||
fsd fs2, (2 * 16)(a0)
|
||||
fsd fs3, (3 * 16)(a0)
|
||||
fsd fs4, (4 * 16)(a0)
|
||||
fsd fs5, (5 * 16)(a0)
|
||||
fsd fs6, (6 * 16)(a0)
|
||||
fsd fs7, (7 * 16)(a0)
|
||||
fsd fs8, (8 * 16)(a0)
|
||||
fsd fs9, (9 * 16)(a0)
|
||||
fsd fs10, (10 * 16)(a0)
|
||||
fsd fs11, (11 * 16)(a0)
|
||||
addi a0, a0, (12 * 16)
|
||||
fsd fs0, (0 * 8)(a0)
|
||||
fsd fs1, (1 * 8)(a0)
|
||||
fsd fs2, (2 * 8)(a0)
|
||||
fsd fs3, (3 * 8)(a0)
|
||||
fsd fs4, (4 * 8)(a0)
|
||||
fsd fs5, (5 * 8)(a0)
|
||||
fsd fs6, (6 * 8)(a0)
|
||||
fsd fs7, (7 * 8)(a0)
|
||||
fsd fs8, (8 * 8)(a0)
|
||||
fsd fs9, (9 * 8)(a0)
|
||||
fsd fs10, (10 * 8)(a0)
|
||||
fsd fs11, (11 * 8)(a0)
|
||||
addi a0, a0, (12 * 8)
|
||||
#endif
|
||||
|
||||
/* Return value */
|
||||
@ -146,19 +146,19 @@ ENTRY(longjmp)
|
||||
|
||||
#ifdef __riscv_float_abi_double
|
||||
/* Restore the fpe registers */
|
||||
fld fs0, (0 * 16)(a0)
|
||||
fld fs1, (1 * 16)(a0)
|
||||
fld fs2, (2 * 16)(a0)
|
||||
fld fs3, (3 * 16)(a0)
|
||||
fld fs4, (4 * 16)(a0)
|
||||
fld fs5, (5 * 16)(a0)
|
||||
fld fs6, (6 * 16)(a0)
|
||||
fld fs7, (7 * 16)(a0)
|
||||
fld fs8, (8 * 16)(a0)
|
||||
fld fs9, (9 * 16)(a0)
|
||||
fld fs10, (10 * 16)(a0)
|
||||
fld fs11, (11 * 16)(a0)
|
||||
addi a0, a0, (12 * 16)
|
||||
fld fs0, (0 * 8)(a0)
|
||||
fld fs1, (1 * 8)(a0)
|
||||
fld fs2, (2 * 8)(a0)
|
||||
fld fs3, (3 * 8)(a0)
|
||||
fld fs4, (4 * 8)(a0)
|
||||
fld fs5, (5 * 8)(a0)
|
||||
fld fs6, (6 * 8)(a0)
|
||||
fld fs7, (7 * 8)(a0)
|
||||
fld fs8, (8 * 8)(a0)
|
||||
fld fs9, (9 * 8)(a0)
|
||||
fld fs10, (10 * 8)(a0)
|
||||
fld fs11, (11 * 8)(a0)
|
||||
addi a0, a0, (12 * 8)
|
||||
#endif
|
||||
|
||||
/* Load the return value */
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#define _JBLEN 63 /* sp, ra, [f]s0-11, magic val, sigmask */
|
||||
#define _JB_SIGMASK 21
|
||||
#define _JB_SIGMASK 27
|
||||
|
||||
#ifdef __ASSEMBLER__
|
||||
#define _JB_MAGIC__SETJMP 0xbe87fd8a2910af00
|
||||
|
Loading…
x
Reference in New Issue
Block a user