sh2 drc, fix powerpc cache handling

This commit is contained in:
kub 2021-04-21 21:16:42 +02:00
parent 448b634ccc
commit f7615fc283
3 changed files with 5 additions and 4 deletions

View file

@ -1559,10 +1559,11 @@ static int emith_cond_check(int cond)
static NOINLINE void host_instructions_updated(void *base, void *end, int force)
{
int step = 32, lgstep = 5;
char *_base = base, *_end = end;
int count = (_end - _base + step-1) >> lgstep;
char *_base = (char *)((uptr)base & ~(step-1));
int count = (((char *)end - _base) >> lgstep) + 1;
if (count <= 0) count = 1; // make sure count is positive
base = _base;
asm volatile(
" mtctr %1;"