xref: /freebsd-src/contrib/opencsd/decoder/include/common/ocsd_dcd_mngr_i.h (revision c120c5646da1a1d2c4d90fd069a7e2a8d559eb46)
1*c120c564SAndrew Turner /*
2*c120c564SAndrew Turner  * \file       ocsd_dcd_mngr_i.h
3*c120c564SAndrew Turner  * \brief      OpenCSD : Decoder manager interface.
4*c120c564SAndrew Turner  *
5*c120c564SAndrew Turner  * \copyright  Copyright (c) 2016, ARM Limited. All Rights Reserved.
6*c120c564SAndrew Turner  */
7*c120c564SAndrew Turner 
8*c120c564SAndrew Turner /*
9*c120c564SAndrew Turner  * Redistribution and use in source and binary forms, with or without modification,
10*c120c564SAndrew Turner  * are permitted provided that the following conditions are met:
11*c120c564SAndrew Turner  *
12*c120c564SAndrew Turner  * 1. Redistributions of source code must retain the above copyright notice,
13*c120c564SAndrew Turner  * this list of conditions and the following disclaimer.
14*c120c564SAndrew Turner  *
15*c120c564SAndrew Turner  * 2. Redistributions in binary form must reproduce the above copyright notice,
16*c120c564SAndrew Turner  * this list of conditions and the following disclaimer in the documentation
17*c120c564SAndrew Turner  * and/or other materials provided with the distribution.
18*c120c564SAndrew Turner  *
19*c120c564SAndrew Turner  * 3. Neither the name of the copyright holder nor the names of its contributors
20*c120c564SAndrew Turner  * may be used to endorse or promote products derived from this software without
21*c120c564SAndrew Turner  * specific prior written permission.
22*c120c564SAndrew Turner  *
23*c120c564SAndrew Turner  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
24*c120c564SAndrew Turner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25*c120c564SAndrew Turner  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26*c120c564SAndrew Turner  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27*c120c564SAndrew Turner  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28*c120c564SAndrew Turner  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29*c120c564SAndrew Turner  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30*c120c564SAndrew Turner  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31*c120c564SAndrew Turner  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32*c120c564SAndrew Turner  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33*c120c564SAndrew Turner  */
34*c120c564SAndrew Turner 
35*c120c564SAndrew Turner #ifndef ARM_OCSD_DCD_MNGR_I_H_INCLUDED
36*c120c564SAndrew Turner #define ARM_OCSD_DCD_MNGR_I_H_INCLUDED
37*c120c564SAndrew Turner 
38*c120c564SAndrew Turner #include "opencsd/ocsd_if_types.h"
39*c120c564SAndrew Turner #include "common/trc_cs_config.h"
40*c120c564SAndrew Turner #include "common/trc_component.h"
41*c120c564SAndrew Turner 
42*c120c564SAndrew Turner #include "interfaces/trc_error_log_i.h"
43*c120c564SAndrew Turner #include "interfaces/trc_data_raw_in_i.h"
44*c120c564SAndrew Turner #include "interfaces/trc_instr_decode_i.h"
45*c120c564SAndrew Turner #include "interfaces/trc_tgt_mem_access_i.h"
46*c120c564SAndrew Turner #include "interfaces/trc_gen_elem_in_i.h"
47*c120c564SAndrew Turner #include "interfaces/trc_abs_typed_base_i.h"
48*c120c564SAndrew Turner 
49*c120c564SAndrew Turner class IDecoderMngr
50*c120c564SAndrew Turner {
51*c120c564SAndrew Turner public:
IDecoderMngr()52*c120c564SAndrew Turner     IDecoderMngr() {};
~IDecoderMngr()53*c120c564SAndrew Turner     virtual ~IDecoderMngr() {};
54*c120c564SAndrew Turner 
55*c120c564SAndrew Turner // create and destroy decoders
56*c120c564SAndrew Turner     virtual ocsd_err_t createDecoder(const int create_flags, const int instID, const CSConfig *p_config,  TraceComponent **ppComponent) = 0;
57*c120c564SAndrew Turner     virtual ocsd_err_t destroyDecoder(TraceComponent *pComponent) = 0;
58*c120c564SAndrew Turner 
59*c120c564SAndrew Turner     //! Get the built in protocol type ID managed by this instance - extern for custom decoders
60*c120c564SAndrew Turner     virtual const ocsd_trace_protocol_t getProtocolType() const = 0;
61*c120c564SAndrew Turner 
62*c120c564SAndrew Turner // connect decoders to other components - (replace current /  0 pointer value to detach );
63*c120c564SAndrew Turner // compatible with all decoders
64*c120c564SAndrew Turner     //!attach error logger to ptk-processor, or both of pkt processor and pkt decoder pair
65*c120c564SAndrew Turner     virtual ocsd_err_t attachErrorLogger(TraceComponent *pComponent, ITraceErrorLog *pIErrorLog) = 0;
66*c120c564SAndrew Turner 
67*c120c564SAndrew Turner // pkt decoder only
68*c120c564SAndrew Turner     //! attach instruction decoder to pkt decoder
69*c120c564SAndrew Turner     virtual ocsd_err_t attachInstrDecoder(TraceComponent *pComponent, IInstrDecode *pIInstrDec) = 0;
70*c120c564SAndrew Turner 
71*c120c564SAndrew Turner     //! attach memory accessor to pkt decoder
72*c120c564SAndrew Turner     virtual ocsd_err_t attachMemAccessor(TraceComponent *pComponent, ITargetMemAccess *pMemAccessor) = 0;
73*c120c564SAndrew Turner 
74*c120c564SAndrew Turner     //! attach generic output interface to pkt decoder
75*c120c564SAndrew Turner     virtual ocsd_err_t attachOutputSink(TraceComponent *pComponent, ITrcGenElemIn *pOutSink) = 0;
76*c120c564SAndrew Turner 
77*c120c564SAndrew Turner // pkt processor only
78*c120c564SAndrew Turner     //! attach a raw packet monitor to pkt processor (solo pkt processor, or pkt processor part of pair)
79*c120c564SAndrew Turner     virtual ocsd_err_t attachPktMonitor(TraceComponent *pComponent, ITrcTypedBase *pPktRawDataMon) = 0;
80*c120c564SAndrew Turner 
81*c120c564SAndrew Turner     //! attach a packet indexer to pkt processor (solo pkt processor, or pkt processor part of pair)
82*c120c564SAndrew Turner     virtual ocsd_err_t attachPktIndexer(TraceComponent *pComponent, ITrcTypedBase *pPktIndexer) = 0;
83*c120c564SAndrew Turner 
84*c120c564SAndrew Turner     //! attach a packet data sink to pkt processor output (solo pkt processor only - instead of decoder when pkt processor only created.)
85*c120c564SAndrew Turner     virtual ocsd_err_t attachPktSink(TraceComponent *pComponent, ITrcTypedBase *pPktDataInSink) = 0;
86*c120c564SAndrew Turner 
87*c120c564SAndrew Turner // data input connection interface
88*c120c564SAndrew Turner     //! get raw data input interface from packet processor
89*c120c564SAndrew Turner     virtual ocsd_err_t getDataInputI(TraceComponent *pComponent, ITrcDataIn **ppDataIn) = 0;
90*c120c564SAndrew Turner 
91*c120c564SAndrew Turner // create configuration from data structure
92*c120c564SAndrew Turner     virtual ocsd_err_t createConfigFromDataStruct(CSConfig **pConfigBase, const void *pDataStruct) = 0;
93*c120c564SAndrew Turner 
94*c120c564SAndrew Turner };
95*c120c564SAndrew Turner 
96*c120c564SAndrew Turner #endif // ARM_OCSD_DCD_MNGR_I_H_INCLUDED
97*c120c564SAndrew Turner 
98*c120c564SAndrew Turner /* End of File ocsd_dcd_mngr.h */