notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #61 from frangarcj/master
[pcsx_rearmed.git]
/
libpcsxcore
/
new_dynarec
/
new_dynarec.c
diff --git
a/libpcsxcore/new_dynarec/new_dynarec.c
b/libpcsxcore/new_dynarec/new_dynarec.c
index
1c0ab56
..
757b781
100644
(file)
--- a/
libpcsxcore/new_dynarec/new_dynarec.c
+++ b/
libpcsxcore/new_dynarec/new_dynarec.c
@@
-1236,6
+1236,9
@@
void invalidate_addr(u_int addr)
void invalidate_all_pages()
{
u_int page,n;
void invalidate_all_pages()
{
u_int page,n;
+ #if defined(VITA)
+ sceKernelOpenVMDomain();
+ #endif
for(page=0;page<4096;page++)
invalidate_page(page);
for(page=0;page<1048576;page++)
for(page=0;page<4096;page++)
invalidate_page(page);
for(page=0;page<1048576;page++)
@@
-1244,6
+1247,9
@@
void invalidate_all_pages()
restore_candidate[((page&2047)>>3)+256]|=1<<(page&7);
}
#ifdef __arm__
restore_candidate[((page&2047)>>3)+256]|=1<<(page&7);
}
#ifdef __arm__
+ #if defined(VITA)
+ sceKernelCloseVMDomain();
+ #endif
__clear_cache((void *)BASE_ADDR,(void *)BASE_ADDR+(1<<TARGET_SIZE_2));
#endif
#ifdef USE_MINI_HT
__clear_cache((void *)BASE_ADDR,(void *)BASE_ADDR+(1<<TARGET_SIZE_2));
#endif
#ifdef USE_MINI_HT
@@
-7927,12
+7933,18
@@
static void disassemble_inst(int i) {}
static int new_dynarec_test(void)
{
static int new_dynarec_test(void)
{
+ #if defined(VITA)
+ sceKernelOpenVMDomain();
+ #endif
int (*testfunc)(void) = (void *)out;
int ret;
emit_movimm(DRC_TEST_VAL,0); // test
emit_jmpreg(14);
literal_pool(0);
#ifdef __arm__
int (*testfunc)(void) = (void *)out;
int ret;
emit_movimm(DRC_TEST_VAL,0); // test
emit_jmpreg(14);
literal_pool(0);
#ifdef __arm__
+#if defined(VITA)
+ sceKernelCloseVMDomain();
+#endif
__clear_cache((void *)testfunc, out);
#endif
SysPrintf("testing if we can run recompiled code..\n");
__clear_cache((void *)testfunc, out);
#endif
SysPrintf("testing if we can run recompiled code..\n");
@@
-7980,17
+7992,18
@@
void new_dynarec_clear_full()
void new_dynarec_init()
{
SysPrintf("Init new dynarec\n");
void new_dynarec_init()
{
SysPrintf("Init new dynarec\n");
- out=(u_char *)BASE_ADDR;
-#if defined(VITA)
- if (mmap (out, 1<<TARGET_SIZE_2,
+#if defined(VITA)
+ out=(u_char *)mmap(translation_cache, 1<<TARGET_SIZE_2,
0,
0,
0,
0,
- -1, 0) <= 0) {
+ -1, 0);
+ if (out<=0) {
SysPrintf("mmap() failed: %s\n", strerror(errno));
}
SysPrintf("mmap() failed: %s\n", strerror(errno));
}
-
+ out=(u_char *)BASE_ADDR;
#else
#else
+ out=(u_char *)BASE_ADDR;
#if BASE_ADDR_FIXED
if (mmap (out, 1<<TARGET_SIZE_2,
PROT_READ | PROT_WRITE | PROT_EXEC,
#if BASE_ADDR_FIXED
if (mmap (out, 1<<TARGET_SIZE_2,
PROT_READ | PROT_WRITE | PROT_EXEC,
@@
-8068,7
+8081,7
@@
void new_dynarec_init()
void new_dynarec_cleanup()
{
int n;
void new_dynarec_cleanup()
{
int n;
- #if BASE_ADDR_FIXED
+ #if BASE_ADDR_FIXED
|| defined(VITA)
if (munmap ((void *)BASE_ADDR, 1<<TARGET_SIZE_2) < 0) {SysPrintf("munmap() failed\n");}
#endif
for(n=0;n<4096;n++) ll_clear(jump_in+n);
if (munmap ((void *)BASE_ADDR, 1<<TARGET_SIZE_2) < 0) {SysPrintf("munmap() failed\n");}
#endif
for(n=0;n<4096;n++) ll_clear(jump_in+n);
@@
-8225,6
+8238,9
@@
int new_recompile_block(int addr)
start = (u_int)addr&~3;
//assert(((u_int)addr&1)==0);
new_dynarec_did_compile=1;
start = (u_int)addr&~3;
//assert(((u_int)addr&1)==0);
new_dynarec_did_compile=1;
+#if defined(VITA)
+ sceKernelOpenVMDomain();
+#endif
if (Config.HLE && start == 0x80001000) // hlecall
{
// XXX: is this enough? Maybe check hleSoftCall?
if (Config.HLE && start == 0x80001000) // hlecall
{
// XXX: is this enough? Maybe check hleSoftCall?
@@
-8236,6
+8252,9
@@
int new_recompile_block(int addr)
emit_jmp((int)new_dyna_leave);
literal_pool(0);
#ifdef __arm__
emit_jmp((int)new_dyna_leave);
literal_pool(0);
#ifdef __arm__
+ #if defined(VITA)
+ sceKernelCloseVMDomain();
+ #endif
__clear_cache((void *)beginning,out);
#endif
ll_add_flags(jump_in+page,start,state_rflags,(void *)beginning);
__clear_cache((void *)beginning,out);
#endif
ll_add_flags(jump_in+page,start,state_rflags,(void *)beginning);
@@
-11606,6
+11625,9
@@
int new_recompile_block(int addr)
copy+=slen*4;
#ifdef __arm__
copy+=slen*4;
#ifdef __arm__
+ #if defined(VITA)
+ sceKernelCloseVMDomain();
+ #endif
__clear_cache((void *)beginning,out);
#endif
__clear_cache((void *)beginning,out);
#endif