Move deprecated types out of the main C API header into the deprecated header for eventual permanent removal.
Remove #if 0 disabled deprecated code blocks from the C-API source.
Signed-off-by: Mike Leach mike.leach@linaro.org --- decoder/include/c_api/ocsd_c_api_types.h | 49 +--------- decoder/include/c_api/opencsd_c_api.h | 30 +++--- decoder/source/c_api/ocsd_c_api.cpp | 125 ------------------------- decoder/source/c_api/ocsd_c_api_obj.h | 154 ------------------------------- 4 files changed, 18 insertions(+), 340 deletions(-)
diff --git a/decoder/include/c_api/ocsd_c_api_types.h b/decoder/include/c_api/ocsd_c_api_types.h index aa11391..be7316f 100644 --- a/decoder/include/c_api/ocsd_c_api_types.h +++ b/decoder/include/c_api/ocsd_c_api_types.h @@ -89,56 +89,11 @@ typedef void (* FnDefPktDataMon)(const void *p_context, const uint32_t size, const uint8_t *p_data);
-/** function pointer type for ETMv4 instruction packet processor output, packet analyser/decoder input */ -typedef ocsd_datapath_resp_t (* FnEtmv4IPacketDataIn)(const void *p_context, const ocsd_datapath_op_t op, const ocsd_trc_index_t index_sop, const ocsd_etmv4_i_pkt *p_packet_in); - -/** function pointer type for ETMv4 instruction packet processor monitor output, raw packet monitor / display input */ -typedef void (* FnEtmv4IPktMonDataIn)( const void *p_context, - const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const ocsd_etmv4_i_pkt *p_packet_in, - const uint32_t size, - const uint8_t *p_data); - -/** function pointer type for ETMv3 packet processor output, packet analyser/decoder input */ -typedef ocsd_datapath_resp_t (* FnEtmv3PacketDataIn)(const void *p_context, const ocsd_datapath_op_t op, const ocsd_trc_index_t index_sop, const ocsd_etmv3_pkt *p_packet_in); - -/** function pointer type for ETMv3 packet processor monitor output, raw packet monitor / display input */ -typedef void (* FnEtmv3PktMonDataIn)( const void *p_context, - const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const ocsd_etmv3_pkt *p_packet_in, - const uint32_t size, - const uint8_t *p_data); - - -/** function pointer type for PTM packet processor output, packet analyser/decoder input */ -typedef ocsd_datapath_resp_t (* FnPtmPacketDataIn)(const void *p_context, const ocsd_datapath_op_t op, const ocsd_trc_index_t index_sop, const ocsd_ptm_pkt *p_packet_in); - -/** function pointer type for PTM packet processor monitor output, raw packet monitor / display input */ -typedef void (* FnPtmPktMonDataIn)( const void *p_context, - const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const ocsd_ptm_pkt *p_packet_in, - const uint32_t size, - const uint8_t *p_data); - - -/** function pointer type for STM packet processor output, packet analyser/decoder input */ -typedef ocsd_datapath_resp_t (* FnStmPacketDataIn)(const void *p_context, const ocsd_datapath_op_t op, const ocsd_trc_index_t index_sop, const ocsd_stm_pkt *p_packet_in); - -/** function pointer type for STM packet processor monitor output, raw packet monitor / display input */ -typedef void (* FnStmPktMonDataIn)( const void *p_context, - const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const ocsd_stm_pkt *p_packet_in, - const uint32_t size, - const uint8_t *p_data);
/** Callback interface type when attaching monitor/sink to packet processor */ typedef enum _ocsd_c_api_cb_types { - OCSD_C_API_CB_PKT_SINK, - OCSD_C_API_CB_PKT_MON, + OCSD_C_API_CB_PKT_SINK, /** Attach to the packet processor primary packet output (CB fn is FnDefPktDataIn) */ + OCSD_C_API_CB_PKT_MON, /** Attach to the packet processor packet monitor output (CB fn is FnDefPktDataMon) */ } ocsd_c_api_cb_types;
/** @}*/ diff --git a/decoder/include/c_api/opencsd_c_api.h b/decoder/include/c_api/opencsd_c_api.h index 061bfe4..c40c20f 100644 --- a/decoder/include/c_api/opencsd_c_api.h +++ b/decoder/include/c_api/opencsd_c_api.h @@ -126,7 +126,7 @@ OCSD_C_API void ocsd_destroy_dcd_tree(const dcd_tree_handle_t handle); * @param *pDataBlock : Pointer to data block. * @param *numBytesProcessed : Number of bytes actually processed by the decoder. * - * @return ocsd_datapath_resp_t : Datapath response code + * @return ocsd_datapath_resp_t : Datapath response code (CONT/WAIT/FATAL) */ OCSD_C_API ocsd_datapath_resp_t ocsd_dt_process_data(const dcd_tree_handle_t handle, const ocsd_datapath_op_t op, @@ -156,15 +156,18 @@ OCSD_C_API ocsd_err_t ocsd_dt_set_gen_elem_outfn(const dcd_tree_handle_t handle,
/*---------------------- Trace Decoders ----------------------------------------------------------------------------------*/ /*! -* <Detailed description of the method> +* Creates a decoder that is registered with the library under the supplied name. +* Flags determine if a full packet processor / packet decoder pair or +* packet processor only is created. +* Uses the supplied configuration structure. * * @param handle : Handle to decode tree. -* @param *decoder_name : -* @param create_flags : -* @param *decoder_cfg : +* @param *decoder_name : Registered name of the decoder to create. +* @param create_flags : Decoder creation options. +* @param *decoder_cfg : Pointer to a valid configuration structure for the named decoder. * @param *pCSID : Pointer to location to return the configured CoreSight trace ID for the decoder. * -* @return ocsd_err_t : +* @return ocsd_err_t : Library error code - OCSD_OK if successful. */ OCSD_C_API ocsd_err_t ocsd_dt_create_decoder(const dcd_tree_handle_t handle, const char *decoder_name, @@ -174,12 +177,12 @@ OCSD_C_API ocsd_err_t ocsd_dt_create_decoder(const dcd_tree_handle_t handle, );
/*! -* <Detailed description of the method> +* Remove a decoder from the tree and destroy it. * * @param handle : Handle to decode tree. * @param CSID : Configured CoreSight trace ID for the decoder. * -* @return ocsd_err_t : +* @return ocsd_err_t : Library error code - OCSD_OK if successful. */ OCSD_C_API ocsd_err_t ocsd_dt_remove_decoder( const dcd_tree_handle_t handle, const unsigned char CSID); @@ -188,16 +191,16 @@ OCSD_C_API ocsd_err_t ocsd_dt_remove_decoder( const dcd_tree_handle_t handle, /*! * Attach a callback function to the packet processor. * -* The callback_type defines the attachment point:- +* The callback_type defines the attachment point, either the main packet output +* (only if no decoder attached), or the packet monitor. * -* * @param handle : Handle to decode tree. * @param CSID : Configured CoreSight trace ID for the decoder. -* @param callback_type : +* @param callback_type : Attachment point * @param p_fn_pkt_data_in : Pointer to the callback function. * @param p_context : Opaque context pointer value used in callback function. * -* @return ocsd_err_t : +* @return ocsd_err_t : Library error code - OCSD_OK if successful. */ OCSD_C_API ocsd_err_t ocsd_dt_attach_packet_callback( const dcd_tree_handle_t handle, const unsigned char CSID, @@ -208,8 +211,7 @@ OCSD_C_API ocsd_err_t ocsd_dt_attach_packet_callback( const dcd_tree_handle_t h
- -/** TBD : more C API functions to be added here */ +
/** @}*/ /*---------------------- Memory Access for traced opcodes ----------------------------------------------------------------------------------*/ diff --git a/decoder/source/c_api/ocsd_c_api.cpp b/decoder/source/c_api/ocsd_c_api.cpp index 335bbe5..dcea304 100644 --- a/decoder/source/c_api/ocsd_c_api.cpp +++ b/decoder/source/c_api/ocsd_c_api.cpp @@ -498,129 +498,4 @@ ocsd_datapath_resp_t GenTraceElemCBObj::TraceElemIn(const ocsd_trc_index_t index return m_c_api_cb_fn(m_p_cb_context, index_sop, trc_chan_id, &elem); }
- -#if 0 - -/****************** Etmv4 packet processor output callback function ************/ -EtmV4ICBObj::EtmV4ICBObj(FnEtmv4IPacketDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -ocsd_datapath_resp_t EtmV4ICBObj::PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV4ITrcPacket *p_packet_in) -{ - return m_c_api_cb_fn(m_p_cb_context, op,index_sop,p_packet_in); -} - -/****************** Etmv4 packet processor monitor callback function ***********/ -EtmV4IPktMonCBObj::EtmV4IPktMonCBObj(FnEtmv4IPktMonDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -void EtmV4IPktMonCBObj::RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV4ITrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data) -{ - return m_c_api_cb_fn(m_p_cb_context, op, index_sop, p_packet_in, size, p_data); -} - -/****************** Etmv3 packet processor output callback function ************/ -EtmV3CBObj::EtmV3CBObj(FnEtmv3PacketDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -ocsd_datapath_resp_t EtmV3CBObj::PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV3TrcPacket *p_packet_in) -{ - return m_c_api_cb_fn(m_p_cb_context, op,index_sop,*p_packet_in); -} - -/****************** Etmv3 packet processor monitor callback function ***********/ -EtmV3PktMonCBObj::EtmV3PktMonCBObj(FnEtmv3PktMonDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -void EtmV3PktMonCBObj::RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV3TrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data) -{ - return m_c_api_cb_fn(m_p_cb_context, op, index_sop, *p_packet_in, size, p_data); -} - - -/****************** Ptm packet processor output callback function ************/ -PtmCBObj::PtmCBObj(FnPtmPacketDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -ocsd_datapath_resp_t PtmCBObj::PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const PtmTrcPacket *p_packet_in) -{ - return m_c_api_cb_fn(m_p_cb_context, op,index_sop,p_packet_in); -} - -/****************** Ptm packet processor monitor callback function ***********/ -PtmPktMonCBObj::PtmPktMonCBObj(FnPtmPktMonDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -void PtmPktMonCBObj::RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const PtmTrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data) -{ - return m_c_api_cb_fn(m_p_cb_context, op, index_sop, p_packet_in, size, p_data); -} - -/****************** Stm packet processor output callback function ************/ -StmCBObj::StmCBObj(FnStmPacketDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -ocsd_datapath_resp_t StmCBObj::PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const StmTrcPacket *p_packet_in) -{ - return m_c_api_cb_fn(m_p_cb_context, op,index_sop,p_packet_in); -} - -/****************** Stm packet processor monitor callback function ***********/ -StmPktMonCBObj::StmPktMonCBObj(FnStmPktMonDataIn pCBFn, const void *p_context) : - m_c_api_cb_fn(pCBFn), - m_p_cb_context(p_context) -{ -} - -void StmPktMonCBObj::RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const StmTrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data) -{ - return m_c_api_cb_fn(m_p_cb_context, op, index_sop, p_packet_in, size, p_data); -} -#endif - /* End of File ocsd_c_api.cpp */ diff --git a/decoder/source/c_api/ocsd_c_api_obj.h b/decoder/source/c_api/ocsd_c_api_obj.h index dbe6d08..e6f901d 100644 --- a/decoder/source/c_api/ocsd_c_api_obj.h +++ b/decoder/source/c_api/ocsd_c_api_obj.h @@ -87,160 +87,6 @@ private: const void *m_p_context; };
-#if 0 - -/************************************************************************/ -/*** ETMv4 ***/ -/************************************************************************/ - -class EtmV4ICBObj : public IPktDataIn<EtmV4ITrcPacket>, public TraceElemCBBase -{ -public: - EtmV4ICBObj(FnEtmv4IPacketDataIn pCBFn, const void *p_context); - virtual ~EtmV4ICBObj() {}; - - virtual ocsd_datapath_resp_t PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV4ITrcPacket *p_packet_in); - -private: - - FnEtmv4IPacketDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - - -class EtmV4IPktMonCBObj : public IPktRawDataMon<EtmV4ITrcPacket>, public TraceElemCBBase -{ -public: - EtmV4IPktMonCBObj(FnEtmv4IPktMonDataIn pCBFn, const void *p_context); - virtual ~EtmV4IPktMonCBObj() {}; - - virtual void RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV4ITrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data); - -private: - FnEtmv4IPktMonDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - -/************************************************************************/ -/*** ETMv3 ***/ -/************************************************************************/ - -class EtmV3CBObj : public IPktDataIn<EtmV3TrcPacket>, public TraceElemCBBase -{ -public: - EtmV3CBObj(FnEtmv3PacketDataIn pCBFn, const void *p_context); - virtual ~EtmV3CBObj() {}; - - virtual ocsd_datapath_resp_t PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV3TrcPacket *p_packet_in); - -private: - - FnEtmv3PacketDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - -class EtmV3PktMonCBObj : public IPktRawDataMon<EtmV3TrcPacket>, public TraceElemCBBase -{ -public: - EtmV3PktMonCBObj(FnEtmv3PktMonDataIn pCBFn, const void *p_context); - virtual ~EtmV3PktMonCBObj() {}; - - virtual void RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const EtmV3TrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data); - -private: - FnEtmv3PktMonDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - - -/************************************************************************/ -/*** PTM ***/ -/************************************************************************/ - -class PtmCBObj : public IPktDataIn<PtmTrcPacket>, public TraceElemCBBase -{ -public: - PtmCBObj(FnPtmPacketDataIn pCBFn, const void *p_context); - virtual ~PtmCBObj() {}; - - virtual ocsd_datapath_resp_t PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const PtmTrcPacket *p_packet_in); - -private: - - FnPtmPacketDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - -class PtmPktMonCBObj : public IPktRawDataMon<PtmTrcPacket>, public TraceElemCBBase -{ -public: - PtmPktMonCBObj(FnPtmPktMonDataIn pCBFn, const void *p_context); - virtual ~PtmPktMonCBObj() {}; - - virtual void RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const PtmTrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data); - -private: - FnPtmPktMonDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - - -/************************************************************************/ -/*** STM ***/ -/************************************************************************/ - -class StmCBObj : public IPktDataIn<StmTrcPacket>, public TraceElemCBBase -{ -public: - StmCBObj(FnStmPacketDataIn pCBFn, const void *p_context); - virtual ~StmCBObj() {}; - - virtual ocsd_datapath_resp_t PacketDataIn( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const StmTrcPacket *p_packet_in); - -private: - FnStmPacketDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - -class StmPktMonCBObj : public IPktRawDataMon<StmTrcPacket>, public TraceElemCBBase -{ -public: - StmPktMonCBObj(FnStmPktMonDataIn pCBFn, const void *p_context); - virtual ~StmPktMonCBObj() {}; - - virtual void RawPacketDataMon( const ocsd_datapath_op_t op, - const ocsd_trc_index_t index_sop, - const StmTrcPacket *p_packet_in, - const uint32_t size, - const uint8_t *p_data); - -private: - FnStmPktMonDataIn m_c_api_cb_fn; - const void *m_p_cb_context; -}; - -#endif - #endif // ARM_OCSD_C_API_OBJ_H_INCLUDED
/* End of File ocsd_c_api_obj.h */