Skip to content
Snippets Groups Projects
Commit c9f1189f authored by Sven Tennie's avatar Sven Tennie :smiley_cat:
Browse files

adjustor: Fence for generated code

parent 9be2b121
Branches wip/ttg-booleanformula
No related tags found
No related merge requests found
Pipeline #91698 canceled
......@@ -187,5 +187,16 @@ createAdjustor (int cconv,
barf("createAdjustor: failed to allocate memory");
}
#if defined(riscv64_HOST_ARCH)
// Synchronize the memory and instruction cache to prevent illegal
// instruction exceptions. fence.i works per hart. I'm not sure what happens
// when the generated code is called on another hart. Probably, the fence on
// read/write is good enough for that. However, if there are illegal
// instruction exceptions, this is the place to look at (maybe, that the
// fence.i needs to be moved closely before the call.)
asm volatile ("fence rw, rw" : : : "memory");
asm volatile ("fence.i" ::: "memory");
#endif
return (void*)code;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment