aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Lu2016-10-23 15:38:18 -0700
committerYifan Lu2016-10-23 15:38:18 -0700
commit36f9cb38e7a746726fe681069e9da03ddf78604a (patch)
treeba65b5e49831a678ae822652d0187e2f3dbb19db
parentFixed warning about unused function (diff)
downloadsubstitute-36f9cb38e7a746726fe681069e9da03ddf78604a.tar.gz
Moved cache flushing to an export
-rw-r--r--lib/vita/execmem.c10
1 files 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 <psp2kern/kernel/cpu.h>
#include <psp2kern/kernel/sysmem.h>
#include <psp2kern/kernel/threadmgr.h>
+#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;
}