mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-04 14:20:26 +02:00
Implement jit_flush
* include/lightning/jit_private.h, lib/jit_aarch64.c, lib/jit_alpha.c, lib/jit_arm.c, lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c, lib/jit_sparc.c, lib/jit_x86.c: Implement a private jit_flush call, that flushes the cache, if applicable, aligning down to the previous and up to the next page boundary.
This commit is contained in:
parent
95f4ee4737
commit
7b449aa063
12 changed files with 136 additions and 28 deletions
|
@ -1488,9 +1488,7 @@ _emit_code(jit_state_t *_jit)
|
|||
patch_at(_jitc->patches.ptr[offset].inst, word);
|
||||
}
|
||||
|
||||
#if defined(__linux__)
|
||||
_flush_cache((char *)_jit->code.ptr, _jit->pc.uc - _jit->code.ptr, ICACHE);
|
||||
#endif
|
||||
jit_flush(_jit->code.ptr, _jit->pc.uc);
|
||||
|
||||
return (_jit->code.ptr);
|
||||
}
|
||||
|
@ -1500,6 +1498,19 @@ _emit_code(jit_state_t *_jit)
|
|||
# include "jit_mips-fpu.c"
|
||||
#undef CODE
|
||||
|
||||
void
|
||||
jit_flush(void *fptr, void *tptr)
|
||||
{
|
||||
#if defined(__linux__)
|
||||
jit_word_t f, t, s;
|
||||
|
||||
s = sysconf(_SC_PAGE_SIZE);
|
||||
f = (jit_word_t)fptr & -s;
|
||||
t = (((jit_word_t)tptr) + s - 1) & -s;
|
||||
_flush_cache((void *)f, t - f, ICACHE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_emit_ldxi(jit_state_t *_jit, jit_int32_t r0, jit_int32_t r1, jit_word_t i0)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue