nkeynes@359: /** nkeynes@410: * $Id: sh4trans.h,v 1.4 2007-09-29 11:06:40 nkeynes Exp $ nkeynes@359: * nkeynes@359: * SH4->x86 translation module nkeynes@359: * nkeynes@359: * Copyright (c) 2005 Nathan Keynes. nkeynes@359: * nkeynes@359: * This program is free software; you can redistribute it and/or modify nkeynes@359: * it under the terms of the GNU General Public License as published by nkeynes@359: * the Free Software Foundation; either version 2 of the License, or nkeynes@359: * (at your option) any later version. nkeynes@359: * nkeynes@359: * This program is distributed in the hope that it will be useful, nkeynes@359: * but WITHOUT ANY WARRANTY; without even the implied warranty of nkeynes@359: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nkeynes@359: * GNU General Public License for more details. nkeynes@359: */ nkeynes@359: nkeynes@359: #include "dream.h" nkeynes@359: #include "mem.h" nkeynes@359: nkeynes@359: /** Maximum size of a translated instruction, in bytes. This includes potentially nkeynes@359: * writing the entire epilogue nkeynes@359: */ nkeynes@389: #define MAX_INSTRUCTION_SIZE 256 nkeynes@410: /** Maximum size of the translation epilogue (current real size is 116 bytes, so nkeynes@410: * allows a little room nkeynes@410: */ nkeynes@410: #define EPILOGUE_SIZE 128 nkeynes@359: /** nkeynes@359: nkeynes@359: */ nkeynes@359: uint32_t sh4_xlat_run_slice( uint32_t nanosecs ); nkeynes@359: nkeynes@359: /** nkeynes@359: * Translate the specified block of code starting from the specified start nkeynes@359: * address until the first branch/jump instruction. nkeynes@359: */ nkeynes@359: void *sh4_translate_basic_block( sh4addr_t start ); nkeynes@359: nkeynes@359: extern uint8_t *xlat_output; nkeynes@359: nkeynes@526: /****************************************************************************** nkeynes@526: * Code generation - these methods must be provided by the nkeynes@526: * actual code gen (eg sh4x86.c) nkeynes@526: ******************************************************************************/ nkeynes@359: nkeynes@408: void sh4_translate_begin_block( sh4addr_t pc ); nkeynes@526: uint32_t sh4_translate_instruction( sh4addr_t pc ); nkeynes@359: void sh4_translate_end_block( sh4addr_t pc );