revision 1218:be02e87f9f87
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1218:be02e87f9f87 |
parent | 1217:677b1d85f1b4 |
child | 1219:3966d3e55351 |
author | nkeynes |
date | Mon Feb 13 21:02:42 2012 +1000 (12 years ago) |
Move profile_block setting out of sh4x86 and back into sh4.c. Fix last bits
preventing non-translation build
preventing non-translation build
src/main.c | view | annotate | diff | log | ||
src/sh4/sh4.c | view | annotate | diff | log | ||
src/sh4/sh4.h | view | annotate | diff | log | ||
src/sh4/sh4core.h | view | annotate | diff | log | ||
src/sh4/sh4trans.h | view | annotate | diff | log | ||
src/sh4/sh4x86.in | view | annotate | diff | log |
1.1 --- a/src/main.c Mon Feb 13 20:00:27 2012 +10001.2 +++ b/src/main.c Mon Feb 13 21:02:42 2012 +10001.3 @@ -359,12 +359,7 @@1.4 }1.6 sh4_set_core( sh4_core );1.7 -1.8 -#ifdef SH4_TRANSLATOR1.9 - if( sh4_core == SH4_TRANSLATE ) {1.10 - sh4_translate_set_profile_blocks( sh4_profile_blocks );1.11 - }1.12 -#endif1.13 + sh4_set_profile_blocks( sh4_profile_blocks );1.15 /* If requested, start the gdb server immediately before we go into the main1.16 * loop.
2.1 --- a/src/sh4/sh4.c Mon Feb 13 20:00:27 2012 +10002.2 +++ b/src/sh4/sh4.c Mon Feb 13 21:02:42 2012 +10002.3 @@ -148,6 +148,7 @@2.4 int sh4_breakpoint_count = 0;2.6 gboolean sh4_starting = FALSE;2.7 +gboolean sh4_profile_blocks = FALSE;2.8 static gboolean sh4_use_translator = FALSE;2.9 static jmp_buf sh4_exit_jmp_buf;2.10 static gboolean sh4_running = FALSE;2.11 @@ -235,11 +236,12 @@2.12 /* If we were running with the translator, update new_pc and in_delay_slot */2.13 sh4r.new_pc = sh4r.pc+2;2.14 sh4r.in_delay_slot = FALSE;2.15 - if( sh4_translate_get_profile_blocks() ) {2.16 +#ifdef SH4_TRANSLATOR2.17 + if( sh4_profile_blocks ) {2.18 sh4_translate_dump_cache_by_activity(30);2.19 }2.20 +#endif2.21 }2.22 -2.23 }2.25 /**2.26 @@ -408,6 +410,16 @@2.27 sh4r.event_pending = cycles;2.28 }2.30 +void sh4_set_profile_blocks( gboolean flag )2.31 +{2.32 + sh4_profile_blocks = flag;2.33 +}2.34 +2.35 +gboolean sh4_get_profile_blocks( )2.36 +{2.37 + return sh4_profile_blocks;2.38 +}2.39 +2.40 /**2.41 * Dump all SH4 core information for crash-dump purposes2.42 */
3.1 --- a/src/sh4/sh4.h Mon Feb 13 20:00:27 2012 +10003.2 +++ b/src/sh4/sh4.h Mon Feb 13 21:02:42 2012 +10003.3 @@ -151,6 +151,18 @@3.4 /** Dump a translated block with SH4 and target assembly side by side. */3.5 void sh4_translate_dump_block( uint32_t pc );3.7 +/**3.8 + * Enable/disable basic block profiling (Note only supported by translation cores)3.9 + */3.10 +void sh4_set_profile_blocks( gboolean flag );3.11 +3.12 +/**3.13 + * Get the boolean flag indicating whether block profiling is on.3.14 + */3.15 +gboolean sh4_get_profile_blocks();3.16 +3.17 +3.18 +3.19 #ifdef __cplusplus3.20 }3.21 #endif
4.1 --- a/src/sh4/sh4core.h Mon Feb 13 20:00:27 2012 +10004.2 +++ b/src/sh4/sh4core.h Mon Feb 13 21:02:42 2012 +10004.3 @@ -33,6 +33,7 @@4.4 extern struct breakpoint_struct sh4_breakpoints[MAX_BREAKPOINTS];4.5 extern int sh4_breakpoint_count;4.6 extern gboolean sh4_starting;4.7 +extern gboolean sh4_profile_blocks;4.9 /**4.10 * Cached direct pointer to the current instruction page. If AT is on, this
5.1 --- a/src/sh4/sh4trans.h Mon Feb 13 20:00:27 2012 +10005.2 +++ b/src/sh4/sh4trans.h Mon Feb 13 21:02:42 2012 +10005.3 @@ -103,16 +103,6 @@5.4 void sh4_translate_set_fastmem( gboolean flag );5.6 /**5.7 - * Enable/disable basic block profiling5.8 - */5.9 -void sh4_translate_set_profile_blocks( gboolean flag );5.10 -5.11 -/**5.12 - * Get the boolean flag indicating whether block profiling is on.5.13 - */5.14 -gboolean sh4_translate_get_profile_blocks();5.15 -5.16 -/**5.17 * Set the address spaces for the translated code.5.18 */5.19 void sh4_translate_set_address_space( struct mem_region_fn **priv, struct mem_region_fn **user );
6.1 --- a/src/sh4/sh4x86.in Mon Feb 13 20:00:27 2012 +10006.2 +++ b/src/sh4/sh4x86.in Mon Feb 13 21:02:42 2012 +10006.3 @@ -106,7 +106,6 @@6.4 xlat_block_begin_callback_t begin_callback;6.5 xlat_block_end_callback_t end_callback;6.6 gboolean fastmem;6.7 - gboolean profile_blocks;6.9 /* Allocated memory for the (block-wide) back-patch list */6.10 struct backpatch_record *backpatch_list;6.11 @@ -176,7 +175,6 @@6.12 sh4_x86.end_callback = NULL;6.13 sh4_translate_set_address_space( sh4_address_space, sh4_user_address_space );6.14 sh4_x86.fastmem = TRUE;6.15 - sh4_x86.profile_blocks = FALSE;6.16 sh4_x86.sse3_enabled = is_sse3_supported();6.17 x86_disasm_init();6.18 x86_set_symtab( x86_symbol_table, sizeof(x86_symbol_table)/sizeof(struct x86_symbol) );6.19 @@ -194,16 +192,6 @@6.20 sh4_x86.fastmem = flag;6.21 }6.23 -void sh4_translate_set_profile_blocks( gboolean flag )6.24 -{6.25 - sh4_x86.profile_blocks = flag;6.26 -}6.27 -6.28 -gboolean sh4_translate_get_profile_blocks()6.29 -{6.30 - return sh4_x86.profile_blocks;6.31 -}6.32 -6.33 /**6.34 * Disassemble the given translated code block, and it's source SH4 code block6.35 * side-by-side. The current native pc will be marked if non-null.6.36 @@ -522,7 +510,7 @@6.37 if( sh4_x86.begin_callback ) {6.38 CALL_ptr( sh4_x86.begin_callback );6.39 }6.40 - if( sh4_x86.profile_blocks ) {6.41 + if( sh4_profile_blocks ) {6.42 MOVP_immptr_rptr( sh4_x86.code + XLAT_ACTIVE_CODE_OFFSET, REG_EAX );6.43 ADDL_imms_r32disp( 1, REG_EAX, 0 );6.44 }
.