<html>
<body>
  <div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src</tt></b></td></tr>
<tr><td><tt>sh4/<a href="#file1">sh4x86.in</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+7</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">d5ea3e98557b -> 49152b3d8b75</td></tr>
<tr class="alt" style=";" ><td><tt>xlat/<a href="#file2">xltcache.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+8</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">d5ea3e98557b -> 49152b3d8b75</td></tr>
<tr><td><tt>    /<a href="#file3">xltcache.h</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+9</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">d5ea3e98557b -> 49152b3d8b75</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+24</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-2</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >3 modified files</small><br />
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Setup the unlink_blocks function via a callback, rather than calling
directly into sh4/x86 code from xltcache
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/sh4</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>sh4x86.in</b></big> <small id="info" style="color: #888888;" >d5ea3e98557b -> 49152b3d8b75</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/sh4/sh4x86.in
+++ lxdream/src/sh4/sh4x86.in
@@ -122,6 +122,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static uint32_t trunc_fcw = 0x0F7F; /* fcw value for truncation mode */
 
 static void FASTCALL sh4_translate_get_code_and_backpatch( uint32_t pc );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static void sh4_x86_translate_unlink_block( void *use_list );
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 static struct x86_symbol x86_symbol_table[] = {
     { "sh4r+128", ((char *)&sh4r)+128 },
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -144,6 +145,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     { "xlat_get_code", xlat_get_code }
 };
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static struct xlat_target_fns x86_target_fns = {
+       sh4_x86_translate_unlink_block
+};     
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 gboolean is_sse3_supported()
 {
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -175,6 +180,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     sh4_x86.sse3_enabled = is_sse3_supported();
     x86_disasm_init();
     x86_set_symtab( x86_symbol_table, sizeof(x86_symbol_table)/sizeof(struct x86_symbol) );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    xlat_set_target_fns(x86_target_fns);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 void sh4_translate_set_callbacks( xlat_block_begin_callback_t begin, xlat_block_end_callback_t end )
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -652,7 +658,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 }
 
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >void sh4</span>_translate_unlink_block( void *use_list )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >static void sh4_x86</span>_translate_unlink_block( void *use_list )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
        uint8_t *tmp = xlat_output; /* In case something is active, which should never happen */
        void *next = use_list;
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/xlat</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>xltcache.c</b></big> <small id="info" style="color: #888888;" >d5ea3e98557b -> 49152b3d8b75</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/xlat/xltcache.c
+++ lxdream/src/xlat/xltcache.c
@@ -69,6 +69,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 static void **xlat_lut[XLAT_LUT_PAGES];
 static gboolean xlat_initialized = FALSE;
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+static xlat_target_fns_t xlat_target = NULL;
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > 
 void xlat_cache_init(void) 
 {
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -93,6 +94,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     xlat_flush_cache();
 }
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void xlat_set_target_fns( xlat_target_fns_t target )
+{
+    xlat_target = target;
+}
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /**
  * Reset the cache structure to its default state
  */
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -131,7 +137,8 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
     block->active = 0;
     *block->lut_entry = block->chain;
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-    sh4_translate_unlink_block( block->use_list );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+    if( block->use_list != NULL )
+        xlat_target->unlink_block(block->use_list);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
 
 static void xlat_flush_page_by_lut( void **page )
</pre></div>
<hr /><a name="file3" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/xlat</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>xltcache.h</b></big> <small id="info" style="color: #888888;" >d5ea3e98557b -> 49152b3d8b75</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/xlat/xltcache.h
+++ lxdream/src/xlat/xltcache.h
@@ -49,6 +49,10 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >     unsigned char code[0];
 } __attribute__((packed));
 
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+typedef struct xlat_target_fns {
+    void (*unlink_block)(void *use_list);
+} *xlat_target_fns_t;
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > typedef struct xlat_cache_block *xlat_cache_block_t;
 
 #define XLAT_BLOCK_FOR_CODE(code) (((xlat_cache_block_t)code)-1)
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -63,6 +67,11 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > void xlat_cache_init(void);
 
 /**
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ * Setup target support.
+ */
+void xlat_set_target_fns( xlat_target_fns_t target_fns );
+
+/**
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >  * Returns the next block in the new cache list that can be written to by the
  * translator.
  */
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>