Commit 8214e9cb authored by m4xw's avatar m4xw
Browse files

Cache flush optimization for pointer invalidation

TODO: Port to ARMv7
parent ca1deafe
Pipeline #79178 passed with stages
in 4 minutes and 34 seconds
......@@ -356,6 +356,9 @@ static void *kill_pointer(void *stub)
int *i_ptr=(int*)((intptr_t)ptr+offset);
assert((*i_ptr&0xfc000000)==0x14000000); //b
set_jump_target((intptr_t)i_ptr,(intptr_t)stub);
intptr_t ptr_rx=((intptr_t)i_ptr-(intptr_t)base_addr)+(intptr_t)base_addr_rx;
cache_flush((void*)ptr_rx, (void*)(ptr_rx+4));
return i_ptr;
}
......
......@@ -2464,7 +2464,7 @@ static void ll_kill_pointers(struct ll_entry *head,intptr_t addr,int shift)
{
inv_debug("EXP: Kill pointer at %x (%x)\n",(intptr_t)head->addr,head->vaddr);
uintptr_t host_addr=(intptr_t)kill_pointer(head->addr);
#if NEW_DYNAREC >= NEW_DYNAREC_ARM
#if NEW_DYNAREC == NEW_DYNAREC_ARM
needs_clear_cache[(host_addr-(uintptr_t)base_addr)>>17]|=1<<(((host_addr-(uintptr_t)base_addr)>>12)&31);
#else
/* avoid unused variable warning */
......@@ -2805,7 +2805,7 @@ static void invalidate_page(u_int page)
while(head!=NULL) {
inv_debug("INVALIDATE: kill pointer to %x (%x)\n",head->vaddr,(intptr_t)head->addr);
uintptr_t host_addr=(intptr_t)kill_pointer(head->addr);
#if NEW_DYNAREC >= NEW_DYNAREC_ARM
#if NEW_DYNAREC == NEW_DYNAREC_ARM
needs_clear_cache[(host_addr-(uintptr_t)base_addr)>>17]|=1<<(((host_addr-(uintptr_t)base_addr)>>12)&31);
#else
/* avoid unused variable warning */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment