Loading...
Searching...
No Matches
ocsd_if_types.h File Reference

OpenCSD : Standard Types used in the library interfaces. More...

`#include <stdint.h>`
`#include <stddef.h>`
`#include <inttypes.h>`
Include dependency graph for ocsd_if_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes

struct | _ocsd_arch_profile_t
struct | _ocsd_instr_info
struct | _ocsd_pe_context
struct | _ocsd_file_mem_region
struct | _ocsd_swt_info
struct | _ocsd_demux_stats
struct | _ocsd_decode_stats

## Macros

Trace Decode Component Name Prefixes
Set of standard prefixes to be used for component names
#define | OCSD_CMPNAME_PREFIX_SOURCE_READER "SRDR"
#define | OCSD_CMPNAME_PREFIX_FRAMEDEFORMATTER "DFMT"
#define | OCSD_CMPNAME_PREFIX_PKTPROC "PKTP"
#define | OCSD_CMPNAME_PREFIX_PKTDEC "PDEC"
Packet Processor Operation Control Flags
common operational flags - bottom 16 bits, protocol component specific - top 16 bits. (common flags share bitfield with pkt decoder common flags and create flags)
#define | OCSD_OPFLG_PKTPROC_NOFWD_BAD_PKTS 0x00000010
#define | OCSD_OPFLG_PKTPROC_NOMON_BAD_PKTS 0x00000020
#define | OCSD_OPFLG_PKTPROC_ERR_BAD_PKTS 0x00000040
#define | OCSD_OPFLG_PKTPROC_UNSYNC_ON_BAD_PKTS 0x00000080
#define | OCSD_OPFLG_PKTPROC_COMMON
#define | OCSD_OPFLG_COMP_MODE_MASK 0xFFFF0000
Packet Decoder Operation Control Flags
common operational flags - bottom 16 bits, protcol component specific - top 16 bits. (common flags share bitfield with pkt processor common flags and create flags)
#define | OCSD_OPFLG_PKTDEC_ERROR_BAD_PKTS 0x00000100
#define | OCSD_OPFLG_PKTDEC_HALT_BAD_PKTS 0x00000200
#define | OCSD_OPFLG_PKTDEC_COMMON (OCSD_OPFLG_PKTDEC_ERROR_BAD_PKTS | OCSD_OPFLG_PKTDEC_HALT_BAD_PKTS)

## Typedefs

Demux Statistics
Contains statistics for the CoreSight frame demultiplexor. Counts total bytes sent to decoders registered against a trace ID, bytes in the input stream that are associated with a trace ID that has no registered decoder, and frame bytes that are not trace data, but are used to decode the frames - ID bytes, sync bytes etc.
typedef struct _ocsd_demux_stats | ocsd_demux_stats_t

## Trace Indexing and Channel IDs

#define | OCSD_TRC_IDX_STR PRIu32
#define | OCSD_BAD_TRC_INDEX ((ocsd_trc_index_t)-1)
#define | OCSD_BAD_CS_SRC_ID ((uint8_t)-1)
#define | OCSD_IS_VALID_CS_SRC_ID(id) ((id > 0) && (id < 0x70))
#define | OCSD_IS_RESERVED_CS_SRC_ID(id) ((id == 0) || ((id >= 0x70) && (id <= 0x7F))
typedef uint32_t | ocsd_trc_index_t

## General Library Return and Error Codes

#define | OCSD_INVALID_HANDLE (unsigned int)-1

enum

_ocsd_err_t {
OCSD_OK = 0 , OCSD_ERR_FAIL , OCSD_ERR_MEM , OCSD_ERR_NOT_INIT ,
OCSD_ERR_INVALID_ID , OCSD_ERR_BAD_HANDLE , OCSD_ERR_INVALID_PARAM_VAL , OCSD_ERR_INVALID_PARAM_TYPE ,
OCSD_ERR_FILE_ERROR , OCSD_ERR_NO_PROTOCOL , OCSD_ERR_ATTACH_TOO_MANY , OCSD_ERR_ATTACH_INVALID_PARAM ,
OCSD_ERR_ATTACH_COMP_NOT_FOUND , OCSD_ERR_RDR_FILE_NOT_FOUND , OCSD_ERR_RDR_INVALID_INIT , OCSD_ERR_RDR_NO_DECODER ,
OCSD_ERR_DATA_DECODE_FATAL , OCSD_ERR_DFMTR_NOTCONTTRACE , OCSD_ERR_DFMTR_BAD_FHSYNC , OCSD_ERR_BAD_PACKET_SEQ ,
OCSD_ERR_INVALID_PCKT_HDR , OCSD_ERR_PKT_INTERP_FAIL , OCSD_ERR_UNSUPPORTED_ISA , OCSD_ERR_HW_CFG_UNSUPP ,
OCSD_ERR_UNSUPP_DECODE_PKT , OCSD_ERR_BAD_DECODE_PKT , OCSD_ERR_COMMIT_PKT_OVERRUN , OCSD_ERR_MEM_NACC ,
OCSD_ERR_RET_STACK_OVERFLOW , OCSD_ERR_DCDT_NO_FORMATTER , OCSD_ERR_MEM_ACC_OVERLAP , OCSD_ERR_MEM_ACC_FILE_NOT_FOUND ,
OCSD_ERR_MEM_ACC_FILE_DIFF_RANGE , OCSD_ERR_MEM_ACC_RANGE_INVALID , OCSD_ERR_MEM_ACC_BAD_LEN , OCSD_ERR_TEST_SNAPSHOT_PARSE ,
OCSD_ERR_TEST_SNAPSHOT_PARSE_INFO , OCSD_ERR_TEST_SNAPSHOT_READ , OCSD_ERR_TEST_SS_TO_DECODER , OCSD_ERR_DCDREG_NAME_REPEAT ,
OCSD_ERR_DCDREG_NAME_UNKNOWN , OCSD_ERR_DCDREG_TYPE_UNKNOWN , OCSD_ERR_DCDREG_TOOMANY , OCSD_ERR_DCD_INTERFACE_UNUSED ,
OCSD_ERR_LAST
}

enum | _ocsd_err_severity_t { OCSD_ERR_SEV_NONE , OCSD_ERR_SEV_ERROR , OCSD_ERR_SEV_WARN , OCSD_ERR_SEV_INFO }
typedef enum _ocsd_err_t | ocsd_err_t
typedef unsigned int | ocsd_hndl_rdr_t
typedef unsigned int | ocsd_hndl_err_log_t
typedef enum _ocsd_err_severity_t | ocsd_err_severity_t

## Trace Datapath

#define | OCSD_DATA_RESP_IS_FATAL(x) (x >= OCSD_RESP_FATAL_NOT_INIT)
#define | OCSD_DATA_RESP_IS_WARN(x) ((x == OCSD_RESP_WARN_CONT) || (x == OCSD_RESP_WARN_WAIT))
#define | OCSD_DATA_RESP_IS_ERR(x) ((x == OCSD_RESP_ERR_CONT) || (x == OCSD_RESP_ERR_WAIT))
#define | OCSD_DATA_RESP_IS_WARN_OR_ERR(x) (OCSD_DATA_RESP_IS_ERR(x) || OCSD_DATA_RESP_IS_WARN(x))
#define | OCSD_DATA_RESP_IS_CONT(x) (x < OCSD_RESP_WAIT)
#define | OCSD_DATA_RESP_IS_WAIT(x) ((x >= OCSD_RESP_WAIT) && (x < OCSD_RESP_FATAL_NOT_INIT))
enum | _ocsd_datapath_op_t { OCSD_OP_DATA = 0 , OCSD_OP_EOT , OCSD_OP_FLUSH , OCSD_OP_RESET }
enum | _ocsd_datapath_resp_t { OCSD_RESP_CONT , OCSD_RESP_WARN_CONT , OCSD_RESP_ERR_CONT , OCSD_RESP_WAIT , OCSD_RESP_WARN_WAIT , OCSD_RESP_ERR_WAIT , OCSD_RESP_FATAL_NOT_INIT , OCSD_RESP_FATAL_INVALID_OP , OCSD_RESP_FATAL_INVALID_PARAM , OCSD_RESP_FATAL_INVALID_DATA , OCSD_RESP_FATAL_SYS_ERR }
typedef enum _ocsd_datapath_op_t | ocsd_datapath_op_t
typedef enum _ocsd_datapath_resp_t | ocsd_datapath_resp_t

## Trace Decode component types

#define | OCSD_DFRMTR_HAS_FSYNCS 0x01
#define | OCSD_DFRMTR_HAS_HSYNCS 0x02
#define | OCSD_DFRMTR_FRAME_MEM_ALIGN 0x04
#define | OCSD_DFRMTR_PACKED_RAW_OUT 0x08
#define | OCSD_DFRMTR_UNPACKED_RAW_OUT 0x10
#define | OCSD_DFRMTR_RESET_ON_4X_FSYNC 0x20
#define | OCSD_DFRMTR_VALID_MASK 0x3F
#define | OCSD_DFRMTR_FRAME_SIZE 0x10
enum | _rcdtl_rawframe_elem_t { OCSD_FRM_NONE , OCSD_FRM_PACKED , OCSD_FRM_HSYNC , OCSD_FRM_FSYNC , OCSD_FRM_ID_DATA }
enum | _ocsd_dcd_tree_src_t { OCSD_TRC_SRC_FRAME_FORMATTED , OCSD_TRC_SRC_SINGLE }
typedef enum _rcdtl_rawframe_elem_t | ocsd_rawframe_elem_t
typedef enum _ocsd_dcd_tree_src_t | ocsd_dcd_tree_src_t

## Trace Decode Arch and Profile

#define | OCSD_IS_V8_ARCH(arch) ((arch >= ARCH_V8) && (arch <= ARCH_V8_max))
#define | OCSD_IS_ARCH_MINVER(arch, min_arch) (arch >= min_arch)
#define | OCSD_MAX_VA_BITSIZE 64
#define | OCSD_VA_MASK ~0ULL
#define | OCSD_BIT_MASK(bits) (bits == OCSD_MAX_VA_BITSIZE) ? OCSD_VA_MASK : ((ocsd_vaddr_t)1 << bits) - 1
enum | _ocsd_arch_version { ARCH_UNKNOWN = 0x0000 , ARCH_CUSTOM = 0x0001 , ARCH_V7 = 0x0700 , ARCH_V8 = 0x0800 , ARCH_V8r3 = 0x0803 , ARCH_AA64 = 0x0864 , ARCH_V8_max = ARCH_AA64 }
enum | _ocsd_core_profile { profile_Unknown , profile_CortexM , profile_CortexR , profile_CortexA , profile_Custom }
typedef enum _ocsd_arch_version | ocsd_arch_version_t
typedef enum _ocsd_core_profile | ocsd_core_profile_t
typedef struct _ocsd_arch_profile_t | ocsd_arch_profile_t
typedef uint64_t | ocsd_vaddr_t

## Decoder creation information

Flags to use when creating decoders by name.

- share bitfield with pkt processor flags and packet decoder common flags.

Builtin decoder names.

Protocol type enum.

#define | OCSD_CREATE_FLG_PACKET_PROC 0x01
#define | OCSD_CREATE_FLG_FULL_DECODER 0x02
#define | OCSD_CREATE_FLG_INST_ID 0x04
#define | OCSD_BUILTIN_DCD_STM "STM"
#define | OCSD_BUILTIN_DCD_ETMV3 "ETMV3"
#define | OCSD_BUILTIN_DCD_ETMV4I "ETMV4I"
#define | OCSD_BUILTIN_DCD_ETMV4D "ETMV4D"
#define | OCSD_BUILTIN_DCD_PTM "PTM"
#define | OCSD_BUILTIN_DCD_ETE "ETE"
#define | OCSD_PROTOCOL_IS_BUILTIN(P) ((P > OCSD_PROTOCOL_UNKNOWN) && (P < OCSD_PROTOCOL_BUILTIN_END))
#define | OCSD_PROTOCOL_IS_CUSTOM(P) ((P >= OCSD_PROTOCOL_CUSTOM_0) && (P < OCSD_PROTOCOL_END ))

enum

_ocsd_trace_protocol_t {
OCSD_PROTOCOL_UNKNOWN = 0 , OCSD_PROTOCOL_ETMV3 , OCSD_PROTOCOL_ETMV4I , OCSD_PROTOCOL_ETMV4D ,
OCSD_PROTOCOL_PTM , OCSD_PROTOCOL_STM , OCSD_PROTOCOL_ETE , OCSD_PROTOCOL_BUILTIN_END ,
OCSD_PROTOCOL_CUSTOM_0 = 100 , OCSD_PROTOCOL_CUSTOM_1 , OCSD_PROTOCOL_CUSTOM_2 , OCSD_PROTOCOL_CUSTOM_3 ,
OCSD_PROTOCOL_CUSTOM_4 , OCSD_PROTOCOL_CUSTOM_5 , OCSD_PROTOCOL_CUSTOM_6 , OCSD_PROTOCOL_CUSTOM_7 ,
OCSD_PROTOCOL_CUSTOM_8 , OCSD_PROTOCOL_CUSTOM_9 , OCSD_PROTOCOL_END
}

