1.1 --- a/src/sh4/sh4trans.h Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/sh4/sh4trans.h Thu Jan 10 08:28:37 2008 +0000
1.4 * GNU General Public License for more details.
1.7 +#include "sh4/xltcache.h"
1.12 * allows a little room
1.14 #define EPILOGUE_SIZE 128
1.16 +/** Maximum number of recovery records for a translated block (2048 based on
1.17 + * 1 record per SH4 instruction in a 4K page).
1.19 +#define MAX_RECOVERY_SIZE 2048
1.24 uint32_t sh4_xlat_run_slice( uint32_t nanosecs );
1.28 void *sh4_translate_basic_block( sh4addr_t start );
1.31 extern uint8_t *xlat_output;
1.32 +extern struct xlat_recovery_record xlat_recovery[MAX_RECOVERY_SIZE];
1.33 +extern uint32_t xlat_recovery_posn;
1.35 /******************************************************************************
1.36 * Code generation - these methods must be provided by the
1.38 void sh4_translate_begin_block( sh4addr_t pc );
1.39 uint32_t sh4_translate_instruction( sh4addr_t pc );
1.40 void sh4_translate_end_block( sh4addr_t pc );
1.42 +typedef void (*unwind_thunk_t)(void);
1.45 + * From within the translator, (typically called from MMU exception handling routines)
1.46 + * immediately exit the current translation block (performing cleanup as necessary) and
1.47 + * return to sh4_xlat_run_slice(). Effectively a fast longjmp w/ xlat recovery.
1.49 + * Note: The correct working of this method depends on the translator anticipating the
1.50 + * exception and generating the appropriate recovery block(s) - currently this means
1.51 + * that it should ONLY be called from within the context of a memory read or write.
1.53 + * @param is_completion If TRUE, exit after completing the current instruction (effectively),
1.54 + * otherwise abort the current instruction with no effect.
1.55 + * @param thunk A function to execute after perform xlat recovery, but before returning
1.56 + * to run_slice. If NULL, control returns directly.
1.57 + * @return This method never returns.
1.59 +void sh4_translate_unwind_stack( gboolean is_completion, unwind_thunk_t thunk );