Skip to content

Commit 2f37bb8

Browse files
committed
runtime: use 16 bit barriers on riscv
1 parent 426eab6 commit 2f37bb8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

runtime/core/barrier.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define UNW_LOCAL_ONLY
1212
#include <libunwind.h>
1313
#include <alaska/StackMapParser.h>
14+
#include <alaska/config.h>
1415

1516

1617
#include <dlfcn.h>
@@ -74,6 +75,9 @@ using inst_t = uint16_t;
7475
#ifdef __aarch64__
7576
using inst_t = uint32_t;
7677
#endif
78+
#ifdef __riscv
79+
using inst_t = uint16_t;
80+
#endif
7781

7882
struct PatchPoint {
7983
inst_t* pc;
@@ -619,6 +623,12 @@ void parse_stack_map(uint8_t* t) {
619623
p.inst_sig = 0x00000000; // udf #0
620624
#endif
621625

626+
627+
#ifdef __riscv
628+
p.inst_nop = 0x0001; // nop
629+
p.inst_sig = 0x0000; // unimp
630+
#endif
631+
622632
patchPoints.push(p);
623633
}
624634
if (record.getID() == 'PATC') {

0 commit comments

Comments
 (0)