From 37f93d297497571211499fbf0f28a9f17e6b7d0b Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 22 May 2013 11:13:27 -0700 Subject: [PATCH] Calling to/from native works! --- src/xenia/cpu/libjit/libjit_emitter.cc | 1 + src/xenia/cpu/libjit/libjit_jit.cc | 4 ++-- third_party/libjit | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xenia/cpu/libjit/libjit_emitter.cc b/src/xenia/cpu/libjit/libjit_emitter.cc index 340cbf22e..ed9ec6b62 100644 --- a/src/xenia/cpu/libjit/libjit_emitter.cc +++ b/src/xenia/cpu/libjit/libjit_emitter.cc @@ -186,6 +186,7 @@ int LibjitEmitter::MakeFunction(FunctionSymbol* symbol, jit_function_t gen_fn) { } if (!result_code) { + // TODO(benvanik): flag // pre jit_dump_function(stdout, gen_fn_, symbol->name()); jit_function_compile(gen_fn_); diff --git a/src/xenia/cpu/libjit/libjit_jit.cc b/src/xenia/cpu/libjit/libjit_jit.cc index 56f5ed68a..168fe873a 100644 --- a/src/xenia/cpu/libjit/libjit_jit.cc +++ b/src/xenia/cpu/libjit/libjit_jit.cc @@ -100,10 +100,10 @@ int LibjitJIT::Execute(xe_ppc_state_t* ppc_state, FunctionSymbol* fn_symbol) { } // TODO(benvanik): replace generic apply with special trampoline. - void* args[] = {&ppc_state, &ppc_state->lr}; + intptr_t args[] = {(intptr_t)ppc_state, ppc_state->lr}; uint64_t return_value; int apply_result = jit_function_apply(jit_fn, (void**)&args, &return_value); - if (apply_result) { + if (!apply_result) { XELOGCPU("Execute(%.8X): apply failed with %d", fn_symbol->start_address, apply_result); return 1; diff --git a/third_party/libjit b/third_party/libjit index bd2b2e2bf..61b04ce23 160000 --- a/third_party/libjit +++ b/third_party/libjit @@ -1 +1 @@ -Subproject commit bd2b2e2bf04ca423e23b67eaff92fc623f687e92 +Subproject commit 61b04ce23f04165c6d3041927a4bc62b53e8b032