riscv64 is pretty similar to aarch64 so reuse its description. JB_SP_INDEX comes from src/lib/libc/arch/riscv64/gen/setjmp.S
I have only used defined(__riscv) checks since: - those files are OS-dependant - all we support is RV64 - there are no plans to support the 32 bits ISA This is different from the linux files which include support for both the 32 and 64 bits ISA. Dunno what upstream will prefer. ok? Index: patches/patch-nspr_pr_include_md__openbsd_cfg =================================================================== RCS file: /cvs/ports/devel/nspr/patches/patch-nspr_pr_include_md__openbsd_cfg,v retrieving revision 1.2 diff -u -p -r1.2 patch-nspr_pr_include_md__openbsd_cfg --- patches/patch-nspr_pr_include_md__openbsd_cfg 3 May 2017 07:10:37 -0000 1.2 +++ patches/patch-nspr_pr_include_md__openbsd_cfg 15 Jul 2021 14:44:18 -0000 @@ -17,7 +17,7 @@ Index: nspr/pr/include/md/_openbsd.cfg #define PR_ALIGN_OF_POINTER 4 -#elif defined(__alpha__) -+#elif defined(__alpha__) || defined(__aarch64__) ++#elif defined(__alpha__) || defined(__aarch64__) || defined(__riscv) #define IS_LITTLE_ENDIAN 1 #undef IS_BIG_ENDIAN #define HAVE_ALIGNED_DOUBLES Index: patches/patch-nspr_pr_include_md__openbsd_h =================================================================== RCS file: /cvs/ports/devel/nspr/patches/patch-nspr_pr_include_md__openbsd_h,v retrieving revision 1.4 diff -u -p -r1.4 patch-nspr_pr_include_md__openbsd_h --- patches/patch-nspr_pr_include_md__openbsd_h 17 Mar 2021 18:36:57 -0000 1.4 +++ patches/patch-nspr_pr_include_md__openbsd_h 15 Jul 2021 15:00:31 -0000 @@ -3,7 +3,7 @@ $OpenBSD: patch-nspr_pr_include_md__open Index: nspr/pr/include/md/_openbsd.h --- nspr/pr/include/md/_openbsd.h.orig +++ nspr/pr/include/md/_openbsd.h -@@ -26,6 +26,10 @@ +@@ -26,6 +26,12 @@ #define _PR_SI_ARCHITECTURE "sparc" #elif defined(__arm__) #define _PR_SI_ARCHITECTURE "arm" @@ -11,10 +11,12 @@ Index: nspr/pr/include/md/_openbsd.h +#define _PR_SI_ARCHITECTURE "hppa" +#elif defined(__mips64__) || defined(__mips64el__) +#define _PR_SI_ARCHITECTURE "mips64" ++#elif defined(__riscv) ++#define _PR_SI_ARCHITECTURE "riscv64" #endif #define PR_DLL_SUFFIX ".so" -@@ -35,7 +39,11 @@ +@@ -35,7 +41,11 @@ #define _MD_DEFAULT_STACK_SIZE 65536L #define _MD_MMAP_FLAGS MAP_PRIVATE @@ -26,7 +28,7 @@ Index: nspr/pr/include/md/_openbsd.h #define HAVE_DLL #define USE_DLFCN #define _PR_HAVE_SOCKADDR_LEN -@@ -69,8 +77,10 @@ +@@ -69,8 +79,12 @@ #define JB_SP_INDEX 34 #elif defined(__amd64__) #define JB_SP_INDEX 6 @@ -35,6 +37,8 @@ Index: nspr/pr/include/md/_openbsd.h #define JB_SP_INDEX 23 +#elif defined(__mips64__) || defined(__mips64el__) +#define JB_SP_INDEX 29 ++#elif defined(__riscv) ++#define JB_SP_INDEX 1 #else #error "Need to define SP index in jmp_buf here" #endif -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
