X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=ginge.git;a=blobdiff_plain;f=loader%2Fpatches.c;h=4b1735e48675cd89f61753b9ca0c238ea0a9b969;hp=7d8cf9736e2bfba134d253fdce87f28d12d6953c;hb=499bf01c2f0e075caeb23714e3376a641c04eb7c;hpb=7fd42181a7f66b4403076cd9de98e18140a7eaf8 diff --git a/loader/patches.c b/loader/patches.c index 7d8cf97..4b1735e 100644 --- a/loader/patches.c +++ b/loader/patches.c @@ -1,4 +1,9 @@ -// vim:shiftwidth=2:expandtab +/* + * GINGE - GINGE Is Not Gp2x Emulator + * (C) notaz, 2010-2011 + * + * This work is licensed under the MAME license, see COPYING file for details. + */ #include #include "header.h" @@ -45,8 +50,25 @@ static const unsigned int sig_mask_sigaction[] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000 }; +static const unsigned int sig_execve[] = { + 0xef90000b, 0xe1a04000, 0xe3700a01 +}; +#define sig_mask_execve sig_mask_all + +static const unsigned int sig_execve2[] = { + 0xef90000b, 0xe3700a01, 0xe1a04000 +}; +#define sig_mask_execve2 sig_mask_all + +static const unsigned int sig_chdir[] = { + 0xef90000c, 0xe3700a01, 0x312fff1e, 0xea0004bb +}; +static const unsigned int sig_mask_chdir[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000 +}; -#define PATCH(f) { sig_##f, sig_mask_##f, ARRAY_SIZE(sig_##f), w_##f } +#define PATCH_(f,p) { sig_##p, sig_mask_##p, ARRAY_SIZE(sig_##p), w_##f } +#define PATCH(f) PATCH_(f,f) static const struct { const unsigned int *sig; @@ -60,6 +82,8 @@ static const struct { PATCH(read), PATCH(ioctl), PATCH(sigaction), +// PATCH_(execve, execve2), // hangs + PATCH(chdir), }; void do_patches(void *ptr, unsigned int size) @@ -96,3 +120,4 @@ found: sys_cacheflush(ptr, (char *)ptr + size); } +// vim:shiftwidth=2:expandtab