Search
lxdream.org :: lxdream/src/sh4/sh4trans.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.h
changeset 527:14c9489f647e
prev526:ba3da45b5754
next561:533f6b478071
next586:2a3ba82cf243
author nkeynes
date Thu Dec 20 09:56:07 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Fix immediate call to MMU_ldtlb (braino...)
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@526
    43
/******************************************************************************
nkeynes@526
    44
 * Code generation - these methods must be provided by the
nkeynes@526
    45
 * actual code gen (eg sh4x86.c) 
nkeynes@526
    46
 ******************************************************************************/
nkeynes@359
    47
nkeynes@527
    48
#define TARGET_X86 1
nkeynes@527
    49
#define TARGET_X86_64 2
nkeynes@527
    50
nkeynes@408
    51
void sh4_translate_begin_block( sh4addr_t pc );
nkeynes@526
    52
uint32_t sh4_translate_instruction( sh4addr_t pc );
nkeynes@359
    53
void sh4_translate_end_block( sh4addr_t pc );
.