typedef enum _ocsd_trace_protocol_t | ocsd_trace_protocol_t

## Software Trace Packets Info

Contains the information for the generic software trace output packet.

Software trace packet master and channel data. Payload info:
size - packet payload size in bits; marker - if this packet has a marker/flag timestamp - if this packet has a timestamp associated number of packets - packet processor can optionally correlate identically sized packets on the same master / channel to be output as a single generic packet

Payload output as separate LE buffer, of sufficient bytes to hold all the packets.

#define | SWT_ID_VALID_MASK (0x1 << 23)
typedef struct _ocsd_swt_info | ocsd_swt_info_t

## Decode statistics

Contains statistics for bytes decoded by the packet decoder, if statistics are supported.

Stats block instantiated in the base class - derived protocol specific decoder must initialise and use as required.

The single channel block contains the stats for the requested channel via the API call.

The global demux block contains the totals for all channels and non-data bytes used in CoreSight frame demux. This block will show identical data for every requested channel via the API.

#define | OCSD_STATS_REVISION 0x1
typedef struct _ocsd_decode_stats | ocsd_decode_stats_t

## Instruction Decode Information

enum | _ocsd_isa { ocsd_isa_arm , ocsd_isa_thumb2 , ocsd_isa_aarch64 , ocsd_isa_tee , ocsd_isa_jazelle , ocsd_isa_custom , ocsd_isa_unknown }
enum | _ocsd_sec_level { ocsd_sec_secure , ocsd_sec_nonsecure , ocsd_sec_root , ocsd_sec_realm }
enum | _ocsd_ex_level { ocsd_EL_unknown = -1 , ocsd_EL0 = 0 , ocsd_EL1 , ocsd_EL2 , ocsd_EL3 }
enum | _ocsd_instr_type { OCSD_INSTR_OTHER , OCSD_INSTR_BR , OCSD_INSTR_BR_INDIRECT , OCSD_INSTR_ISB , OCSD_INSTR_DSB_DMB , OCSD_INSTR_WFI_WFE , OCSD_INSTR_TSTART }
enum | _ocsd_instr_subtype { OCSD_S_INSTR_NONE , OCSD_S_INSTR_BR_LINK , OCSD_S_INSTR_V8_RET , OCSD_S_INSTR_V8_ERET , OCSD_S_INSTR_V7_IMPLIED_RET }
typedef enum _ocsd_isa | ocsd_isa
typedef enum _ocsd_sec_level | ocsd_sec_level
typedef enum _ocsd_ex_level | ocsd_ex_level
typedef enum _ocsd_instr_type | ocsd_instr_type
typedef enum _ocsd_instr_subtype | ocsd_instr_subtype
typedef struct _ocsd_instr_info | ocsd_instr_info
typedef struct _ocsd_pe_context | ocsd_pe_context

## Opcode Memory Access

Types used when accessing memory storage for traced opcodes..
enum | _ocsd_mem_space_acc_t { OCSD_MEM_SPACE_EL1S = 0x1 , OCSD_MEM_SPACE_EL1N = 0x2 , OCSD_MEM_SPACE_EL2 = 0x4 , OCSD_MEM_SPACE_EL3 = 0x8 , OCSD_MEM_SPACE_EL2S = 0x10 , OCSD_MEM_SPACE_S = 0x19 , OCSD_MEM_SPACE_N = 0x6 , OCSD_MEM_SPACE_ANY = 0x1F }
typedef enum _ocsd_mem_space_acc_t | ocsd_mem_space_acc_t
typedef uint32_t(* | Fn_MemAcc_CB) (const void *p_context, const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const uint32_t reqBytes, uint8_t *byteBuffer)
typedef uint32_t(* | Fn_MemAccID_CB) (const void *p_context, const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const uint8_t trcID, const uint32_t reqBytes, uint8_t *byteBuffer)
typedef struct _ocsd_file_mem_region | ocsd_file_mem_region_t

## Detailed Description

OpenCSD : Standard Types used in the library interfaces.

Copyright
  Copyright (c) 2015, ARM Limited. All Rights Reserved.

Definition in file ocsd_if_types.h.