diff options
-rw-r--r-- | lib/dis.h | 6 | ||||
-rw-r--r-- | lib/execmem.h | 1 | ||||
-rw-r--r-- | lib/hook-functions.c | 1 | ||||
-rw-r--r-- | lib/substitute-internal.h | 1 | ||||
-rw-r--r-- | lib/vita/execmem.c | 14 |
5 files changed, 14 insertions, 9 deletions
@@ -6,6 +6,12 @@ #include <stdint.h> #include <stdlib.h> +#ifdef __GNUC__ +#define alloca(size) __builtin_alloca(size) +#else +extern void * alloca (size_t __size); +#endif + #define INLINE __attribute__((always_inline)) #define NOINLINE __attribute__((noinline)) diff --git a/lib/execmem.h b/lib/execmem.h index 07e9fa4..9e2f8ca 100644 --- a/lib/execmem.h +++ b/lib/execmem.h @@ -1,5 +1,4 @@ #pragma once -#include <sys/types.h> /* For allocating trampolines - this is just a mmap wrapper. */ int execmem_alloc_unsealed(uintptr_t hint, void **page_p, uintptr_t *vma_p, size_t *size_p, void *opt); int execmem_seal(void *page, void *opt); diff --git a/lib/hook-functions.c b/lib/hook-functions.c index d2fabe9..c38b92a 100644 --- a/lib/hook-functions.c +++ b/lib/hook-functions.c @@ -6,7 +6,6 @@ #include "execmem.h" #include stringify(TARGET_DIR/jump-patch.h) #include <stdlib.h> -#include <alloca.h> #ifndef NO_PTHREADS #include <pthread.h> #endif diff --git a/lib/substitute-internal.h b/lib/substitute-internal.h index 8859436..a35cd93 100644 --- a/lib/substitute-internal.h +++ b/lib/substitute-internal.h @@ -2,6 +2,7 @@ #include <stdio.h> #include <string.h> +#include <stdint.h> #define substitute_panic(...) do { \ fprintf(stderr, __VA_ARGS__); \ diff --git a/lib/vita/execmem.c b/lib/vita/execmem.c index 73c5fdc..2af1430 100644 --- a/lib/vita/execmem.c +++ b/lib/vita/execmem.c @@ -2,9 +2,9 @@ #include "dis.h" #include "execmem.h" #include stringify(TARGET_DIR/jump-patch.h) -#include <psp2kern/kernel/cpu.h> -#include <psp2kern/kernel/sysmem.h> -#include <psp2kern/kernel/threadmgr.h> +#include <kernel/cpu.h> +#include <kernel/sysmem.h> +#include <kernel/threadmgr.h> #include "../../../patches.h" #include "../../../slab.h" #include "../../../taihen_internal.h" @@ -126,14 +126,14 @@ int execmem_foreign_write_with_pc_patch(struct execmem_foreign_write *writes, struct slab_chain *slab = (struct slab_chain *)writes[i].opt; SceUID pid = slab->pid; if (pid == SHARED_PID) { - pid = ksceKernelGetProcessId(); - LOG("ksceKernelGetProcessId: %x", pid); + pid = sceKernelGetProcessId(); + LOG("sceKernelGetProcessId: %x", pid); } LOG("PID:%x, dst:%p, src:%p, len:%x", pid, writes[i].dst, writes[i].src, writes[i].len); if (pid == KERNEL_PID) { - ksceKernelCpuUnrestrictedMemcpy(writes[i].dst, writes[i].src, writes[i].len); + sceKernelCpuUnrestrictedMemcpy(writes[i].dst, writes[i].src, writes[i].len); } else { - ksceKernelRxMemcpyKernelToUserForPid(pid, (uintptr_t)writes[i].dst, writes[i].src, writes[i].len); + sceKernelRxMemcpyKernelToUserForPid(pid, (uintptr_t)writes[i].dst, writes[i].src, writes[i].len); } cache_flush(pid, (uintptr_t)writes[i].dst, writes[i].len); } |