39#ifndef MIPI_SYST_H_INCLUDED
40#define MIPI_SYST_H_INCLUDED
44#define MIPI_SYST_VERSION_MAJOR 1
45#define MIPI_SYST_VERSION_MINOR 0
46#define MIPI_SYST_VERSION_PATCH 0
54#define MIPI_SYST_CONFORMANCE_LEVEL 30
72#define MIPI_SYST_MAKE_VERSION_CODE(ma, mi, p) (((ma) << 16) | ((mi)<<8) | (p))
75#define MIPI_SYST_VERSION_CODE MIPI_SYST_MAKE_VERSION_CODE(\
76 MIPI_SYST_VERSION_MAJOR,\
77 MIPI_SYST_VERSION_MINOR,\
78 MIPI_SYST_VERSION_PATCH)
82#define _MIPI_SYST_STRINGIFY(x) #x
83#define _MIPI_SYST_CPP_TOSTR(x) _MIPI_SYST_STRINGIFY(x)
85#define _MIPI_SYST_VERSION_STRING(a, b, c)\
86 _MIPI_SYST_CPP_TOSTR(a)"."_MIPI_SYST_CPP_TOSTR(b)"."_MIPI_SYST_CPP_TOSTR(c)
89#define MIPI_SYST_VERSION_STRING \
90 _MIPI_SYST_VERSION_STRING(\
91 MIPI_SYST_VERSION_MAJOR,\
92 MIPI_SYST_VERSION_MINOR,\
93 MIPI_SYST_VERSION_PATCH)
95#ifndef MIPI_SYST_COMPILER_INCLUDED
96#include "mipi_syst/compiler.h"
106#define _MIPI_SYST_HASH1(s,i,x,l) (x*65599u+(mipi_syst_u8)s[(i)<(l)?((l)-1-(i)):(l)])
107#define _MIPI_SYST_HASH4(s,i,x,l) _MIPI_SYST_HASH1(s,i,_MIPI_SYST_HASH1(s,i+1,_MIPI_SYST_HASH1(s,i+2,_MIPI_SYST_HASH1(s,i+3,x,l),l),l),l)
108#define _MIPI_SYST_HASH16(s,i,x,l) _MIPI_SYST_HASH4(s,i,_MIPI_SYST_HASH4(s,i+4,_MIPI_SYST_HASH4(s,i+8,_MIPI_SYST_HASH4(s,i+12,x,l),l),l),l)
109#define _MIPI_SYST_HASH64(s,i,x,l) _MIPI_SYST_HASH16(s,i,_MIPI_SYST_HASH16(s,i+16,_MIPI_SYST_HASH16(s,i+32,_MIPI_SYST_HASH16(s,i+48,x,l),l),l),l)
111#define _MIPI_SYST_HASH_x65599(s,l) ((mipi_syst_u32)_MIPI_SYST_HASH64(s,0,0,l))
113#define _MIPI_SYST_HASH_AT_CPP_TIME(str, offset) (_MIPI_SYST_HASH_x65599(str, sizeof(str)-1) + (offset))
114#define _MIPI_SYST_HASH_AT_RUN_TIME(str, offset) (mipi_syst_hash_x65599(str, sizeof(str)-1) + (offset))
116#if defined(_MIPI_SYST_OPTIMIZER_ON)
117#define MIPI_SYST_HASH(a, b) _MIPI_SYST_HASH_AT_CPP_TIME((a), (b))
119#define MIPI_SYST_HASH(a, b) _MIPI_SYST_HASH_AT_RUN_TIME((a),(b))
122#if defined(__cplusplus)
128enum mipi_syst_msgtype {
142enum mipi_syst_subtype_string {
156enum mipi_syst_subtype_catalog {
162 MIPI_SYST_CATALOG_MAX
167enum mipi_syst_subtype_clock{
172enum mipi_syst_subtype_build {
181struct mipi_syst_scatter_prog;
207#define MIPI_SYST_GEN_GUID(l1, w1, w2, w3, l2) \
209 (mipi_syst_u8)((mipi_syst_u32)(l1) >> 24), \
210 (mipi_syst_u8)((mipi_syst_u32)(l1) >> 16), \
211 (mipi_syst_u8)((mipi_syst_u32)(l1) >> 8), \
212 (mipi_syst_u8)((mipi_syst_u32)(l1) >> 0), \
213 (mipi_syst_u8)((mipi_syst_u16)(w1) >> 8), \
214 (mipi_syst_u8)((mipi_syst_u16)(w1) >> 0), \
215 (mipi_syst_u8)((mipi_syst_u16)(w2) >> 8), \
216 (mipi_syst_u8)((mipi_syst_u16)(w2) >> 0), \
217 (mipi_syst_u8)((mipi_syst_u16)(w3) >> 8), \
218 (mipi_syst_u8)((mipi_syst_u16)(w3) >> 0), \
219 (mipi_syst_u8)((mipi_syst_u64)(l2) >> 40), \
220 (mipi_syst_u8)((mipi_syst_u64)(l2) >> 32), \
221 (mipi_syst_u8)((mipi_syst_u64)(l2) >> 24), \
222 (mipi_syst_u8)((mipi_syst_u64)(l2) >> 16), \
223 (mipi_syst_u8)((mipi_syst_u64)(l2) >> 8), \
224 (mipi_syst_u8)((mipi_syst_u64)(l2) >> 0) \
260#define MIPI_SYST_GEN_ORIGIN_GUID(l1, w1, w2, w3, l2 , u) \
262 MIPI_SYST_GEN_GUID(l1, w1, w2, w3, l2) ,\
280#define MIPI_SYST_GEN_ORIGIN_MODULE(m , u) \
282 MIPI_SYST_GEN_GUID(0,0,0, ((mipi_syst_u16)(m & 0x7F)) << 8, 0 ),\
298typedef void (MIPI_SYST_CALLCONV *mipi_syst_inithook_t)(
struct mipi_syst_header *systh,
311typedef void (MIPI_SYST_CALLCONV *mipi_syst_destroyhook_t)(
struct mipi_syst_header *systh);
335typedef void (*mipi_syst_releasehandle_hook_t)(
struct mipi_syst_handle *systh);
351typedef void (*mipi_syst_msg_write_t)(
353 struct mipi_syst_scatter_prog *scatterprog,
359#ifndef MIPI_SYST_PLATFORM_INCLUDED
395#define MIPI_SYST_PCFG_ENABLE_PLATFORM_STATE_DATA
396#undef MIPI_SYST_PCFG_ENABLE_PLATFORM_STATE_DATA
408#define MIPI_SYST_PCFG_ENABLE_PLATFORM_HANDLE_DATA
422#define MIPI_SYST_PCFG_ENABLE_HEAP_MEMORY
423#undef MIPI_SYST_PCFG_ENABLE_HEAP_MEMORY
431#if defined(_WIN64) || defined(__x86_64__) || defined (__LP64__)
432#define MIPI_SYST_PCFG_ENABLE_64BIT_ADDR
441#if defined(_WIN64) || defined(__x86_64__) || defined (__LP64__)
442#define MIPI_SYST_PCFG_ENABLE_64BIT_IO
452#define MIPI_SYST_PCFG_ENABLE_INLINE
466#if MIPI_SYST_CONFORMANCE_LEVEL > 10
487#define MIPI_SYST_PCFG_ENABLE_DEFAULT_SCATTER_WRITE
492#define MIPI_SYST_PCFG_ENABLE_CATID32_API
497#define MIPI_SYST_PCFG_ENABLE_CATID64_API
502#define MIPI_SYST_PCFG_ENABLE_STRING_API
507#define MIPI_SYST_PCFG_ENABLE_WRITE_API
512#define MIPI_SYST_PCFG_ENABLE_BUILD_API
515#if MIPI_SYST_CONFORMANCE_LEVEL > 20
524#define MIPI_SYST_PCFG_ENABLE_PRINTF_API
525#undef MIPI_SYST_PCFG_ENABLE_PRINTF_API
532#define MIPI_SYST_PCFG_PRINTF_ARGBUF_SIZE 1024
548#if MIPI_SYST_CONFORMANCE_LEVEL > 10
552#define MIPI_SYST_PCFG_ENABLE_ORIGIN_GUID
557#define MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD
558#undef MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD
566#define MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS
567#undef MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS
578#define MIPI_SYST_PCFG_ENABLE_TIMESTAMP
580#if defined(_DOXYGEN_)
587#define MIPI_SYST_PCFG_LENGTH_FIELD
592#if MIPI_SYST_CONFORMANCE_LEVEL > 20
596#define MIPI_SYST_PCFG_ENABLE_CHECKSUM
608#if defined(MIPI_SYST_PCFG_ENABLE_INLINE)
609#define MIPI_SYST_INLINE static MIPI_SYST_CC_INLINE
611#define MIPI_SYST_INLINE MIPI_SYST_EXPORT
620#if defined(MIPI_SYST_PCFG_ENABLE_PLATFORM_HANDLE_DATA)
625#if MIPI_SYST_CONFORMANCE_LEVEL > 10
628#if defined(MIPI_SYST_PCFG_ENABLE_PLATFORM_STATE_DATA)
629 struct mipi_syst_platform_state systh_platform;
643#if defined(MIPI_SYST_BIG_ENDIAN)
671#define _MIPI_SYST_MK_MODUNIT_ORIGIN(m,u) (((u) & 0xF)|(m<<4))
694#if defined(MIPI_SYST_BIG_ENDIAN)
701 } etls_source_location;
713#if defined(MIPI_SYST_BIG_ENDIAN)
720 } etls_source_location;
758#if defined(MIPI_SYST_PCFG_ENABLE_ORIGIN_GUID)
762#if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
769#if defined(MIPI_SYST_PCFG_ENABLE_PLATFORM_HANDLE_DATA)
779#ifndef MIPI_SYST_API_INCLUDED
780#include "mipi_syst/api.h"
mipi_syst_u32 et_timestamp
@ MIPI_SYST_STRING_ASSERT
@ MIPI_SYST_STRING_INVALIDPARAM
@ MIPI_SYST_STRING_FUNCTIONENTER
@ MIPI_SYST_STRING_PRINTF_64
@ MIPI_SYST_STRING_PRINTF_32
@ MIPI_SYST_STRING_GENERIC
@ MIPI_SYST_STRING_FUNCTIONEXIT
@ MIPI_SYST_CLOCK_TRANSPORT_SYNC
struct mipi_syst_msg_tag systh_tag
mipi_syst_u64 etls_code_location
@ MIPI_SYST_BUILD_ID_COMPACT32
@ MIPI_SYST_BUILD_ID_LONG
@ MIPI_SYST_BUILD_ID_COMPACT64
struct mipi_syst_platform_handle systh_platform
mipi_syst_inithandle_hook_t systh_inith
struct mipi_syst_guid systh_guid
struct mipi_syst_handle_flags systh_flags
mipi_syst_u32 etls_fileID
mipi_syst_u32 systh_param_count
@ MIPI_SYST_CATALOG_ID64_P32
@ MIPI_SYST_CATALOG_ID64_P64
@ MIPI_SYST_CATALOG_ID32_P64
@ MIPI_SYST_CATALOG_ID32_P32
union mipi_syst_msglocation64 loc64
mipi_syst_u32 systh_version
mipi_syst_u16 etls_lineNo
mipi_syst_u32 et_location
mipi_syst_msg_write_t systh_writer
struct mipi_syst_guid guid
union mipi_syst_msglocation32 loc32
mipi_syst_u32 systh_param[6]
mipi_syst_u32 et_severity
mipi_syst_u32 etls_lineNo
mipi_syst_u16 etls_fileID
struct mipi_syst_header * systh_header
mipi_syst_u32 etls_code_location
mipi_syst_releasehandle_hook_t systh_releaseh
@ MIPI_SYST_SEVERITY_WARNING
@ MIPI_SYST_SEVERITY_FATAL
@ MIPI_SYST_SEVERITY_ERROR
@ MIPI_SYST_SEVERITY_INFO
@ MIPI_SYST_SEVERITY_USER1
@ MIPI_SYST_SEVERITY_USER2
@ MIPI_SYST_SEVERITY_DEBUG