A number of code blocks were disabled from compilation using #if 0 blocks.
These were either deprecated code that should have been removed once the new code was tested, or proposed 'future' ideas yet to be implemented.
All these blocks have been removed from the source.
Signed-off-by: Mike Leach mike.leach@linaro.org --- decoder/include/trc_gen_elem_types.h | 9 +--- decoder/source/etmv4/trc_pkt_proc_etmv4.cpp | 73 ----------------------------- decoder/source/i_dec/trc_idec_arminst.cpp | 33 ------------- decoder/source/trc_frame_deformatter.cpp | 20 +------- decoder/source/trc_frame_deformatter_impl.h | 10 ---- decoder/tests/source/simple_pkt_c_api.c | 24 +--------- 6 files changed, 3 insertions(+), 166 deletions(-)
diff --git a/decoder/include/trc_gen_elem_types.h b/decoder/include/trc_gen_elem_types.h index 3f3108e..66d8d79 100644 --- a/decoder/include/trc_gen_elem_types.h +++ b/decoder/include/trc_gen_elem_types.h @@ -58,14 +58,7 @@ typedef enum _ocsd_gen_trc_elem_t OCSD_GEN_TRC_ELEM_EXCEPTION_RET, /*!< expection return */ OCSD_GEN_TRC_ELEM_TIMESTAMP, /*!< Timestamp - preceding elements happeded before this time. */ OCSD_GEN_TRC_ELEM_CYCLE_COUNT, /*!< Cycle count - cycles since last cycle count value - associated with a preceding instruction range. */ - OCSD_GEN_TRC_ELEM_EVENT, /*!< Event - trigger, (TBC - perhaps have a set of event types - cut down additional processing?) */ -#if 0 - OCSD_GEN_TRC_ELEM_DATA_VAL, /*!< Data value - associated with prev instr (if same stream) + daddr, or data assoc key if supplied. */ - OCSD_GEN_TRC_ELEM_DATA_ADDR, /*!< Data address - associated with prev instr (if same stream), or data assoc key if supplied. */ - OCSD_GEN_TRC_ELEM_SWCHAN_DATA, /*!< data out on a SW channel (master, ID, data, type etc). */ - OCSD_GEN_TRC_ELEM_BUS_TRANSFER, /*!< Bus transfer event from a bus trace module (HTM) */ -#endif - + OCSD_GEN_TRC_ELEM_EVENT, /*!< Event - trigger, (TBC - perhaps have a set of event types - cut down additional processing?) */ } ocsd_gen_trc_elem_t;
diff --git a/decoder/source/etmv4/trc_pkt_proc_etmv4.cpp b/decoder/source/etmv4/trc_pkt_proc_etmv4.cpp index e5df23a..09d8c84 100644 --- a/decoder/source/etmv4/trc_pkt_proc_etmv4.cpp +++ b/decoder/source/etmv4/trc_pkt_proc_etmv4.cpp @@ -35,17 +35,14 @@
#include "etmv4/trc_pkt_proc_etmv4.h" #include "trc_pkt_proc_etmv4i_impl.h" -#include "trc_pkt_proc_etmv4d_impl.h" #include "common/ocsd_error.h"
#ifdef __GNUC__ // G++ doesn't like the ## pasting #define ETMV4I_PKTS_NAME "PKTP_ETMV4I" -#define ETMV4D_PKTS_NAME "PKTP_ETMV4D" #else // VC++ is fine #define ETMV4I_PKTS_NAME OCSD_CMPNAME_PREFIX_PKTPROC##"_ETMV4I" -#define ETMV4D_PKTS_NAME OCSD_CMPNAME_PREFIX_PKTPROC##"_ETMV4D" #endif
static const uint32_t ETMV4_SUPPORTED_OP_FLAGS = OCSD_OPFLG_PKTPROC_COMMON; @@ -126,74 +123,4 @@ const bool TrcPktProcEtmV4I::isBadPacket() const return false; }
-/***************************************************************************/ -/*******************ETM V4 DATA ********************************************/ -/***************************************************************************/ - -#if 0 -TrcPktProcEtmV4D::TrcPktProcEtmV4D() : TrcPktProcBase(ETMV4I_PKTS_NAME), - m_pProcessor(0) -{ -} - -TrcPktProcEtmV4D::TrcPktProcEtmV4D(int instIDNum) : TrcPktProcBase(ETMV4I_PKTS_NAME, instIDNum), - m_pProcessor(0) -{ -} - -TrcPktProcEtmV4D::~TrcPktProcEtmV4D() -{ - if(m_pProcessor) - delete m_pProcessor; - m_pProcessor = 0; -} - -ocsd_err_t TrcPktProcEtmV4D::onProtocolConfig() -{ - if(m_pProcessor == 0) - { - m_pProcessor = new (std::nothrow) EtmV4DPktProcImpl(); - if(m_pProcessor == 0) - { - LogError(ocsdError(OCSD_ERR_SEV_ERROR,OCSD_ERR_MEM)); - return OCSD_ERR_MEM; - } - m_pProcessor->Initialise(this); - } - return m_pProcessor->Configure(m_config); -} - -ocsd_datapath_resp_t TrcPktProcEtmV4D::processData( const ocsd_trc_index_t index, - const uint32_t dataBlockSize, - const uint8_t *pDataBlock, - uint32_t *numBytesProcessed) -{ - if(m_pProcessor) - return m_pProcessor->processData(index,dataBlockSize,pDataBlock,numBytesProcessed); - return OCSD_RESP_FATAL_NOT_INIT; -} - -ocsd_datapath_resp_t TrcPktProcEtmV4D::onEOT() -{ - if(m_pProcessor) - return m_pProcessor->onEOT(); - return OCSD_RESP_FATAL_NOT_INIT; -} - -ocsd_datapath_resp_t TrcPktProcEtmV4D::onReset() -{ - if(m_pProcessor) - return m_pProcessor->onReset(); - return OCSD_RESP_FATAL_NOT_INIT; -} - -ocsd_datapath_resp_t TrcPktProcEtmV4D::onFlush() -{ - if(m_pProcessor) - return m_pProcessor->onFlush(); - return OCSD_RESP_FATAL_NOT_INIT; -} - -#endif - /* End of File trc_pkt_proc_etmv4.cpp */ diff --git a/decoder/source/i_dec/trc_idec_arminst.cpp b/decoder/source/i_dec/trc_idec_arminst.cpp index 2a41d4d..ed7eb24 100644 --- a/decoder/source/i_dec/trc_idec_arminst.cpp +++ b/decoder/source/i_dec/trc_idec_arminst.cpp @@ -102,14 +102,6 @@ int inst_ARM_is_indirect_branch(uint32_t inst) } else if ((inst & 0x0f9000f0) == 0x01800090) { /* Some extended loads and stores */ is_indirect_branch = 0; -#if 0 - } else if ((inst & 0x0ff000f0) == 0x01200070) { - /* BKPT */ - is_indirect_branch = 0; - } else if ((inst & 0x0fb0f0f0) == 0x0120f000) { - /* MSR CPSR/SPSR,rx - appears to write PC, but is special */ - is_indirect_branch = 0; -#endif } else if ((inst & 0x0fb0f000) == 0x0320f000) { /* MSR #imm */ is_indirect_branch = 0; @@ -324,26 +316,6 @@ int inst_A64_branch_destination(uint64_t addr, uint32_t inst, uint64_t *pnpc) return is_direct_branch; }
- -#if 0 -int inst_ARM_is_direct_branch(uint32_t inst) -{ - return inst_ARM_branch_destination(0, inst, NULL); -} - - -int inst_Thumb_is_direct_branch(uint32_t inst) -{ - return inst_Thumb_branch_destination(0, inst, NULL); -} - -int inst_A64_is_direct_branch(uint32_t inst) -{ - return inst_A64_branch_destination(0, inst, NULL); -} -#endif - - int inst_ARM_is_branch(uint32_t inst) { return inst_ARM_is_indirect_branch(inst) || @@ -478,11 +450,6 @@ int inst_A64_is_conditional(uint32_t inst) } else if ((inst & 0xff000010) == 0x54000000) { /* B.cond */ return 1; -#if 0 - } else if ((inst & 0x3fe00000) == 0x1a800000) { - /* CSEL */ -#endif - return 1; } return 0; } diff --git a/decoder/source/trc_frame_deformatter.cpp b/decoder/source/trc_frame_deformatter.cpp index 07bed6f..57a7197 100644 --- a/decoder/source/trc_frame_deformatter.cpp +++ b/decoder/source/trc_frame_deformatter.cpp @@ -393,25 +393,7 @@ bool TraceFmtDcdImpl::checkForSync() uint32_t TraceFmtDcdImpl::findfirstFSync() { uint32_t unsynced = m_in_block_size; // consider entire block as unsynced at present. -#if 0 - if(m_match_fsync.patternSize() == 0) - { - uint8_t pattern[] = { 0xFF, 0xFF, 0xFF, 0x7F }; - if(!m_match_fsync.setPattern(pattern,sizeof(pattern))) - { - ocsdError err(OCSD_ERR_SEV_ERROR, OCSD_ERR_NOT_INIT); - err.setMessage("Failed to set pattern in FSYNC matcher."); - throw ocsdError(&err); - } - } - - // find an FSYNC - if(m_match_fsync.checkBuffer(m_in_block_base,m_in_block_size)) - { - unsynced = m_match_fsync.pos(); // number of unsynced bytes is the position in the buffer. - m_frame_synced = true; - } -#endif + //**TBD - handle fsync patterns in TPIU captured code return unsynced; }
diff --git a/decoder/source/trc_frame_deformatter_impl.h b/decoder/source/trc_frame_deformatter_impl.h index c9e5d3f..8e3f1ba 100644 --- a/decoder/source/trc_frame_deformatter_impl.h +++ b/decoder/source/trc_frame_deformatter_impl.h @@ -42,11 +42,6 @@ #include "interfaces/trc_indexer_src_i.h" #include "common/trc_component.h"
-#if 0 -#include "blk_pattern_match.h" -#endif - - //! output data fragment from the current frame - collates bytes associated with an ID. typedef struct _out_chan_data { ocsd_trc_index_t index; //!< trace source index for start of these bytes @@ -163,11 +158,6 @@ private: bool m_b_output_unpacked_raw;
bool m_raw_chan_enable[128]; - -#if 0 - /* pattern match for fsyncs */ - BlkPatternMatch m_match_fsync; -#endif };
diff --git a/decoder/tests/source/simple_pkt_c_api.c b/decoder/tests/source/simple_pkt_c_api.c index 32312b8..1deb18f 100644 --- a/decoder/tests/source/simple_pkt_c_api.c +++ b/decoder/tests/source/simple_pkt_c_api.c @@ -738,31 +738,9 @@ static ocsd_err_t create_decoder_stm(dcd_tree_handle_t dcd_tree_h) { /* Full decode */ /* not supported in library at present */ - -#if 0 - /* create the packet decoder and packet processor pair */ - ret = ocsd_dt_create_stm_decoder(dcd_tree_h,&trace_config_stm); - if(ret == OCSD_OK) - { - if((op != TEST_PKT_DECODEONLY) && (ret == OCSD_OK)) - { - ret = ocsd_dt_attach_stm_pkt_mon(dcd_tree_h, (uint8_t)((trace_config_stm.reg_tcsr & STMTCSR_TRC_ID_MASK) >> STMTCSR_TRC_ID_SHIFT), stm_packet_monitor); - } - } - - /* trace data file path */ - strcpy(mem_file_path,); - strcat(mem_file_path,memory_dump_filename); - - if(ret == OCSD_OK) - { - /* create a memory file accessor */ - ret = ocsd_dt_add_binfile_mem_acc(dcd_tree_h,mem_dump_address,OCSD_MEM_SPACE_ANY,mem_file_path); - } -#else + printf("STM Full decode not supported in library at present. Packet print only\n"); ret = OCSD_ERR_RDR_NO_DECODER; -#endif } return ret; }