--- tme/ic/m68k/m68k-insns-auto.sh 2018/04/24 16:41:57 1.1.1.4 +++ tme/ic/m68k/m68k-insns-auto.sh 2018/04/24 16:43:48 1.1.1.5 @@ -1,6 +1,6 @@ #! /bin/sh -# $Id: m68k-insns-auto.sh,v 1.1.1.4 2018/04/24 16:41:57 root Exp $ +# $Id: m68k-insns-auto.sh,v 1.1.1.5 2018/04/24 16:43:48 root Exp $ # ic/m68k/m68k-insns-auto.sh - automatically generates C code # for many m68k emulation instructions: @@ -48,7 +48,7 @@ done PROG=`basename $0` cat <_tme_m68k_bus_context;" echo -n " unsigned int function_code = " if test "x${fc}" != x; then echo "${fc};" @@ -1331,10 +1332,13 @@ for size in 8 16 32 any; do fi echo " & linear_address${_first}) == 0" fi - echo "${i} && TME_M68K_TLB_OK_FAST_${capname}(tlb," - echo "${i} function_code," - echo "${i} linear_address${_first}," - echo "${i} linear_address${_last}))) {" + echo "${i} && tme_m68k_tlb_is_valid(tlb)" + echo "${i} && tlb->tme_m68k_tlb_bus_context == bus_context" + echo "${i} && (tlb->tme_m68k_tlb_function_codes_mask" + echo "${i} & TME_BIT(function_code))" + echo "${i} && linear_address${_first} >= (tme_bus_addr32_t) tlb->tme_m68k_tlb_linear_first" + echo "${i} && linear_address${_last} <= (tme_bus_addr32_t) tlb->tme_m68k_tlb_linear_last" + echo "${i} && tlb->tme_m68k_tlb_emulator_off_${name} != TME_EMULATOR_OFF_UNDEF)) {" echo "" echo "${i} /* make the emulator memory pointer: */" @@ -1617,10 +1621,11 @@ for size in 8 16 32 any; do echo "" echo " /* loop while this TLB entry is invalid or does not apply: */" - echo " for (; __tme_predict_false(tme_bus_tlb_is_invalid(&tlb->tme_m68k_tlb_bus_tlb)" + echo " for (; __tme_predict_false(tme_m68k_tlb_is_invalid(tlb)" + echo " || tlb->tme_m68k_tlb_bus_context != ic->_tme_m68k_bus_context" echo " || (tlb->tme_m68k_tlb_function_codes_mask & TME_BIT(function_code)) == 0" - echo " || linear_address < tlb->tme_m68k_tlb_linear_first" - echo " || linear_address > tlb->tme_m68k_tlb_linear_last" + echo " || linear_address < (tme_bus_addr32_t) tlb->tme_m68k_tlb_linear_first" + echo " || linear_address > (tme_bus_addr32_t) tlb->tme_m68k_tlb_linear_last" echo " || (tlb->tme_m68k_tlb_emulator_off_${name} == TME_EMULATOR_OFF_UNDEF" echo " && (tlb->tme_m68k_tlb_cycles_ok & TME_BUS_CYCLE_${capname}) == 0)); ) {" echo "" @@ -1643,8 +1648,8 @@ for size in 8 16 32 any; do echo "" echo " /* limit the cycle size to addresses covered by the TLB entry: */" echo " if (__tme_predict_false((cycle_size - 1)" - echo " > (tlb->tme_m68k_tlb_linear_last - linear_address))) {" - echo " cycle_size = (tlb->tme_m68k_tlb_linear_last - linear_address) + 1;" + echo " > (((tme_bus_addr32_t) tlb->tme_m68k_tlb_linear_last) - linear_address))) {" + echo " cycle_size = (((tme_bus_addr32_t) tlb->tme_m68k_tlb_linear_last) - linear_address) + 1;" echo " }" echo "" echo " /* if this is a little-endian host, and this isn't a raw ${name}: */" @@ -1738,7 +1743,7 @@ for size in 8 16 32 any; do echo "" echo " /* if the TLB entry was invalidated before the ${name}: */" echo " if (err == EBADF" - echo " && tme_bus_tlb_is_invalid(&tlb->tme_m68k_tlb_bus_tlb)) {" + echo " && tme_m68k_tlb_is_invalid(tlb)) {" echo " cycle.tme_bus_cycle_size = 0;" echo " }" echo ""