From 36f9cb38e7a746726fe681069e9da03ddf78604a Mon Sep 17 00:00:00 2001 From: Yifan Lu Date: Sun, 23 Oct 2016 15:38:18 -0700 Subject: Moved cache flushing to an export --- lib/vita/execmem.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/vita/execmem.c b/lib/vita/execmem.c index 08eb923..fdf8e1e 100644 --- a/lib/vita/execmem.c +++ b/lib/vita/execmem.c @@ -5,6 +5,7 @@ #include #include #include +#include "../../../patches.h" #include "../../../slab.h" #include "../../../taihen_internal.h" @@ -79,17 +80,12 @@ int execmem_alloc_unsealed(UNUSED uintptr_t hint, void **ptr_p, uintptr_t *vma_p * @return `SUBSTITUTE_OK` */ int execmem_seal(void *ptr, void *opt) { - uintptr_t vma, ptr_align; - size_t len_align; + uintptr_t vma; struct slab_chain *slab = (struct slab_chain *)opt; vma = slab_getmirror(slab, ptr); - vma = vma & ~0x1F; - ptr_align = (uintptr_t)ptr & ~0x1F; - len_align = (((uintptr_t)ptr + PATCH_ITEM_SIZE + 0x1F) & ~0x1F) - ptr_align; - sceKernelCpuDcacheAndL2Flush((void *)ptr_align, len_align); - sceKernelCpuIcacheAndL2Flush((void *)vma, len_align); + mirror_cache_flush(slab->pid, vma, PATCH_ITEM_SIZE); return SUBSTITUTE_OK; } -- cgit v1.2.3