Search
lxdream.org :: lxdream/src/sh4/sh4trans.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.h
changeset 410:5f8413358e7f
prev408:af496b734734
next526:ba3da45b5754
author nkeynes
date Sat Sep 29 11:06:40 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Change extend-block to take a requested size
Terminate blocks on page boundaries for easier invalidation
file annotate diff log raw
nkeynes@359
     1
/**
nkeynes@410
     2
 * $Id: sh4trans.h,v 1.4 2007-09-29 11:06:40 nkeynes Exp $
nkeynes@359
     3
 * 
nkeynes@359
     4
 * SH4->x86 translation module
nkeynes@359
     5
 *
nkeynes@359
     6
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@359
     7
 *
nkeynes@359
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@359
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@359
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@359
    11
 * (at your option) any later version.
nkeynes@359
    12
 *
nkeynes@359
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@359
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@359
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@359
    16
 * GNU General Public License for more details.
nkeynes@359
    17
 */
nkeynes@359
    18
nkeynes@359
    19
#include "dream.h"
nkeynes@359
    20
#include "mem.h"
nkeynes@359
    21
nkeynes@359
    22
/** Maximum size of a translated instruction, in bytes. This includes potentially
nkeynes@359
    23
 * writing the entire epilogue
nkeynes@359
    24
 */
nkeynes@389
    25
#define MAX_INSTRUCTION_SIZE 256
nkeynes@410
    26
/** Maximum size of the translation epilogue (current real size is 116 bytes, so
nkeynes@410
    27
 * allows a little room
nkeynes@410
    28
 */
nkeynes@410
    29
#define EPILOGUE_SIZE 128
nkeynes@359
    30
/**
nkeynes@359
    31
nkeynes@359
    32
 */
nkeynes@359
    33
uint32_t sh4_xlat_run_slice( uint32_t nanosecs );
nkeynes@359
    34
nkeynes@359
    35
/**
nkeynes@359
    36
 * Translate the specified block of code starting from the specified start
nkeynes@359
    37
 * address until the first branch/jump instruction.
nkeynes@359
    38
 */
nkeynes@359
    39
void *sh4_translate_basic_block( sh4addr_t start );
nkeynes@359
    40
nkeynes@359
    41
extern uint8_t *xlat_output;
nkeynes@359
    42
nkeynes@359
    43
/************** Output generation ***************/
nkeynes@359
    44
nkeynes@408
    45
void sh4_translate_begin_block( sh4addr_t pc );
nkeynes@359
    46
nkeynes@359
    47
uint32_t sh4_x86_translate_instruction( sh4addr_t pc );
nkeynes@359
    48
nkeynes@359
    49
void sh4_translate_end_block( sh4addr_t pc );
.