1.1 --- a/src/sh4/sh4trans.c Tue Sep 18 09:12:30 2007 +0000
1.2 +++ b/src/sh4/sh4trans.c Wed Sep 19 12:09:33 2007 +0000
1.5 - * $Id: sh4trans.c,v 1.3 2007-09-18 09:12:30 nkeynes Exp $
1.6 + * $Id: sh4trans.c,v 1.4 2007-09-19 12:09:33 nkeynes Exp $
1.8 * SH4 translation core module. This part handles the non-target-specific
1.9 * section of the translation.
1.11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.12 * GNU General Public License for more details.
1.15 +#include <assert.h>
1.16 #include "sh4core.h"
1.17 #include "sh4trans.h"
1.18 #include "xltcache.h"
1.19 @@ -109,4 +109,28 @@
1.24 + * Translate a linear basic block to a temporary buffer, execute it, and return
1.25 + * the result of the execution. The translation is discarded.
1.27 +gboolean sh4_translate_and_run( sh4addr_t start )
1.31 + uint32_t pc = start;
1.33 + xlat_output = buf;
1.34 + uint8_t *eob = xlat_output + sizeof(buf);
1.36 + sh4_translate_begin_block();
1.38 + while( (done = sh4_x86_translate_instruction( pc )) == 0 ) {
1.39 + assert( (eob - xlat_output) >= MAX_INSTRUCTION_SIZE );
1.43 + sh4_translate_end_block(pc);
1.45 + gboolean (*code)() = (void *)buf;