1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/dosbox/ppc64le-dynrec-cache.diff
3 # Copyright (C) 2024 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 Index: src/cpu/core_dynrec/cache.h
15 ===================================================================
16 --- ./src/cpu/core_dynrec/cache.h (revision 4296)
17 +++ ./src/cpu/core_dynrec/cache.h (working copy)
20 static void dyn_return(BlockReturn retcode,bool ret_exception);
21 static void dyn_run_code(void);
22 +static void cache_block_closing(Bit8u* block_start,Bitu block_size);
25 /* Define temporary pagesize so the MPROTECT case and the regular case share as much code as possible */
27 #define PAGESIZE_TEMP PAGESIZE
30 // setup the default blocks for block linkage returns
31 cache.pos=&cache_code_link_blocks[0];
32 + core_dynrec.runcode=(BlockReturn (*)(Bit8u*))cache.pos;
33 + // can use op to PAGESIZE_TEMP-64 bytes
35 + cache_block_closing(cache_code_link_blocks, cache.pos-cache_code_link_blocks);
37 + cache.pos=&cache_code_link_blocks[PAGESIZE_TEMP-64];
38 link_blocks[0].cache.start=cache.pos;
39 // link code that returns with a special return code
40 + // must be less than 32 bytes
41 dyn_return(BR_Link1,false);
42 - cache.pos=&cache_code_link_blocks[32];
43 + cache_block_closing(link_blocks[0].cache.start, cache.pos-link_blocks[0].cache.start);
45 + cache.pos=&cache_code_link_blocks[PAGESIZE_TEMP-32];
46 link_blocks[1].cache.start=cache.pos;
47 // link code that returns with a special return code
48 + // must be less than 32 bytes
49 dyn_return(BR_Link2,false);
50 + cache_block_closing(link_blocks[1].cache.start, cache.pos-link_blocks[1].cache.start);
52 - cache.pos=&cache_code_link_blocks[64];
53 - core_dynrec.runcode=(BlockReturn (*)(Bit8u*))cache.pos;
54 -// link_blocks[1].cache.start=cache.pos;