1 /*
2 Copyright (c) 2018, MIPI Alliance, Inc.
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8 
9 * Redistributions of source code must retain the above copyright
10   notice, this list of conditions and the following disclaimer.
11 
12 * Redistributions in binary form must reproduce the above copyright
13   notice, this list of conditions and the following disclaimer in
14   the documentation and/or other materials provided with the
15   distribution.
16 
17 * Neither the name of the copyright holder nor the names of its
18   contributors may be used to endorse or promote products derived
19   from this software without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 
34 /*
35  * Contributors:
36  * Norbert Schulz (Intel Corporation) - Initial API and implementation
37  */
38 
39 /* SyS-T Instrumentation API defintions
40  */
41 
42 #ifndef MIPI_SYST_API_INCLUDED
43 #define MIPI_SYST_API_INCLUDED
44 
45 #ifndef MIPI_SYST_H_INCLUDED
46 #include "mipi_syst.h"
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 /* Define away all instrumentation calls if one if the following global
54  * disable switches is set
55  */
56 #if !defined(MIPI_SYST_DISABLE_ALL)
57 
58 /**
59  * @defgroup ApiSets API Sets
60  *
61  * SyS-T provided Instrumentation API sets
62  *
63  * SyS-T provides different API sets. Most sets can be individually enabled
64  * or disabled using the @ref PCFG_ApiSet platform feature defines.
65  */
66 
67 /**
68  * @defgroup API_global State and Lifetime handling macros
69  * @ingroup ApiSets
70  *
71  * State and handle lifetime related macros
72  * @{
73  */
74 
75 /**
76  * SyS-T platform initialization with user provided state structure
77  *
78  * This function must be called during system startup to initialize the SyS-T
79  * execution environment. This function expects a user provided SyS-T state
80  * structure pointer. This call supports environments with different
81  * library states at the same time. To initialize SyS-T for using a global
82  * shared state, call #MIPI_SYST_INIT(f,p) instead.
83  *
84  * @param s Pointer to SyS-T state header variable
85  * @param f Pointer to platform initialization hook function
86  * @param p Pointer value that gets passed to the initialization hook function
87  */
88 #define MIPI_SYST_INIT_STATE(s, f, p) \
89 	mipi_syst_init((s), (f), (p))
90 
91 /**
92  * SyS-T platform shutdown with user provided state structure
93  *
94  * This function expects a user provided SyS-T state
95  * structure pointer. This call supports environments with different
96  * library states at the same time. To shutdown SyS-T using a global
97  * shared state, call #MIPI_SYST_SHUTDOWN(f) instead.
98  *
99  * @param s Pointer to SyS-T state header variable
100  * @param f pointer to platform resource destruction hook function
101  */
102 #define MIPI_SYST_SHUTDOWN_STATE(s, f) \
103 	mipi_syst_destroy((s), (f))
104 
105 /**
106  * SyS-T global platform initialization
107  *
108  * This function must be called during system startup to initialize the SyS-T
109  * execution environment.
110  *
111  * @param f pointer to platform initialization hook function
112  * @param p pointer value that gets passed to the initialization hook function
113  */
114 #define MIPI_SYST_INIT(f, p) \
115 	MIPI_SYST_INIT_STATE((struct mipi_syst_header*)0, (f), (p))
116 
117 /**
118  * SyS-T global platform shutdown
119  *
120  * @param f pointer to platform resource destruction hook function
121  */
122 #define MIPI_SYST_SHUTDOWN(f) \
123 	MIPI_SYST_SHUTDOWN_STATE((struct mipi_syst_header*)0, (f))
124 
125 /**
126  * Initialize non-heap SyS-T handle with custom global state
127  *
128  * This function is used in platforms that don't support heap allocations.
129  * The caller has to provide a pointer to a memory location that can hold
130  * a mipi_syst_handle data structure. This function expect a user provided
131  * SyS-T state structure pointer as its first parameter. To create a
132  * handle for the shared global state, call #MIPI_SYST_INIT_HANDLE(h,p) instead.
133  *
134  * @param s Pointer to SyS-T state header variable
135  * @param h Pointer to handle data structure on the stack or data segment.
136  * @param p Pointer to data that get passed to the platform handle init hook
137  *          function.
138  *
139  * Example
140  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
141  * extern struct mipi_syst_header systh_header;
142  * static struct mipi_syst_handle systh_data;
143  *
144  * void foo()
145  * {
146  *      struct mipi_syst_handle* svh;
147  *
148  *      svh = MIPI_SYST_INIT_HANDLE_STATE(&systh_header, &systh_data, NULL);
149  *
150  *      ...
151  *  }
152  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153  */
154 #define MIPI_SYST_INIT_HANDLE_STATE(s, h, p) \
155 	mipi_syst_init_handle((s), (h), (p), 0)
156 
157 /**
158  * Initialize non-heap SyS-T handle
159  *
160  * This function is used in platforms that don't support heap allocations.
161  * The caller has to provide a pointer to a memory location that can hold
162  * a mipi_syst_handle data structure.
163  *
164  * @param h Pointer to handle data structure on the stack or data segment.
165  * @param p Pointer to mipi_syst_origin structure with client
166  *          identifying information, or NULL if not used
167  *
168  * Example
169  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
170  * static struct mipi_syst_handle systh_data;
171  *
172  * void foo()
173  * {
174  *      struct mipi_syst_handle* svh = MIPI_SYST_INIT_HANDLE(&systh_data, NULL);
175  *
176  *      ...
177  *  }
178  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
179  */
180 #define MIPI_SYST_INIT_HANDLE(h, p) \
181 	MIPI_SYST_INIT_HANDLE_STATE((struct mipi_syst_header*)0, (h), (p))
182 
183 #if defined(MIPI_SYST_PCFG_ENABLE_HEAP_MEMORY)
184 /**
185  * Heap allocate and initialize a new SyS-T handle for a custom global state
186  *
187  * This function is only supported if the platform supports the
188  * feature #MIPI_SYST_PCFG_ENABLE_HEAP_MEMORY. Use
189  * #MIPI_SYST_INIT_HANDLE if no heap support is enabled.
190  *
191  * @param s Pointer to SyS-T state header variable
192  * @param p Pointer to mipi_syst_origin structure with client
193  *          identifying information, or NULL if not used
194  *
195  * Example:
196  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
197  * extern struct mipi_syst_header systh_header;
198  *
199  * static const struct mipi_syst_origin origin =
200  *    MIPI_SYST_GEN_ORIGIN_GUID(0x494E5443, 0xA2AE, 0x4C70, 0xABB5, 0xD1A79E9CEA35, 1);
201  *
202  * void foo()
203  * {
204  *      struct mipi_syst_handle* svh;
205  *
206  *      svh = MIPI_SYST_ALLOC_HANDLE_STATE(&systh_header, &origin);
207  *
208  *      ...
209  *  }
210  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211  */
212 #define MIPI_SYST_ALLOC_HANDLE_STATE(s, p) \
213 	mipi_syst_init_handle(\
214 		(s),\
215 		(struct mipi_syst_handle*)MIPI_SYST_HEAP_MALLOC(sizeof(struct mipi_syst_handle)),\
216 		(p), 1)
217 
218 /**
219  * Heap allocate and initialize a new SyS-T handle
220  * This function is only supported if the platform supports the
221  * feature #MIPI_SYST_PCFG_ENABLE_HEAP_MEMORY. Use
222  * #MIPI_SYST_INIT_HANDLE if no heap support is enabled.
223  *
224   * @param p Pointer to mipi_syst_origin structure with client
225  *          identifying information, or NULL if not used
226  *
227  * Example:
228  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
229  *  * static const struct mipi_syst_origin origin =
230  *    MIPI_SYST_GEN_ORIGIN_GUID(0x494E5443, 0xA2AE, 0x4C70, 0xABB5, 0xD1A79E9CEA35, 1);
231  *
232  *
233  * void foo()
234  * {
235  *      struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(&origin);
236  *
237  *      ...
238  *  }
239  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240  */
241 #define MIPI_SYST_ALLOC_HANDLE(p) \
242 	MIPI_SYST_ALLOC_HANDLE_STATE((struct mipi_syst_header*)0, (p))
243 
244 #else
245 #define MIPI_SYST_ALLOC_HANDLE(p) \
246 CFG_ERROR_ALLOC_HANDLE_CALLED_WITHOUT_PCFG_ENABLE_HEAP_MEMORY
247 #define MIPI_SYST_ALLOC_HANDLE_STATE(s, p) \
248 CFG_ERROR_SYST_ALLOC_HANDLE_STATE_CALLED_WITHOUT_PCFG_ENABLE_HEAP_MEMORY
249 #endif
250 
251 
252 #if defined(MIPI_SYST_PCFG_LENGTH_FIELD)  || defined (_DOXYGEN_)
253  /**
254  * Enable or disable length generation over the given SyS-T handle
255  *
256  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
257  * @param v 0 disable length field, otherwise enable length
258  *
259  * Example:
260  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
261  * struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
262  *
263  * // enable checksums
264  * //
265  * MIPI_SYST_ENABLE_HANDLE_LENGTH(svh, 1);
266  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267  */
268 #define MIPI_SYST_ENABLE_HANDLE_LENGTH(h, v) \
269 	((h) && ((h)->systh_tag.et_length = (v) ? 1 : 0))
270 #else
271 #define MIPI_SYST_ENABLE_HANDLE_LENGTH(h, v)
272 #endif
273 
274  /**
275  * Get length field generation state from given SyS-T handle
276  *
277  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
278  * @return 0 if disabled, otherwise enabled
279  *
280  * Example:
281  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
282  * struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
283  *
284  *  if (MIPI_SYST_GET_HANDLE_LENGTH(svh)) {
285  *      // length field enabled ...
286  *  }
287  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
288  */
289 #define MIPI_SYST_GET_HANDLE_LENGTH(h) \
290 	(((h) &&(h)->systh_tag.et_length)  ? 1 : 0)
291 
292 #if defined(MIPI_SYST_PCFG_ENABLE_CHECKSUM)
293 /**
294  * Enable or disable checksum generation over the given SyS-T handle
295  *
296  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
297  * @param v 0 disable checksum, otherwise enable checksum
298  *
299  * Example:
300  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
301  * struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
302  *
303  * // enable checksums
304  * //
305  * MIPI_SYST_ENABLE_HANDLE_CHECKSUM(svh, 1);
306  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307  */
308 #define MIPI_SYST_ENABLE_HANDLE_CHECKSUM(h, v) \
309 	((h) && ((h)->systh_tag.et_chksum = (v) ? 1 : 0))
310 
311  /**
312  * Get checksum generation state from given SyS-T handle
313  *
314  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
315  * @return 0 if disabled, otherwise enabled
316  *
317  * Example:
318  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
319  * struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
320  *
321  *  if (MIPI_SYST_GET_HANDLE_CHECKSUM(svh)) {
322  *      // checksums enabled ...
323  *  }
324  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
325  */
326 #define MIPI_SYST_GET_HANDLE_CHECKSUM(h) \
327 	(((h) && (h)->systh_tag.et_chksum)  ? 1 : 0)
328 #endif
329 
330 /**
331  * Change module and unit ID of the given SyS-T handle.
332  *
333  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
334  * @param module module id (0..0x7F)
335  * @param unit unit id (0x0..0xF)
336  *
337  * @see #MIPI_SYST_SET_HANDLE_GUID_UNIT mipi_syst_msg_tag
338  *
339  * Example:
340  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
341  * struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
342  *
343  * // tag message with 5:1 as module:unit id pair
344  * //
345  * MIPI_SYST_SET_MODULE_UNIT(svh, 5, 1);
346  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347  */
348 #define MIPI_SYST_SET_HANDLE_MODULE_UNIT(h, module, unit) \
349 do { \
350 	if (h) { \
351 		(h)->systh_tag.et_guid = 0; \
352 		(h)->systh_tag.et_modunit = \
353 			_MIPI_SYST_MK_MODUNIT_ORIGIN((module), (unit)); \
354 	} \
355 } while (0)
356 
357 #if defined(MIPI_SYST_PCFG_ENABLE_ORIGIN_GUID)
358 
359 /**
360  * Change GUID and unit ID of the given SyS-T handle.
361  *
362  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
363  * @param guid mipi_syst_guid data structure
364  * @param unit unit id (0x0..0xF)
365  *
366  * @see mipi_syst_msg_tag
367  *
368  * Example:
369  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
370  * //
371  * static const struct mipi_syst_guid guid =
372  *   MIPI_SYST_GEN_GUID(0x494E5443, 0xA2AE, 0x4C70, 0xABB5, 0xD1A79E9CEA35);
373  *
374  * void foo()
375  * {
376  *      struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
377  *
378  *      // tag message with  GUID and 1 as unit id
379  *      //
380  *      MIPI_SYST_SET_HANDLE_GUID_UNIT(svh, guid, 1);
381  *  }
382  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383  */
384 #define MIPI_SYST_SET_HANDLE_GUID_UNIT(h, guid, unit) \
385 do { \
386 	if (h) { \
387 		(h)->systh_guid.u.ll[0] = MIPI_SYST_HTOLE64((guid).u.ll[0]); \
388 		(h)->systh_guid.u.ll[1] = MIPI_SYST_HTOLE64((guid).u.ll[1]); \
389 		(h)->systh_tag.et_modunit = (unit); \
390 		(h)->systh_tag.et_guid = 1;\
391 	} \
392 } while (0)
393 
394  /**
395  * Change message origin using mipi_sys_t_origin structure
396  *
397  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
398  * @param o origin structure
399  *
400  * @see #MIPI_SYST_SET_HANDLE_GUID_UNIT mipi_syst_origin
401  *
402  * Example:
403  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
404  *  // Define origin used by this example as the message client ID
405  *  //
406  * static const struct mipi_syst_origin origin =
407  * MIPI_SYST_GEN_ORIGIN_GUID(0x494E5443, 0xA2AE, 0x4C70, 0xABB5, 0xD1A79E9CEA35, 1);
408   *
409  * struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
410  *
411  * // tag message with  GUID and 1 as unit id
412  * //
413  * MIPI_SYST_SET_HANDLE_ORIGIN(svh, origin);
414  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
415  */
416 #define MIPI_SYST_SET_HANDLE_ORIGIN(h, o) \
417 do { \
418 	/* Guid byte 8 bit 7 indicates if full GUID or    \
419 	 * short module header is used. This bit is never \
420 	 * 0 for RFC4122 compliant guids.                 \
421 	 */                                               \
422 	if (0 != ((o).guid.u.b[8] & 0x80)) { \
423 		MIPI_SYST_SET_HANDLE_GUID_UNIT( \
424 			(h), \
425 			(o).guid, \
426 			(o).unit); \
427 	} else { \
428 		MIPI_SYST_SET_HANDLE_MODULE_UNIT( \
429 			(h), \
430 			(o).guid.u.b[8], \
431 			(o).unit); \
432 	} \
433 } while(0)
434 
435 #else
436 #define MIPI_SYST_SET_HANDLE_GUID_UNIT(p, g, u) \
437 CFG_ERROR_SET_HANDLE_GUID_UNIT_WITHOUT_MIPI_SYST_PCFG_ENABLE_ORIGIN_GUID
438 #endif
439 
440 #if defined(MIPI_SYST_PCFG_ENABLE_TIMESTAMP)
441 /**
442  * Enable protocol specific time stamp support on this SyS-T handle.
443  *
444  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
445  * @param v 0 disable, 1 enable
446  *
447  * Example:
448  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
449  * void foo()
450  * {
451  *      struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
452 
453  *      MIPI_SYST_ENABLE_HANDLE_TIMESTAMP(svh, 1);
454  *  }
455  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
456  */
457 #define MIPI_SYST_ENABLE_HANDLE_TIMESTAMP(h, v) \
458 	((h) && ((h)->systh_tag.et_timestamp = (v) ? 1 : 0))
459 
460 /**
461  * Get timestamp generation state from given SyS-T handle
462  *
463  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
464  * @return 0 if disabled, otherwise enabled
465  *
466  * Example:
467  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
468  * struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
469  *
470  *  if (MIPI_SYST_GET_HANDLE_TIMESTAMP(svh)) {
471  *      // timestamp enabled ...
472  *  }
473  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
474  */
475 #define MIPI_SYST_GET_HANDLE_TIMESTAMP(h) \
476 	(((h) && (h)->systh_tag.et_timestamp)  ? 1 : 0)
477 
478 #else
479 #define MIPI_SYST_ENABLE_HANDLE_TIMESTAMP(h,v ) \
480 CFG_ERROR_MIPI_SYST_ENABLE_HANDLE_TIMESTAMP_WITHOUT_MIPI_SYST_PCFG_ENABLE_TIMESTAMP
481 #endif
482 
483 
484 
485 /**
486  * Delete a SyS-T handle
487  *
488  * @param h SyS-T handle from #MIPI_SYST_INIT_HANDLE or #MIPI_SYST_ALLOC_HANDLE
489  *
490  * Example:
491  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
492  * void foo()
493  * {
494  *      struct mipi_syst_handle* svh = MIPI_SYST_ALLOC_HANDLE(NULL);
495  *
496  *      // ...
497  *
498  *      MIPI_SYST_DELETE_HANDLE(svh);
499  *  }
500  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
501  */
502 #define MIPI_SYST_DELETE_HANDLE(h) \
503 	mipi_syst_delete_handle(h)
504 
505 /** @} */
506 
507 /**
508  * Pass null to instrumentation API to skip location information generation.
509  */
510 #define MIPI_SYST_NOLOCATION  (struct mipi_syst_msglocation *)0
511 
512 /**
513  * @defgroup WriteAPI Raw Data Writing Macros
514  * @ingroup ApiSets
515  *
516  * Raw data writing macros:
517  * @{
518  */
519 
520 /**
521  * Send short data message with 28-bit payload.<BR>
522  *
523  * This API is indented for space and speed restricted environments that
524  * cannot support the more complex message types.
525  * @param h mipi_syst_handle* SyS-T handle
526  * @param v 28-bit output value. The upper 4 bits  of the parameter value
527  *          are discarded
528  *
529  * Example:
530  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
531  * #define INIT_START 1
532  * #define INIT_DONE  2
533  *
534  * foo()
535  * {
536  *      MIPI_SYST_SHORT32(svh, INIT_START);
537  *      // processing ..
538  *      //
539  *
540  *      MIPI_SYST_SHORT32(svh, INIT_DONE);
541  *      // ..
542  * }
543  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
544  */
545 #define MIPI_SYST_SHORT32(h, v) \
546 	MIPI_SYST_OUTPUT_D32MTS(h,\
547 		(((v)<<4) | (mipi_syst_u32)MIPI_SYST_TYPE_SHORT32))
548 
549 /**
550  * Send short data message with 60-bit payload.<BR>
551  *
552  * This API is indented for space and speed restricted environments that
553  * cannot support the more complex message types.
554  * @param h mipi_syst_handle* SyS-T handle
555  * @param v 60-bit output value. The upper 4 bits of the parameter value
556  *          are discarded.
557  *
558  * Example:
559  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
560  * #define INIT_START 1
561  * #define INIT_DONE  2
562  *
563  * foo()
564  * {
565  *      MIPI_SYST_SHORT64(svh, INIT_START);
566  *      // processing ..
567  *      //
568  *
569  *      MIPI_SYST_SHORT64(svh, INIT_DONE);
570  *      // ..
571  * }
572  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
573  */
574 #define MIPI_SYST_SHORT64(h, v) \
575 	MIPI_SYST_OUTPUT_D64MTS(h,\
576 		(((v)<<4) | (mipi_syst_u64)MIPI_SYST_TYPE_SHORT64))
577 
578 
579 #if defined(MIPI_SYST_PCFG_ENABLE_TIMESTAMP)
580 
581 /**
582  * Send a timesync Message that helps the decode Software to synchronize the
583  * transport protocol clock value (e.g., the MIPI STP timestamp) with trace
584  * hardware generated clocks. This API depends on the platform define
585  * #MIPI_SYST_PCFG_ENABLE_TIMESTAMP.
586  * @param h mipi_syst_handle* SyS-T handle
587  * @param c 64-bit clock value from message timestamp clock
588  * @param f 64-bit message timestamp clock frequency value in Herz
589  */
590 #define MIPI_SYST_CLOCK_SYNC(h, c, f)\
591 	mipi_syst_write_clock((h),\
592 			MIPI_SYST_NOLOCATION,\
593 			MIPI_SYST_CLOCK_TRANSPORT_SYNC,\
594 			(c),\
595 			(f))
596 
597 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
598 mipi_syst_write_clock(struct mipi_syst_handle* svh,
599 		struct mipi_syst_msglocation* loc,
600 		enum mipi_syst_subtype_clock fmt,
601 		mipi_syst_u64 clock,
602 		mipi_syst_u64 freq);
603 #endif /* defined(MIPI_SYST_PCFG_ENABLE_TIMESTAMP) */
604 
605 #if defined(MIPI_SYST_PCFG_ENABLE_WRITE_API)
606 
607 /**
608  * Send raw data message with user defined payload.<BR>
609  *
610  * @param h mipi_syst_handle* SyS-T handle
611  * @param sev mipi_syst_severity severity level (0..7)
612  * @param id 8-bit message protocol ID. This ID is used to identify
613  *            the data protocol in the payload of this message for pretty
614  *            printing in trace decoders. The protocol ID must uniquely
615  *            identify the contents within the SyS-T handle's
616  *            #mipi_syst_msg_tag.et_modunit id or
617  *            #mipi_syst_handle.systh_guid value. The protocol decoder
618  *            uses this value to route data from `MIPI_SYST_WRITE()` calls
619  *            to other cascaded decoders to actually
620  *            process the contents.
621  * @param p pointer to raw data to send
622  * @param len 16-bit length of data to send
623  *
624  * Example:
625  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
626  *
627  * // emit raw data under user defined decode ID 5
628  * //
629  * unsigned char data[] = { 0,1,2,3,4,5,6,7,8,9 };
630  *
631  * MIPI_SYST_WRITE(systh, MIPI_SYST_SEVERITY_INFO, 5, data, sizeof(data));
632  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
633  */
634 #define MIPI_SYST_WRITE(h, sev, id, p, len) \
635 	mipi_syst_write_raw_message((h), \
636 		MIPI_SYST_NOLOCATION, (sev), (id), (p), (len))
637 
638 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
639 
640 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
641 
642 /** @copydoc MIPI_SYST_WRITE(h, sev, id, p, len) */
643 #define MIPI_SYST_WRITE_LOCADDR(h, sev, id, p, len) \
644 	mipi_syst_write_raw_message((h),\
645 		mipi_syst_make_address_location((h), mipi_syst_return_addr()),\
646 		(sev), (id), (p), (len))
647 
648 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
649 
650 /**
651 * Send raw data message with user defined payload.<BR>
652 *
653 * @param h mipi_syst_handle* SyS-T handle
654 * @param sev mipi_syst_severity severity level (0..7)
655 * @param file file ID as 16-bit value
656 * @param id 8-bit message protocol ID. This ID is used to identify
657 *            the data protocol in the payload of this message for pretty
658 *            printing in trace decoders. The protocol ID must uniquely
659 *            identify the contents within the SyS-T handle's
660 *            #mipi_syst_msg_tag.et_modunit id or
661 *            #mipi_syst_handle.systh_guid value. The protocol decoder
662 *            uses this value to route data from `MIPI_SYST_WRITE()` calls
663 *            to other cascaded decoders to actually
664 *            process the contents.
665 * @param p pointer to raw data to send
666 * @param len 16-bit length of data to send
667 *
668 * Example:
669 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
670 *
671 * #define THIS_FILE 100
672 *
673 * // emit raw data under user defined decode ID 5
674 * //
675 * unsigned char data[] = { 0,1,2,3,4,5,6,7,8,9 };
676 *
677 * MIPI_SYST_WRITE_LOC16(systh, MIPI_SYST_SEVERITY_INFO,
678                         THIS_FILE, 5, data, sizeof(data));
679 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
680 */
681 #define MIPI_SYST_WRITE_LOC16(h, sev, file, id,  p, len) \
682 	mipi_syst_write_raw_message((h),\
683 		mipi_syst_make_file_location32((h), \
684 				(mipi_syst_u16)(file), \
685 				(mipi_syst_u16)MIPI_SYST_LINE),\
686 				(sev), (id), (p), (len))
687 
688 /**
689 * Send raw data message with user defined payload.<BR>
690 *
691 * @param h mipi_syst_handle* SyS-T handle
692 * @param sev mipi_syst_severity severity level (0..7)
693 * @param file file ID as 32-bit value
694 * @param id 8-bit message protocol ID. This ID is used to identify
695 *            the data protocol in the payload of this message for pretty
696 *            printing in trace decoders. The protocol ID must uniquely
697 *            identify the contents within the SyS-T handle's
698 *            #mipi_syst_msg_tag.et_modunit id or
699 *            #mipi_syst_handle.systh_guid value. The protocol decoder
700 *            uses this value to route data from `MIPI_SYST_WRITE()` calls
701 *            to other cascaded decoders to actually
702 *            process the contents.
703 * @param p pointer to raw data to send
704 * @param len 16-bit length of data to send
705 *
706 * Example:
707 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
708 *
709 * #define THIS_FILE 100
710 *
711 * // emit raw data under user defined decode ID 5
712 * //
713 * unsigned char data[] = { 0,1,2,3,4,5,6,7,8,9 };
714 *
715 * MIPI_SYST_WRITE_LOC16(systh, MIPI_SYST_SEVERITY_INFO,
716 THIS_FILE, 5, data, sizeof(data));
717 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
718 */
719 #define MIPI_SYST_WRITE_LOC32(h, sev, file, id, p, len) \
720 	mipi_syst_write_raw_message((h),\
721 		mipi_syst_make_file_location64((h), \
722 				(mipi_syst_u32)(file), \
723 				(mipi_syst_u32)MIPI_SYST_LINE),\
724 				(sev), (id), (p), (len))
725 
726 #endif	/* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
727 
728 /** @} */
729 
730 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
731 mipi_syst_write_raw_message(struct mipi_syst_handle* svh,
732 		struct mipi_syst_msglocation* loc,
733 		enum mipi_syst_severity severity,
734 		mipi_syst_u8 subtype,
735 		const void *data, mipi_syst_u16 length);
736 
737 #endif	/* #if defined(MIPI_SYST_PCFG_ENABLE_WRITE_API) */
738 
739 /**
740 * @defgroup BuildAPI Build Number Message Macros
741 * @ingroup ApiSets
742 *
743 * Build Number writing macros:
744 * @{
745 */
746 /**
747 
748 * Send compact client build number message with 22-bit payload.<BR>
749 *
750 * This API is indented for space and speed restricted environments that
751 * cannot support the more complex message types.
752 * @param h mipi_syst_handle* SyS-T handle
753 * @param n 22-bit output value. The upper 10 bits of the parameter value
754 *          are discarded.
755 *
756 * Example:
757 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
758 * #define MY_BUILDID  0x3FFFFF
759 *
760 * foo()
761 * {
762 *      MIPI_SYST_BUILD_COMPACT32(svh, MY_BUILDID);
763 * }
764 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
765 */
766 #define MIPI_SYST_BUILD_COMPACT32(h, n) \
767 	if (h) { MIPI_SYST_OUTPUT_D32MTS(h, (\
768 		(((n) & 0x000FFFFF) << 4)  | \
769 		((n) & 0xFFF00000) << 10));}
770 
771 /**
772 * Send compact client build number message with 54-bit payload.<BR>
773 *
774 * This API is indented for space and speed restricted environments that
775 * cannot support the more complex message types.
776 * @param h mipi_syst_handle* SyS-T handle
777 * @param n 54-bit output value. The upper 10 bits of the parameter value
778 *          are discarded.
779 *
780 * Example:
781 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
782 * #define MY_BUILDID  0x3FFFFFFFFFFFFFull
783 *
784 * foo()
785 * {
786 *      MIPI_SYST_BUILD_COMPACT64(svh, MY_BUILDID);
787 * }
788 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
789 */
790 #define MIPI_SYST_BUILD_COMPACT64(h, n) \
791 	if (h) { MIPI_SYST_OUTPUT_D64MTS(h, (\
792 		(0x00000000001000000ull | \
793 		 ((n) & 0x00000000000FFFFFull) << 4)  | \
794 		 ((n) & 0xFFFFFFFFFFF00000ull) << 10));}
795 
796 
797 #if defined(MIPI_SYST_PCFG_ENABLE_BUILD_API)
798 
799 /**
800  * Send client build number data message
801  *
802  * @param h mipi_syst_handle* SyS-T handle
803  * @param sev mipi_syst_severity severity level (0..7)
804  * @param bld 64-bit build ID.
805  * @param txt pointer to textual build description
806  * @param len 16-bit length of text data to send
807  *
808  * Example:
809  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
810  *
811  * #define BUILD_NUMBER 0x1122334455667788ull
812  * #define BUILD_BANNER "MyApp-v1.2.3 (April 16 2018)"
813  *
814  * MIPI_SYST_BUILD(systh, MIPI_SYST_SEVERITY_INFO,
815  *      BUILD_NUMBER,
816  *      BUILD_BANNER, sizeof(BUILD_BANNER)
817  * );
818  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
819  */
820 #define MIPI_SYST_BUILD(h, sev, bld, txt, len) \
821 	mipi_syst_write_build_message((h), \
822 		MIPI_SYST_NOLOCATION, (sev), (bld), (txt), (len))
823 
824 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
825 
826 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
827 
828  /**
829  * Send client build number data message
830  *
831  * @param h mipi_syst_handle* SyS-T handle
832  * @param sev mipi_syst_severity severity level (0..7)
833  * @param bld 64-bit build ID.
834  * @param txt pointer to textual build description
835  * @param len 16-bit length of text data to send
836  *
837  * Example:
838  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
839  *
840  * #define BUILD_NUMBER 0x1122334455667788ull
841  * #define BUILD_BANNER "MyApp-v1.2.3 (April 16 2018)"
842  *
843  * MIPI_SYST_BUILD_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO,
844  *      BUILD_NUMBER,
845  *      BUILD_BANNER, sizeof(BUILD_BANNER)
846  * );
847  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
848  */
849 #define MIPI_SYST_BUILD_LOCADDR(h, sev, bld, txt, len) \
850 	mipi_syst_write_build_message((h),\
851 		mipi_syst_make_address_location((h), mipi_syst_return_addr()),\
852 		(sev), (bld), (txt), (len))
853 
854 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
855 
856  /**
857  * Send client build number data message
858  *
859  * @param h mipi_syst_handle* SyS-T handle
860  * @param sev mipi_syst_severity severity level (0..7)
861  * @param file file ID as 16-bit value
862  * @param bld 64-bit build ID.
863  * @param txt pointer to textual textual build description
864  * @param len 16-bit length of text data to send
865  *
866  * Example:
867  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
868  *
869  * #define BUILD_NUMBER 0x1122334455667788ull
870  * #define BUILD_BANNER "MyApp-v1.2.3 (April 16 2018)"
871  *
872  * MIPI_SYST_BUILD_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10,
873  *      BUILD_NUMBER,
874  *      BUILD_BANNER, sizeof(BUILD_BANNER)
875  * );
876  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
877  */
878 #define MIPI_SYST_BUILD_LOC16(h, sev, file, bld,  txt, len) \
879 	mipi_syst_write_build_message((h),\
880 		mipi_syst_make_file_location32((h), \
881 				(mipi_syst_u16)(file), \
882 				(mipi_syst_u16)MIPI_SYST_LINE),\
883 				(sev), (bld), (txt), (len))
884 
885  /**
886  * Send client build number data message
887  *
888  * @param h mipi_syst_handle* SyS-T handle
889  * @param sev mipi_syst_severity severity level (0..7)
890  * @param file file ID as 32-bit value
891  * @param bld 64-bit build ID.
892  * @param txt pointer to textual build description
893  * @param len 16-bit length of text data to send
894  *
895  * Example:
896  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
897  *
898  * #define BUILD_NUMBER 0x1122334455667788ull
899  * #define BUILD_BANNER "MyApp-v1.2.3 (April 16 2018)"
900  *
901  * MIPI_SYST_BUILD_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10,
902  *      BUILD_NUMBER,
903  *      BUILD_BANNER, sizeof(BUILD_BANNER)
904  * );
905  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
906  */
907 #define MIPI_SYST_BUILD_LOC32(h, sev, file, bld, txt, len) \
908 	mipi_syst_write_build_message((h),\
909 		mipi_syst_make_file_location64((h), \
910 				(mipi_syst_u32)(file), \
911 				(mipi_syst_u32)MIPI_SYST_LINE),\
912 				(sev), (bld), (txt), (len))
913 
914 #endif	/* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
915 
916 /** @} */
917 
918 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
919 mipi_syst_write_build_message(struct mipi_syst_handle* svh,
920 		struct mipi_syst_msglocation* loc,
921 		enum mipi_syst_severity severity,
922 		mipi_syst_u64 id,
923 		const char *text, mipi_syst_u16 length);
924 #endif /* defined(MIPI_SYST_PCFG_ENABLE_BUILD_API) */
925 
926 /* public API prototypes */
927 
928 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
929 mipi_syst_init(struct mipi_syst_header* header, mipi_syst_inithook_t pfinit,
930 		const void * init_data);
931 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV mipi_syst_destroy(struct mipi_syst_header*
932 		header,
933 		mipi_syst_destroyhook_t
934 		pfdestroy);
935 MIPI_SYST_EXPORT struct mipi_syst_handle* MIPI_SYST_CALLCONV
936 mipi_syst_init_handle(struct mipi_syst_header* header, struct mipi_syst_handle* svh,
937 		const struct mipi_syst_origin *origin,
938 		mipi_syst_u32 heap);
939 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV mipi_syst_delete_handle(struct mipi_syst_handle*
940 		svh);
941 
942 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
943 MIPI_SYST_EXPORT void *MIPI_SYST_CALLCONV mipi_syst_return_addr(void);
944 #endif
945 
946 /* Inline helper functions
947  * These functions are only attempted to be inlined if the define
948  * MIPI_SYST_PCFG_ENABLE_INLINE is defined.
949  * Undefining it causes true functions calls to be used instead.
950  * This is useful if saving code space matters more then speed.
951  */
952 #if defined(MIPI_SYST_PCFG_ENABLE_INLINE)
953 #include "./inline.h"
954 #else
955 MIPI_SYST_INLINE struct mipi_syst_msglocation* MIPI_SYST_CALLCONV
956 mipi_syst_make_file_location32(struct mipi_syst_handle* h, mipi_syst_u16 f,
957 		mipi_syst_u16 l);
958 MIPI_SYST_INLINE struct mipi_syst_msglocation* MIPI_SYST_CALLCONV
959 mipi_syst_make_file_location64(struct mipi_syst_handle* h, mipi_syst_u32 f,
960 		mipi_syst_u32 l);
961 MIPI_SYST_INLINE struct mipi_syst_msglocation* MIPI_SYST_CALLCONV
962 mipi_syst_make_address_location(struct mipi_syst_handle* h, void *p);
963 
964 MIPI_SYST_INLINE void MIPI_SYST_CALLCONV mipi_syst_make_param0(struct mipi_syst_handle* h);
965 MIPI_SYST_INLINE void MIPI_SYST_CALLCONV
966 mipi_syst_make_param1(struct mipi_syst_handle* h, mipi_syst_u32 p1);
967 MIPI_SYST_INLINE void MIPI_SYST_CALLCONV
968 mipi_syst_make_param2(struct mipi_syst_handle* h, mipi_syst_u32 p1,
969 		mipi_syst_u32 p2);
970 MIPI_SYST_INLINE void MIPI_SYST_CALLCONV mipi_syst_make_param3(struct mipi_syst_handle* h,
971 		mipi_syst_u32 p1,
972 		mipi_syst_u32 p2,
973 		mipi_syst_u32 p3);
974 MIPI_SYST_INLINE void MIPI_SYST_CALLCONV mipi_syst_make_param4(struct mipi_syst_handle* h,
975 		mipi_syst_u32 p1,
976 		mipi_syst_u32 p2,
977 		mipi_syst_u32 p3,
978 		mipi_syst_u32 p4);
979 MIPI_SYST_INLINE void MIPI_SYST_CALLCONV mipi_syst_make_param5(struct mipi_syst_handle* h,
980 		mipi_syst_u32 p1,
981 		mipi_syst_u32 p2,
982 		mipi_syst_u32 p3,
983 		mipi_syst_u32 p4,
984 		mipi_syst_u32 p5);
985 MIPI_SYST_INLINE void MIPI_SYST_CALLCONV mipi_syst_make_param6(struct mipi_syst_handle* h,
986 		mipi_syst_u32 p1,
987 		mipi_syst_u32 p2,
988 		mipi_syst_u32 p3,
989 		mipi_syst_u32 p4,
990 		mipi_syst_u32 p5,
991 		mipi_syst_u32 p6);
992 #endif
993 
994 
995 #if defined(MIPI_SYST_PCFG_ENABLE_STRING_API)
996 
997 #define _MIPI_SYST_ASSERT_DEBUG_STRING(cond) \
998 	MIPI_SYST_FILE ":" _MIPI_SYST_CPP_TOSTR(MIPI_SYST_LINE) " " #cond
999 
1000 /**
1001  * @defgroup StringAPI String Generating Macros
1002  * @ingroup ApiSets
1003  *
1004  * String generating macros:
1005  * @{
1006  */
1007 
1008 /**
1009  * Send UTF-8 character string with given severity and length.<BR>
1010  *
1011  * @param h mipi_syst_handle* SyS-T handle
1012  * @param severity mipi_syst_severity severity level (0..7)
1013  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1014  * @param len mipi_syst_u16 number of bytes to emit
1015  *
1016  * Example:
1017  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1018  * #define FILE_ID 0xabdc // this file id
1019  * char * str = "Hello World";
1020  *
1021  * MIPI_SYST_DEBUG(systh, MIPI_SYST_SEVERITY_INFO, str, strlen(str));
1022  * MIPI_SYST_DEBUG_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO, str, strlen(str));
1023  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1024  */
1025 #define MIPI_SYST_DEBUG(h, severity, str, len) \
1026 	mipi_syst_write_debug_string((h), MIPI_SYST_NOLOCATION, \
1027 			MIPI_SYST_STRING_GENERIC, \
1028 			(severity), (len), (str))
1029 
1030 /**
1031  * Send function enter string message.
1032  *
1033  * @param h mipi_syst_handle* SyS-T handle
1034  * @param severity mipi_syst_severity severity level (0..7)
1035  *
1036  * Example:
1037  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1038  * void foo()
1039  * {
1040  *    MIPI_SYST_FUNC_ENTER(systh, MIPI_SYST_SEVERITY_INFO);
1041  *    // body
1042  *    MIPI_SYST_FUNC_EXIT(systh, MIPI_SYST_SEVERITY_INFO);
1043  * }
1044  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1045  */
1046 #define MIPI_SYST_FUNC_ENTER(h, severity) \
1047 	mipi_syst_write_debug_string((h), MIPI_SYST_NOLOCATION, \
1048 			MIPI_SYST_STRING_FUNCTIONENTER, \
1049 			(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1050 			MIPI_SYST_FUNCTION_NAME)
1051 
1052 /**
1053  * Send function exit string message.
1054  * The payload is the UTF-8 function name of the surrounding function
1055  *
1056  * @param h mipi_syst_handle* SyS-T handle
1057  * @param severity mipi_syst_severity severity level (0..7)
1058  *
1059  * Example:
1060  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1061  * void foo()
1062  * {
1063  *    MIPI_SYST_FUNC_ENTER(systh, MIPI_SYST_SEVERITY_INFO);
1064  *    // body
1065  *    MIPI_SYST_FUNC_EXIT(systh, MIPI_SYST_SEVERITY_INFO);
1066  * }
1067  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1068  */
1069 #define MIPI_SYST_FUNC_EXIT(h, severity) \
1070 	mipi_syst_write_debug_string((h), MIPI_SYST_NOLOCATION, \
1071 			MIPI_SYST_STRING_FUNCTIONEXIT, \
1072 			(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1073 			MIPI_SYST_FUNCTION_NAME)
1074 
1075 /**
1076  * Send assertion notice string message if the passed condition is false.
1077  * The notice includes the failing expression string as its payload.
1078  *
1079  * @param h mipi_syst_handle* SyS-T handle
1080  * @param severity mipi_syst_severity severity level (0..7)
1081  * @param cond boolean condition to verify
1082  *
1083  * Example:
1084  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1085  * void foo(void * p)
1086  * {
1087  *    MIPI_SYST_ASSERT(systh, MIPI_SYST_SEVERITY_ERROR, p != NULL);
1088  * }
1089  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1090  */
1091 #define MIPI_SYST_ASSERT(h, severity, cond) \
1092 	{\
1093 	if (!(cond)) {\
1094 		mipi_syst_write_debug_string((h),\
1095 			MIPI_SYST_NOLOCATION,\
1096 			MIPI_SYST_STRING_ASSERT, \
1097 			(severity), sizeof(_MIPI_SYST_ASSERT_DEBUG_STRING(cond)),\
1098 			_MIPI_SYST_ASSERT_DEBUG_STRING(cond));\
1099 		} \
1100 	}
1101 
1102 
1103 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
1104 
1105  /**
1106  * Send UTF-8 character string with given severity and length.<BR>
1107  *
1108  * @param h mipi_syst_handle* SyS-T handle
1109  * @param severity mipi_syst_severity severity level (0..7)
1110  * @param file 16-bit user defined file ID
1111  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1112  * @param len mipi_syst_u16 number of bytes to emit
1113  *
1114  * Example:
1115  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1116  * #define FILE_ID 0xabdc // this file id
1117  * char * str = "Hello World";
1118  *
1119  * MIPI_SYST_DEBUG_LOC16(systh, MIPI_SYST_SEVERITY_INFO, FILE_ID, str, strlen(str));
1120  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1121  */
1122 #define MIPI_SYST_DEBUG_LOC16(h, severity, file, str, len) \
1123 	mipi_syst_write_debug_string((h), \
1124 		mipi_syst_make_file_location32((h), \
1125 			(mipi_syst_u16)(file), \
1126 			(mipi_syst_u16)MIPI_SYST_LINE),\
1127 		MIPI_SYST_STRING_GENERIC, \
1128 		(severity), (len), (str))
1129  /**
1130  * Send UTF-8 character string with given severity and length.<BR>
1131  *
1132  * @param h mipi_syst_handle* SyS-T handle
1133  * @param severity mipi_syst_severity severity level (0..7)
1134  * @param file 32-bit user defined file ID
1135  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1136  * @param len mipi_syst_u16 number of bytes to emit
1137  *
1138  * Example:
1139  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1140  * #define FILE_ID 0x0000abdc // this file id
1141  * char * str = "Hello World";
1142  *
1143  * MIPI_SYST_DEBUG_LOC32(systh, MIPI_SYST_SEVERITY_INFO, FILE_ID, str, strlen(str));
1144  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1145  */
1146 #define MIPI_SYST_DEBUG_LOC32(h, severity, file, str, len) \
1147 	mipi_syst_write_debug_string((h), \
1148 		mipi_syst_make_file_location64((h), \
1149 			(mipi_syst_u32)(file), \
1150 			(mipi_syst_u32)MIPI_SYST_LINE),\
1151 		MIPI_SYST_STRING_GENERIC, \
1152 		(severity), (len), (str))
1153 
1154  /**
1155  * Send function enter string message.
1156  * The payload is the UTF-8 function name of the surrounding function.
1157  *
1158  * @param h mipi_syst_handle* SyS-T handle
1159  * @param severity mipi_syst_severity severity level (0..7)
1160  * @param file 16-bit user defined file ID
1161  *
1162  * Example:
1163  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1164  * void foo()
1165  * {
1166  *    MIPI_SYST_FUNC_ENTER_LOC16(systh, 10, MIPI_SYST_SEVERITY_INFO);
1167  *    // body
1168  *    MIPI_SYST_FUNC_EXIT_LOC16(systh, 10, MIPI_SYST_SEVERITY_INFO);
1169  * }
1170  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1171  */
1172 #define MIPI_SYST_FUNC_ENTER_LOC16(h, severity, file) \
1173 	mipi_syst_write_debug_string((h),\
1174 		mipi_syst_make_file_location32((h), \
1175 			(mipi_syst_u16)(file), \
1176 			(mipi_syst_u16)MIPI_SYST_LINE),\
1177 		MIPI_SYST_STRING_FUNCTIONENTER, \
1178 		(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1179 		MIPI_SYST_FUNCTION_NAME)
1180 
1181  /**
1182  * Send function exit string message.
1183  * The payload is the UTF-8 function name of the surrounding function.
1184  *
1185  * @param h mipi_syst_handle* SyS-T handle
1186  * @param severity mipi_syst_severity severity level (0..7)
1187  * @param file 16-bit user defined file ID
1188  *
1189  * Example:
1190  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1191  * void foo()
1192  * {
1193  *    MIPI_SYST_FUNC_ENTER_LOC16(systh, 10, MIPI_SYST_SEVERITY_INFO);
1194  *    // body
1195  *    MIPI_SYST_FUNC_EXIT_LOC16(systh, 10, MIPI_SYST_SEVERITY_INFO);
1196  * }
1197  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1198  */
1199 #define MIPI_SYST_FUNC_EXIT_LOC16(h, severity, file) \
1200 	mipi_syst_write_debug_string((h),\
1201 		mipi_syst_make_file_location32((h), \
1202 			(mipi_syst_u16)(file), \
1203 			(mipi_syst_u16)MIPI_SYST_LINE),\
1204 		MIPI_SYST_STRING_FUNCTIONEXIT, \
1205 		(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1206 		MIPI_SYST_FUNCTION_NAME)
1207 
1208 /**
1209 * Send assertion notice string message if the passed condition is false.
1210 * The notice includes the failing expression string as its payload.
1211 *
1212 * @param h mipi_syst_handle* SyS-T handle
1213 * @param severity mipi_syst_severity severity level (0..7)
1214 * @param file 16-bit  user defined file ID
1215 * @param cond boolean condition to verify
1216 *
1217 * Example:
1218 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1219 * void foo(void * p)
1220 * {
1221 *    MIPI_SYST_ASSERT(systh, 1, MIPI_SYST_SEVERITY_ERROR, p != NULL);
1222 * }
1223 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1224 */
1225 #define MIPI_SYST_ASSERT_LOC16(h, severity, file, cond) \
1226 	{\
1227 	if (!(cond)) {\
1228 		mipi_syst_write_debug_string((h),\
1229 			mipi_syst_make_file_location32((h), \
1230 					(mipi_syst_u16)(file), \
1231 					(mipi_syst_u16)MIPI_SYST_LINE),\
1232 			MIPI_SYST_STRING_ASSERT, \
1233 			(severity), sizeof(_MIPI_SYST_ASSERT_DEBUG_STRING(cond)),\
1234 			_MIPI_SYST_ASSERT_DEBUG_STRING(cond));\
1235 		} \
1236 	}
1237 /**
1238 * Send function enter string message.
1239 * The payload is the UTF-8 function name of the surrounding function.
1240 *
1241 * @param h mipi_syst_handle* SyS-T handle
1242 * @param severity mipi_syst_severity severity level (0..7)
1243 * @param file 32-bit user defined file ID
1244 *
1245 * Example:
1246 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1247 * void foo()
1248 * {
1249 *    MIPI_SYST_FUNC_ENTER_LOC32(systh, 10, MIPI_SYST_SEVERITY_INFO);
1250 *    // body
1251 *    MIPI_SYST_FUNC_EXIT_LOC32(systh, 10, MIPI_SYST_SEVERITY_INFO);
1252 * }
1253 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1254 */
1255 #define MIPI_SYST_FUNC_ENTER_LOC32(h, severity, file) \
1256 	mipi_syst_write_debug_string((h),\
1257 		mipi_syst_make_file_location64((h), \
1258 				(mipi_syst_u32)(file), \
1259 				(mipi_syst_u32)MIPI_SYST_LINE),\
1260 		MIPI_SYST_STRING_FUNCTIONENTER, \
1261 		(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1262 		MIPI_SYST_FUNCTION_NAME)
1263 /**
1264 * Send function exit string message.
1265 * The payload is the UTF-8 function name of the surrounding function.
1266 *
1267 * @param h mipi_syst_handle* SyS-T handle
1268 * @param severity mipi_syst_severity severity level (0..7)
1269 * @param file 32-bit user defined file ID
1270 *
1271 * Example:
1272 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1273 * void foo()
1274 * {
1275 *    MIPI_SYST_FUNC_ENTER_LOC32(systh, 10, MIPI_SYST_SEVERITY_INFO);
1276 *    // body
1277 *    MIPI_SYST_FUNC_EXIT_LOC32(systh, 10, MIPI_SYST_SEVERITY_INFO);
1278 * }
1279 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1280 */
1281 #define MIPI_SYST_FUNC_EXIT_LOC32(h, severity, file) \
1282 	mipi_syst_write_debug_string((h),\
1283 		mipi_syst_make_file_location64((h), \
1284 				(mipi_syst_u32)(file), \
1285 				(mipi_syst_u32)MIPI_SYST_LINE),\
1286 		MIPI_SYST_STRING_FUNCTIONEXIT, \
1287 		(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1288 		MIPI_SYST_FUNCTION_NAME)
1289 /**
1290 * Send assertion notice string message if the passed condition is false.
1291 * The notice includes the failing expression string as its payload.
1292 *
1293 * @param h mipi_syst_handle* SyS-T handle
1294 * @param severity mipi_syst_severity severity level (0..7)
1295 * @param file 32-bit  user defined file ID
1296 * @param cond boolean condition to verify
1297 *
1298 * Example:
1299 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1300 * void foo(void * p)
1301 * {
1302 *    MIPI_SYST_ASSERT(systh, 1, MIPI_SYST_SEVERITY_ERROR, p != NULL);
1303 * }
1304 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1305 */
1306 #define MIPI_SYST_ASSERT_LOC32(h, severity, file, cond) \
1307 	{ \
1308 	if (!(cond)) {\
1309 		mipi_syst_write_debug_string((h),\
1310 			mipi_syst_make_file_location64((h), \
1311 					(mipi_syst_u32)(file), \
1312 					(mipi_syst_u32)MIPI_SYST_LINE),\
1313 			MIPI_SYST_STRING_ASSERT, \
1314 			(severity), sizeof(_MIPI_SYST_ASSERT_DEBUG_STRING(cond)),\
1315 			_MIPI_SYST_ASSERT_DEBUG_STRING(cond));\
1316 		} \
1317 	}
1318 
1319 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
1320 
1321 /** @copydoc MIPI_SYST_DEBUG */
1322 #define MIPI_SYST_DEBUG_LOCADDR(h, severity, str, len) \
1323 	mipi_syst_write_debug_string((h), \
1324 		mipi_syst_make_address_location((h),\
1325 			mipi_syst_return_addr()),\
1326 		MIPI_SYST_STRING_GENERIC, \
1327 		(severity), (len), (str))
1328 
1329 /**
1330 * Send function enter string message.
1331 * The payload is the UTF-8 function name of the surrounding function.
1332 
1333 *
1334 * @param h mipi_syst_handle* SyS-T handle
1335 * @param severity mipi_syst_severity severity level (0..7)
1336 *
1337 * Example:
1338 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1339 * void foo()
1340 * {
1341 *    MIPI_SYST_FUNC_ENTER_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO);
1342 *    // body
1343 *    MIPI_SYST_FUNC_EXIT_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO);
1344 * }
1345 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1346 */
1347 #define MIPI_SYST_FUNC_ENTER_LOCADDR(h, severity) \
1348 	mipi_syst_write_debug_string((h),\
1349 		mipi_syst_make_address_location((h),\
1350 			mipi_syst_return_addr()),\
1351 		MIPI_SYST_STRING_FUNCTIONENTER, \
1352 		(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1353 		MIPI_SYST_FUNCTION_NAME)
1354 
1355 /**
1356 * Send function exit string message. The payload is the UTF-8 function name
1357 * of the surrounding function
1358 *
1359 * @param h mipi_syst_handle* SyS-T handle
1360 * @param severity mipi_syst_severity severity level (0..7)
1361 *
1362 * Example:
1363 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1364 * void foo()
1365 * {
1366 *    MIPI_SYST_FUNC_ENTER_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO);
1367 *    // body
1368 *    MIPI_SYST_FUNC_EXIT_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO);
1369 * }
1370 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1371 */
1372 #define MIPI_SYST_FUNC_EXIT_LOCADDR(h, severity) \
1373 	mipi_syst_write_debug_string((h),\
1374 		mipi_syst_make_address_location((h),\
1375 			mipi_syst_return_addr()),\
1376 		MIPI_SYST_STRING_FUNCTIONEXIT, \
1377 		(severity), sizeof(MIPI_SYST_FUNCTION_NAME),\
1378 		MIPI_SYST_FUNCTION_NAME)
1379 
1380 /** @copydoc  MIPI_SYST_ASSERT(svh, severity) */
1381 #define MIPI_SYST_ASSERT_LOCADDR(h, severity, cond) \
1382 	{ \
1383 	if (!(cond)) {\
1384 		mipi_syst_write_debug_string((h),\
1385 		mipi_syst_make_address_location((h),\
1386 			mipi_syst_return_addr()),\
1387 		MIPI_SYST_STRING_ASSERT, \
1388 		(severity), sizeof(_MIPI_SYST_ASSERT_DEBUG_STRING(cond)),\
1389 		 _MIPI_SYST_ASSERT_DEBUG_STRING(cond));\
1390 		} \
1391 	}
1392 
1393 #endif		/* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
1394 
1395 #endif		/* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
1396 
1397 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
1398 mipi_syst_write_debug_string(struct mipi_syst_handle* svh,
1399 		struct mipi_syst_msglocation* loc,
1400 		enum mipi_syst_subtype_string type,
1401 		enum mipi_syst_severity severity,
1402 		mipi_syst_u16 len, const char *str);
1403 
1404 #endif		/* defined (MIPI_SYST_PCFG_ENABLE_STRING_API) */
1405 
1406 #if defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API)
1407 
1408 /**
1409  * Send UTF-8 character string in C99 printf format together with
1410  * the arguments to support printf() style output formatting.
1411  *
1412  * @param h mipi_syst_handle* SyS-T handle
1413  * @param severity mipi_syst_severity severity level (0..7)
1414  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1415  * @param ... optional format arguments
1416  *
1417  * Example:
1418  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1419  *
1420  * MIPI_SYST_PRINTF(systh, MIPI_SYST_SEVERITY_INFO,
1421  *             "The %s jumps over the %s %d times", "cow", "moon", 10);
1422  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1423  */
1424 #define MIPI_SYST_PRINTF(h, severity, str, ...) \
1425 		mipi_syst_write_printf_string((h), MIPI_SYST_NOLOCATION, \
1426 			(severity),\
1427 			(str),\
1428 			##__VA_ARGS__)
1429 
1430 /**
1431  * Send UTF-8 character string in C99 printf format together with
1432  * the arguments to support printf() style output formatting.
1433  *
1434  * @param h mipi_syst_handle* SyS-T handle
1435  * @param severity mipi_syst_severity severity level (0..7)
1436  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1437  * @param args variable argument list of format arguments
1438  *
1439  * Example:
1440  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1441  *
1442  * MIPI_SYST_VPRINTF(systh, MIPI_SYST_SEVERITY_INFO,
1443  *             "The %s jumps over the %s %d times", "cow", "moon", 10);
1444  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1445  */
1446 #define MIPI_SYST_VPRINTF(h, severity, str, args) \
1447 		mipi_syst_write_vprintf_string((h), MIPI_SYST_NOLOCATION, \
1448 			(severity),\
1449 			(str),\
1450 			(args))
1451 
1452 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
1453 
1454  /**
1455  * Send UTF-8 character string in C99 printf format together with
1456  * the arguments to support printf() style output formatting.
1457  *
1458  * @param h mipi_syst_handle* SyS-T handle
1459  * @param severity mipi_syst_severity severity level (0..7)
1460  * @param file 16-bit  user defined file ID
1461  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1462  * @param ... optional format arguments
1463  *
1464  * Example:
1465  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1466  *
1467  * MIPI_SYST_PRINTF_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10,
1468  *             "The %s jumps over the %s %d times", "cow", "moon", 10);
1469  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1470  */
1471 #define MIPI_SYST_PRINTF_LOC16(h, severity, file, str, ...) \
1472 		mipi_syst_write_printf_string((h), \
1473 			mipi_syst_make_file_location32((h), \
1474 					(mipi_syst_u16)(file), \
1475 					(mipi_syst_u16)MIPI_SYST_LINE),\
1476 			(severity),\
1477 			(str),\
1478 			##__VA_ARGS__)
1479 
1480  /**
1481  * Send UTF-8 character string in C99 printf format together with
1482  * the arguments to support printf() style output formatting.
1483  *
1484  * @param h mipi_syst_handle* SyS-T handle
1485  * @param severity mipi_syst_severity severity level (0..7)
1486  * @param file 32-bit  user defined file ID
1487  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1488  * @param ... optional format arguments
1489  *
1490  * Example:
1491  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1492  *
1493  * MIPI_SYST_PRINTF_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10,
1494  *             "The %s jumps over the %s %d times", "cow", "moon", 10);
1495  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1496  */
1497 #define MIPI_SYST_PRINTF_LOC32(h, severity, file, str, ...) \
1498 		mipi_syst_write_printf_string((h), \
1499 			mipi_syst_make_file_location64((h), \
1500 					(mipi_syst_u32)(file), \
1501 					(mipi_syst_u32)MIPI_SYST_LINE),\
1502 			(severity),\
1503 			(str),\
1504 			##__VA_ARGS__)
1505 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
1506 
1507  /**
1508  * Send UTF-8 character string in C99 printf format together with
1509  * the arguments to support printf() style output formatting.
1510  *
1511  * @param h mipi_syst_handle* SyS-T handle
1512  * @param severity mipi_syst_severity severity level (0..7)
1513  * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes
1514  * @param ... optional format arguments
1515  *
1516  * Example:
1517  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1518  *
1519  * MIPI_SYST_PRINTF_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO,
1520  *             "The %s jumps over the %s %d times", "cow", "moon", 10);
1521  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1522  */
1523 #define MIPI_SYST_PRINTF_LOCADDR(h, severity, str, ...) \
1524 		mipi_syst_write_printf_string((h), \
1525 			mipi_syst_make_address_location((h),\
1526 					mipi_syst_return_addr()),\
1527 			(severity), \
1528 			(str),\
1529 			##__VA_ARGS__)
1530 
1531 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
1532 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
1533 
1534 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
1535 mipi_syst_write_vprintf_string(struct mipi_syst_handle* svh,
1536 		struct mipi_syst_msglocation* loc,
1537 		enum mipi_syst_severity severity,
1538 		const char *fmt,
1539 		va_list args);
1540 
1541 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
1542 mipi_syst_write_printf_string(struct mipi_syst_handle* svh,
1543 		struct mipi_syst_msglocation* loc,
1544 		enum mipi_syst_severity severity,
1545 		const char *fmt,
1546 		...);
1547 
1548 #endif /* MIPI_SYST_PCFG_ENABLE_PRINTF_API */
1549 
1550 /** @} */
1551 
1552 /** Parameter encoding values for vararg style catalog APIs
1553   */
1554 enum mipi_syst_catalog_parameter_types {
1555 	_MIPI_SYST_CATARG_END  =  0,            /**< end of parameter list      */
1556 	_MIPI_SYST_CATARG_D    =  1,            /**< int  like %d               */
1557 	_MIPI_SYST_CATARG_LD   =  2,            /**< long like %ld              */
1558 	_MIPI_SYST_CATARG_LLD  =  3,            /**< long long like %lld        */
1559 	_MIPI_SYST_CATARG_ZD   =  4,            /**< size_t like %z             */
1560 	_MIPI_SYST_CATARG_TD   =  5,            /**< ptrdiff_t like %t          */
1561 	_MIPI_SYST_CATARG_F    =  6,            /**< double like %f             */
1562 	_MIPI_SYST_CATARG_LF   =  7,            /**< long double like %lf       */
1563 	_MIPI_SYST_CATARG_C    =  8,            /**< char like %c               */
1564 	_MIPI_SYST_CATARG_HHD  =  9,            /**< short like %hhd            */
1565 	_MIPI_SYST_CATARG_LC   = 10,            /**< long char like %lc         */
1566 	_MIPI_SYST_CATARG_P    = 11,            /**< void * like %p or %n       */
1567 	_MIPI_SYST_CATARG_CSTR = 12             /**< char * like %s             */
1568 };
1569 #define _MIPI_SYST_MK_PARAM_LIST(tag, p) _MIPI_SYST_CATARG_##tag, p
1570 
1571 #define MIPI_SYST_PARAM_INT(p)         _MIPI_SYST_MK_PARAM_LIST(D, (p))        /**< int  like %d               */
1572 #define MIPI_SYST_PARAM_LONG(p)        _MIPI_SYST_MK_PARAM_LIST(LD, (p))       /**< long like %ld              */
1573 #define MIPI_SYST_PARAM_LONGLONG(p)    _MIPI_SYST_MK_PARAM_LIST(LLD, (p))      /**< long long like %lld        */
1574 #define MIPI_SYST_PARAM_SIZE_T(p)      _MIPI_SYST_MK_PARAM_LIST(ZD, (p))       /**< size_t like %z             */
1575 #define MIPI_SYST_PARAM_PTRDIFF_T(p)   _MIPI_SYST_MK_PARAM_LIST(TD, (p))       /**< ptrdiff_t like %t          */
1576 #define MIPI_SYST_PARAM_FLOAT(p)       _MIPI_SYST_MK_PARAM_LIST(F, (p))        /**< float like %f              */
1577 #define MIPI_SYST_PARAM_DOUBLE(p)      _MIPI_SYST_MK_PARAM_LIST(F, (p))        /**< double like %f             */
1578 #define MIPI_SYST_PARAM_LONGDOUBLE(p)  _MIPI_SYST_MK_PARAM_LIST(LF, (p))       /**< long double like %lf       */
1579 #define MIPI_SYST_PARAM_CHAR(p)        _MIPI_SYST_MK_PARAM_LIST(C, (p))        /**< char like %c               */
1580 #define MIPI_SYST_PARAM_SHORT(p)       _MIPI_SYST_MK_PARAM_LIST(HHD, (p))      /**< short like %hhd            */
1581 #define MIPI_SYST_PARAM_WCHAR(p)       _MIPI_SYST_MK_PARAM_LIST(LC, (p))       /**< long char like %lc         */
1582 #define MIPI_SYST_PARAM_PTR(p)         _MIPI_SYST_MK_PARAM_LIST(P, (p))        /**< void * like %p or %n       */
1583 #define MIPI_SYST_PARAM_CSTR(p)        _MIPI_SYST_MK_PARAM_LIST(CSTR, (p))     /**< char * like %s             */
1584 
1585 /**
1586  * @defgroup CatAPI64 64-Bit Catalog Message Macros
1587  * @ingroup ApiSets
1588  *
1589  * Catalog message instrumentation API
1590  *
1591  * Note: This API set is enabled or disabled by the
1592  * #MIPI_SYST_PCFG_ENABLE_CATID64_API and/or #MIPI_SYST_PCFG_ENABLE_CATID32_API
1593  * platform feature defines.
1594  * @{
1595  */
1596 
1597 #if defined(MIPI_SYST_PCFG_ENABLE_CATID64_API)
1598 
1599 /**
1600  * Send catalog message with 0-6 parameters.<BR>
1601  * This family of Macros is used to send 32 or 64-bit wide catalog
1602  * message IDs with up to six 32-bit wide parameters into the trace stream.
1603  * The macro names are encoded in the following way:
1604  * MIPI_SYST_CATALOG{ID-WIDTH}_{PARAMETER-COUNT}
1605  *
1606  * Example: A 32-bit ID using catalog function with 3 parameters whould be
1607  * called MIPI_SYST_CATALOG32_3.
1608  *
1609  * @param svh mipi_syst_handle* SyS-T handle
1610  * @param sev mipi_syst_severity severity level (0..7)
1611  * @param id catalog ID
1612  *
1613  * Up to 6 32-Bit numeric parameter follow the catalog ID.
1614  *
1615  * Example:
1616  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1617  *
1618  * // emit plain catalog id (no parameter)
1619  * //
1620  * MIPI_SYST_CATALOG32_0(svh, MIPI_SYST_SEVERITY_ERROR, MSGID_INIT_FAIL);
1621  *
1622  * // catalog id with one parameter
1623  * //
1624  * MIPI_SYST_CATALOG32_1(svh, MIPI_SYST_SEVERITY_INFO, MSGID_SETLEVEL, 0x3);
1625  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1626  */
1627 #define MIPI_SYST_CATALOG64_0(svh, sev, id)\
1628 	(mipi_syst_make_param0(svh),\
1629 	mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
1630 #define MIPI_SYST_CATALOG64_1(svh, sev, id, p1)\
1631 	(mipi_syst_make_param1(svh, p1),\
1632 	mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
1633 #define MIPI_SYST_CATALOG64_2(svh, sev, id, p1, p2)\
1634 	(mipi_syst_make_param2(svh, p1, p2),\
1635 	mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
1636 #define MIPI_SYST_CATALOG64_3(svh, sev, id, p1, p2, p3)\
1637 	(mipi_syst_make_param3(svh, p1, p2, p3),\
1638 	mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
1639 #define MIPI_SYST_CATALOG64_4(svh, sev, id, p1, p2, p3, p4)\
1640 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
1641 	mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
1642 #define MIPI_SYST_CATALOG64_5(svh, sev, id, p1, p2, p3, p4, p5)\
1643 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
1644 	mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
1645 #define MIPI_SYST_CATALOG64_6(svh, sev, id, p1, p2, p3, p4, p5, p6)\
1646 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
1647 	mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
1648 
1649 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
1650 
1651 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
1652 
1653 #define MIPI_SYST_CATALOG64_0_LOCADDR(svh, sev, id)\
1654 	(mipi_syst_make_param0(svh),\
1655 	mipi_syst_write_catalog64_message((svh),\
1656 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
1657 	       (sev), (id)))
1658 #define MIPI_SYST_CATALOG64_1_LOCADDR(svh, sev, id, p1)\
1659 	(mipi_syst_make_param1(svh, p1),\
1660 	mipi_syst_write_catalog64_message((svh),\
1661 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
1662 	       (sev), (id)))
1663 #define MIPI_SYST_CATALOG64_2_LOCADDR(svh, sev, id, p1, p2)\
1664 	(mipi_syst_make_param2(svh, p1, p2),\
1665 	mipi_syst_write_catalog64_message((svh),\
1666 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
1667 	       (sev), (id)))
1668 #define MIPI_SYST_CATALOG64_3_LOCADDR(svh, sev, id, p1, p2, p3)\
1669 	(mipi_syst_make_param3(svh, p1, p2, p3),\
1670 	mipi_syst_write_catalog64_message((svh),\
1671 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
1672 	       (sev), (id)))
1673 #define MIPI_SYST_CATALOG64_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)\
1674 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
1675 	mipi_syst_write_catalog64_message((svh),\
1676 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
1677 	       (sev), (id)))
1678 #define MIPI_SYST_CATALOG64_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)\
1679 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
1680 	mipi_syst_write_catalog64_message((svh),\
1681 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
1682 	       (sev), (id)))
1683 #define MIPI_SYST_CATALOG64_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)\
1684 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
1685 	mipi_syst_write_catalog64_message((svh),\
1686 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
1687 	       (sev), (id)))
1688 
1689 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
1690 
1691 #define MIPI_SYST_CATALOG64_0_LOC16(svh, sev, file, id)\
1692 	(mipi_syst_make_param0(svh),\
1693 	mipi_syst_write_catalog64_message((svh),\
1694 	       mipi_syst_make_file_location32((svh), \
1695 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
1696 	       (sev), (id)))
1697 #define MIPI_SYST_CATALOG64_1_LOC16(svh, sev, file, id, p1)\
1698 	(mipi_syst_make_param1(svh, p1),\
1699 	mipi_syst_write_catalog64_message((svh),\
1700 	       mipi_syst_make_file_location32((svh), \
1701 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
1702 	       (sev), (id)))
1703 #define MIPI_SYST_CATALOG64_2_LOC16(svh, sev, file, id, p1, p2)\
1704 	(mipi_syst_make_param2(svh, p1, p2),\
1705 	mipi_syst_write_catalog64_message((svh),\
1706 	       mipi_syst_make_file_location32((svh), \
1707 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
1708 	       (sev), (id)))
1709 #define MIPI_SYST_CATALOG64_3_LOC16(svh, sev, file, id, p1, p2, p3)\
1710 	(mipi_syst_make_param3(svh, p1, p2, p3),\
1711 	mipi_syst_write_catalog64_message((svh),\
1712 	       mipi_syst_make_file_location32((svh), \
1713 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
1714 	       (sev), (id)))
1715 #define MIPI_SYST_CATALOG64_4_LOC16(svh, sev, file, id, p1, p2, p3, p4)\
1716 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
1717 	mipi_syst_write_catalog64_message((svh),\
1718 	       mipi_syst_make_file_location32((svh), \
1719 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
1720 	       (sev), (id)))
1721 #define MIPI_SYST_CATALOG64_5_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5)\
1722 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
1723 	mipi_syst_write_catalog64_message((svh),\
1724 	       mipi_syst_make_file_location32((svh), \
1725 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
1726 	       (sev), (id)))
1727 #define MIPI_SYST_CATALOG64_6_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\
1728 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
1729 	mipi_syst_write_catalog64_message((svh),\
1730 	       mipi_syst_make_file_location32((svh), \
1731 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
1732 	       (sev), (id)))
1733 
1734 #define MIPI_SYST_CATALOG64_0_LOC32(svh, sev, file, id)\
1735 	(mipi_syst_make_param0(svh),\
1736 	mipi_syst_write_catalog64_message((svh),\
1737 	       mipi_syst_make_file_location64((svh), \
1738 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
1739 	       (sev), (id)))
1740 #define MIPI_SYST_CATALOG64_1_LOC32(svh, sev, file, id, p1)\
1741 	(mipi_syst_make_param1(svh, p1),\
1742 	mipi_syst_write_catalog64_message((svh),\
1743 	       mipi_syst_make_file_location64((svh), \
1744 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
1745 	       (sev), (id)))
1746 #define MIPI_SYST_CATALOG64_2_LOC32(svh, sev, file, id, p1, p2)\
1747 	(mipi_syst_make_param2(svh, p1, p2),\
1748 	mipi_syst_write_catalog64_message((svh),\
1749 	       mipi_syst_make_file_location64((svh), \
1750 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
1751 	       (sev), (id)))
1752 #define MIPI_SYST_CATALOG64_3_LOC32(svh, sev, file, id, p1, p2, p3)\
1753 	(mipi_syst_make_param3(svh, p1, p2, p3),\
1754 	mipi_syst_write_catalog64_message((svh),\
1755 	       mipi_syst_make_file_location64((svh), \
1756 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
1757 	       (sev), (id)))
1758 #define MIPI_SYST_CATALOG64_4_LOC32(svh, sev, file, id, p1, p2, p3, p4)\
1759 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
1760 	mipi_syst_write_catalog64_message((svh),\
1761 	       mipi_syst_make_file_location64((svh), \
1762 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
1763 	       (sev), (id)))
1764 #define MIPI_SYST_CATALOG64_5_LOC32(svh, sev, file, id, p1, p2, p3, p4, p5)\
1765 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
1766 	mipi_syst_write_catalog64_message((svh),\
1767 	       mipi_syst_make_file_location64((svh), \
1768 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
1769 	       (sev), (id)))
1770 #define MIPI_SYST_CATALOG64_6_LOC32(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\
1771 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
1772 	mipi_syst_write_catalog64_message((svh),\
1773 	       mipi_syst_make_file_location64((svh), \
1774 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
1775 	       (sev), (id)))
1776 
1777 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
1778 
1779 #if defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API)
1780 
1781 /**
1782  * Send vararg catalog message
1783  *
1784  * @param svh mipi_syst_handle* SyS-T handle
1785  * @param severity mipi_syst_severity severity level (0..7)
1786  * @param id  mipi_syst_u64 catalog ID
1787  * @param ... optional format arguments.
1788  *
1789  * The optional parameters are passed to the function as a sequence of pairs,
1790  * each containing a type tag with a value from the enumeration
1791  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
1792  *
1793  * Example:
1794  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1795  *
1796  * MIPI_SYST_CATALOG64(svh, MIPI_SYST_SEVERITY_INFO,
1797  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
1798  *             MIPI_SYST_PARAM_STRING("cow"),
1799  *             MIPI_SYST_PARAM_STRING("moon"),
1800  *             MIPI_SYST_PARAM_INT(10));
1801  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1802  */
1803 #define MIPI_SYST_CATALOG64(svh, severity, id, ...) \
1804 		mipi_syst_write_printf_catalog64((svh), MIPI_SYST_NOLOCATION, \
1805 			(severity),\
1806 			(id),\
1807 			##__VA_ARGS__,\
1808 			_MIPI_SYST_CATARG_END)
1809 
1810 /**
1811  * Send catalog message with a prepare argument list.
1812  *
1813  * This sends catalog messages and its vararg list where the vararg
1814  * list is sent without any processing.
1815  *
1816  * @param svh mipi_syst_handle* SyS-T handle
1817  * @param severity mipi_syst_severity severity level (0..7)
1818  * @param id  mipi_syst_u64 catalog ID
1819  * @param args pointer to the prepared argument list
1820  * @param args_sz size of @p args (in bytes)
1821  */
1822 #define MIPI_SYST_CATALOG64_ARGS_COPY(svh, severity, id, args, args_sz) \
1823 		mipi_syst_write_catalog64_args_copy((svh), \
1824 			MIPI_SYST_NOLOCATION, \
1825 			(severity),\
1826 			(id),\
1827 			(args),\
1828 			(args_sz))
1829 
1830  #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
1831 
1832  /**
1833  * Send vararg catalog message
1834  *
1835  * @param svh mipi_syst_handle* SyS-T handle
1836  * @param severity mipi_syst_severity severity level (0..7)
1837  * @param file file ID as 16-bit value
1838  * @param id  mipi_syst_u64 catalog ID
1839  * @param ... optional format arguments.
1840  *
1841  * The optional parameters are passed to the function as a sequence of pairs,
1842  * each containing a type tag with a value from the enumeration
1843  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
1844  *
1845  * Example:
1846  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1847  *
1848  * MIPI_SYST_CATALOG64_LOC16(svh, MIPI_SYST_SEVERITY_INFO, 10,
1849  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
1850  *             MIPI_SYST_PARAM_STRING("cow"),
1851  *             MIPI_SYST_PARAM_STRING("moon"),
1852  *             MIPI_SYST_PARAM_INT(10));
1853  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1854  */
1855 #define MIPI_SYST_CATALOG64_LOC16(svh, severity, file, id, ...) \
1856 		mipi_syst_write_printf_catalog64((svh), \
1857 			mipi_syst_make_file_location32((svh), \
1858 					(mipi_syst_u16)(file), \
1859 					(mipi_syst_u16)MIPI_SYST_LINE),\
1860 			(severity),\
1861 			(id),\
1862 			##__VA_ARGS__,\
1863 			_MIPI_SYST_CATARG_END))
1864  /**
1865  * Send vararg catalog message
1866  *
1867  * @param h mipi_syst_handle* SyS-T handle
1868  * @param severity mipi_syst_severity severity level (0..7)
1869  * @param file file ID as 32-bit value
1870  * @param id  mipi_syst_u64 catalog ID
1871  * @param ... optional format arguments.
1872  *
1873  * The optional parameters are passed to the function as a sequence of pairs,
1874  * each containing a type tag with a value from the enumeration
1875  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
1876  *
1877  *
1878  * Example:
1879  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1880  *
1881  * MIPI_SYST_CATALOG64_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10,
1882  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
1883  *             MIPI_SYST_PARAM_STRING("cow"),
1884  *             MIPI_SYST_PARAM_STRING("moon"),
1885  *             MIPI_SYST_PARAM_INT(10));
1886  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1887  */
1888 #define MIPI_SYST_CATALOG64_LOC32(h, severity, file, id, ...) \
1889 		mipi_syst_write_printf_catalog64((h), \
1890 			mipi_syst_make_file_location64((h), \
1891 					(mipi_syst_u32)(file), \
1892 					(mipi_syst_u32)MIPI_SYST_LINE),\
1893 			(severity),\
1894 			(id),\
1895 			##__VA_ARGS__,\
1896 			_MIPI_SYST_CATARG_END))
1897 
1898 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
1899  /**
1900  * Send vararg catalog message
1901  *
1902  * @param h mipi_syst_handle* SyS-T handle
1903  * @param severity mipi_syst_severity severity level (0..7)
1904  * @param id  mipi_syst_u64 catalog ID
1905  * @param ... optional format arguments.
1906  *
1907  * The optional parameters are passed to the function as a sequence of pairs,
1908  * each containing a type tag with a value from the enumeration
1909  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
1910  *
1911  *
1912  * Example:
1913  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1914  *
1915  * MIPI_SYST_CATALOG64_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO,
1916  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
1917  *             MIPI_SYST_PARAM_STRING("cow"),
1918  *             MIPI_SYST_PARAM_STRING("moon"),
1919  *             MIPI_SYST_PARAM_INT(10));
1920  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1921  */
1922 #define MIPI_SYST_CATALOG64_LOCADDR(h, severity, id, ...) \
1923 		mipi_syst_write_printf_catalog64((h), \
1924 			mipi_syst_make_address_location((h),\
1925 					mipi_syst_return_addr()),\
1926 			(severity), \
1927 			(id),\
1928 			##__VA_ARGS__,\
1929 			_MIPI_SYST_CATARG_END))
1930 
1931 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
1932 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
1933 
1934 
1935 /**
1936  * Vararg style catalog message the contains the
1937  * fmt string in addition to the id. The fmt string is not
1938  * used by this API and removed during compilation. It is only
1939  * present to support source code scanning tools that compute
1940  * the ID to fmt string mapping. The API only sends the ID and
1941  * the arguments to support printf() style output formatting
1942  * by decoding software.
1943  *
1944  * @param svh mipi_syst_handle* SyS-T handle
1945  * @param severity mipi_syst_severity severity level (0..7)
1946  * @param id  mipi_syst_u64 catalog ID
1947  * @param fmt  UTF-8 printf style format string
1948  * @param ... optional format arguments
1949  *
1950  * Example:
1951  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1952  *
1953  * MIPI_SYST_CATPRINTF64(svh, MIPI_SYST_SEVERITY_INFO,
1954  *             0x1122334455667788ull,
1955  *             "The %s jumps over the %s %d times",
1956  *             MIPI_SYST_PARAM_STRING("cow"),
1957  *             MIPI_SYST_PARAM_STRING("moon"),
1958  *             MIPI_SYST_PARAM_INT(10));
1959  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1960  */
1961 #define MIPI_SYST_CATPRINTF64(svh, severity, id, fmt, ...) \
1962 		MIPI_SYST_CATALOG64((svh),\
1963 			(severity),\
1964 			(id),\
1965 			##__VA_ARGS__)
1966 
1967 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
1968 
1969  /**
1970  * Vararg style catalog message the contains the
1971  * fmt string in addition to the id. The fmt string is not
1972  * used by this API and removed during compilation. It is only
1973  * present to support source code scanning tools that compute
1974  * the ID to fmt string mapping. The API only sends the ID and
1975  * the arguments to support printf() style output formatting
1976  * by decoding software.
1977  *
1978  * @param h mipi_syst_handle* SyS-T handle
1979  * @param severity mipi_syst_severity severity level (0..7)
1980  * @param file file ID as 16-bit value
1981  * @param id  mipi_syst_u64 catalog ID
1982  * @param fmt  UTF-8 printf style format string
1983  * @param ... optional format arguments
1984  *
1985  * Example:
1986  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
1987  *
1988  * MIPI_SYST_CATPRINTF64_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10
1989  *             0x1122334455667788ull,
1990  *             "The %s jumps over the %s %d times",
1991  *             MIPI_SYST_PARAM_STRING("cow"),
1992  *             MIPI_SYST_PARAM_STRING("moon"),
1993  *             MIPI_SYST_PARAM_INT(10));
1994  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1995  */
1996 #define MIPI_SYST_CATPRINTF64_LOC16(h, severity, file, id, fmt, ...) \
1997 		MIPI_SYST_CATALOG64_LOC16((h),\
1998 			(severity),\
1999 			(file),\
2000 			(id),\
2001 			##__VA_ARGS__)
2002  /**
2003  * Vararg style catalog message the contains the
2004  * fmt string in addition to the id. The fmt string is not
2005  * used by this API and removed during compilation. It is only
2006  * present to support source code scanning tools that compute
2007  * the ID to fmt string mapping. The API only sends the ID and
2008  * the arguments to support printf() style output formatting
2009  * by decoding software.
2010  *
2011  * @param h mipi_syst_handle* SyS-T handle
2012  * @param severity mipi_syst_severity severity level (0..7)
2013  * @param file file ID as 32-bit value
2014  * @param id  mipi_syst_u64 catalog ID
2015  * @param fmt  UTF-8 printf style format string
2016  * @param ... optional format arguments
2017  *
2018  * Example:
2019  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2020  *
2021  * MIPI_SYST_CATPRINTF64_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10,
2022  *             0x1122334455667788ull,
2023  *             "The %s jumps over the %s %d times",
2024  *             MIPI_SYST_PARAM_STRING("cow"),
2025  *             MIPI_SYST_PARAM_STRING("moon"),
2026  *             MIPI_SYST_PARAM_INT(10));
2027  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2028  */
2029 #define MIPI_SYST_CATPRINTF64_LOC32(h, severity, file, id, fmt, ...) \
2030 		MIPI_SYST_CATALOG64_LOC32((h),\
2031 			(severity),\
2032 			(file),\
2033 			(id),\
2034 			##__VA_ARGS__)
2035 
2036 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
2037 
2038  /**
2039  * Vararg style catalog message the contains the
2040  * fmt string in addition to the id. The fmt string is not
2041  * used by this API and removed during compilation. It is only
2042  * present to support source code scanning tools that compute
2043  * the ID to fmt string mapping. The API only sends the ID and
2044  * the arguments to support printf() style output formatting
2045  * by decoding software.
2046  *
2047  * @param h mipi_syst_handle* SyS-T handle
2048  * @param severity mipi_syst_severity severity level (0..7)
2049  * @param id  mipi_syst_u64 catalog ID
2050  * @param fmt  UTF-8 printf style format string
2051  * @param ... optional format arguments
2052  *
2053  * Example:
2054  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2055  *
2056  * MIPI_SYST_CATPRINTF64_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO,
2057  *             0x1122334455667788ull,
2058  *             "The %s jumps over the %s %d times",
2059  *             MIPI_SYST_PARAM_STRING("cow"),
2060  *             MIPI_SYST_PARAM_STRING("moon"),
2061  *             MIPI_SYST_PARAM_INT(10));
2062  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2063  */
2064 #define MIPI_SYST_CATPRINTF64_LOCADDR(h, severity, id, fmt, ...) \
2065 		MIPI_SYST_CATALOG64_LOCADDR((h),\
2066 			(severity),\
2067 			(id),\
2068 			##__VA_ARGS__)
2069 
2070 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
2071 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
2072 
2073 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
2074 mipi_syst_write_printf_catalog64(struct mipi_syst_handle* svh,
2075 		struct mipi_syst_msglocation* loc,
2076 		enum mipi_syst_severity severity,
2077 		mipi_syst_u64 id,
2078 		...);
2079 
2080 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
2081 mipi_syst_write_catalog64_args_copy(struct mipi_syst_handle* svh,
2082 		struct mipi_syst_msglocation* loc,
2083 		enum mipi_syst_severity severity,
2084 		mipi_syst_u64 id,
2085 		mipi_syst_u8 *args,
2086 		size_t args_sz);
2087 #endif /* #if defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API) */
2088 
2089 /** @} */
2090 
2091 /* API function prototypes */
2092 
2093 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
2094 mipi_syst_write_catalog64_message(struct mipi_syst_handle* svh,
2095 				 struct mipi_syst_msglocation* loc,
2096 				 enum mipi_syst_severity severity,
2097 				 mipi_syst_u64 catid);
2098 
2099 #endif		/* defined(MIPI_SYST_PCFG_ENABLE_CATID64_API) */
2100 
2101 #if defined(MIPI_SYST_PCFG_ENABLE_CATID32_API)
2102 /**
2103  * @defgroup CatAPI32 32-Bit Catalog Message Macros
2104  * @ingroup ApiSets
2105  *
2106  * Catalog message instrumentation API
2107  * @{
2108  */
2109 
2110 #if defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API)
2111 /**
2112  * Send vararg catalog message
2113  *
2114  * @param h mipi_syst_handle* SyS-T handle
2115  * @param severity mipi_syst_severity severity level (0..7)
2116  * @param id  mipi_syst_u32 catalog ID
2117  * @param ... optional format arguments
2118  *
2119  * The optional parameters are passed to the function as a sequence of pairs,
2120  * each containing a type tag with a value from the enumeration
2121  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
2122  *
2123  * Example:
2124  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2125  *
2126  * MIPI_SYST_CATALOG32(systh, MIPI_SYST_SEVERITY_INFO,
2127  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
2128  *             MIPI_SYST_PARAM_CSTR("cow"),
2129  *             MIPI_SYST_PARAM_CSTR("moon"),
2130  *             MIPI_SYST_PARAM_INT(10));
2131  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2132  */
2133 #define MIPI_SYST_CATALOG32(h, severity, id, ...) \
2134 		mipi_syst_write_printf_catalog32((h), MIPI_SYST_NOLOCATION, \
2135 			(severity),\
2136 			(id),\
2137 			##__VA_ARGS__,\
2138 			_MIPI_SYST_CATARG_END)
2139 
2140 /**
2141  * Send catalog message with a prepared argument list.
2142  *
2143  * This sends catalog messages and its vararg list where the vararg
2144  * list is sent without any processing.
2145  *
2146  * @param svh mipi_syst_handle* SyS-T handle
2147  * @param severity mipi_syst_severity severity level (0..7)
2148  * @param id  mipi_syst_u32 catalog ID
2149  * @param args pointer to the prepared argument list
2150  * @param args_sz size of @p args (in bytes)
2151  */
2152 #define MIPI_SYST_CATALOG32_ARGS_COPY(svh, severity, id, args, args_sz) \
2153 		mipi_syst_write_catalog32_args_copy((svh), \
2154 			MIPI_SYST_NOLOCATION, \
2155 			(severity),\
2156 			(id),\
2157 			(args),\
2158 			(args_sz))
2159 
2160 
2161  #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
2162 
2163  /**
2164  * Send vararg catalog message
2165  *
2166  * @param h mipi_syst_handle* SyS-T handle
2167  * @param severity mipi_syst_severity severity level (0..7)
2168  * @param file file ID as 16-bit value
2169  * @param id  mipi_syst_u32 catalog ID
2170  * @param ... optional format arguments
2171  *
2172  * The optional parameters are passed to the function as a sequence of pairs,
2173  * each containing a type tag with a value from the enumeration
2174  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
2175  *
2176  * Example:
2177  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2178  *
2179  * MIPI_SYST_CATALOG32_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10,
2180  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
2181  *             MIPI_SYST_PARAM_CSTR("cow"),
2182  *             MIPI_SYST_PARAM_CSTR("moon"),
2183  *             MIPI_SYST_PARAM_INT(10));
2184  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2185  */
2186 #define MIPI_SYST_CATALOG32_LOC16(h, severity, file, id, ...) \
2187 		mipi_syst_write_printf_catalog32((h), \
2188 			mipi_syst_make_file_location32((h), \
2189 					(mipi_syst_u16)(file), \
2190 					(mipi_syst_u16)MIPI_SYST_LINE),\
2191 			(severity),\
2192 			(id),\
2193 			##__VA_ARGS__,\
2194 			_MIPI_SYST_CATARG_END))
2195 
2196  /**
2197  * Send vararg catalog message
2198  *
2199  * @param h mipi_syst_handle* SyS-T handle
2200  * @param severity mipi_syst_severity severity level (0..7)
2201  * @param file file ID as 32-bit value
2202  * @param id  mipi_syst_u32 catalog ID
2203  * @param ... optional format arguments
2204  *
2205  * The optional parameters are passed to the function as a sequence of pairs,
2206  * each containing a type tag with a value from the enumeration
2207  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
2208  *
2209  * Example:
2210  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2211  *
2212  * MIPI_SYST_CATALOG32_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10,
2213  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
2214  *             MIPI_SYST_PARAM_CSTR("cow"),
2215  *             MIPI_SYST_PARAM_CSTR("moon"),
2216  *             MIPI_SYST_PARAM_INT(10));
2217  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2218  */
2219 #define MIPI_SYST_CATALOG32_LOC32(h, severity, file, id, ...) \
2220 		mipi_syst_write_printf_catalog32((h), \
2221 			mipi_syst_make_file_location64((h), \
2222 					(mipi_syst_u32)(file), \
2223 					(mipi_syst_u32)MIPI_SYST_LINE),\
2224 			(severity),\
2225 			(id),\
2226 			##__VA_ARGS__,\
2227 			_MIPI_SYST_CATARG_END))
2228 
2229 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
2230 
2231  /**
2232  * Send vararg catalog message
2233  *
2234  * @param h mipi_syst_handle* SyS-T handle
2235  * @param severity mipi_syst_severity severity level (0..7)
2236  * @param id  mipi_syst_u32 catalog ID
2237  * @param ... optional format arguments
2238  *
2239  * The optional parameters are passed to the function as a sequence of pairs,
2240  * each containing a type tag with a value from the enumeration
2241  * #mipi_syst_catalog_parameter_types, and then a value of the specified type.
2242  *
2243  * Example:
2244  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2245  *
2246  * MIPI_SYST_CATALOG32_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO,
2247  *             MIPI_SYST_HASH("The %s jumps over the %s %d times",0),
2248  *             MIPI_SYST_PARAM_CSTR("cow"),
2249  *             MIPI_SYST_PARAM_CSTR("moon"),
2250  *             MIPI_SYST_PARAM_INT(10));
2251  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2252  */
2253 #define MIPI_SYST_CATALOG32_LOCADDR(h, severity, id, ...) \
2254 		mipi_syst_write_printf_catalog32((h), \
2255 			mipi_syst_make_address_location((h),\
2256 					mipi_syst_return_addr()),\
2257 			(severity), \
2258 			(id),\
2259 			##__VA_ARGS__,\
2260 			_MIPI_SYST_CATARG_END))
2261 
2262 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
2263 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
2264 
2265 /**
2266  * Send catalog message together with
2267  * the arguments to support printf() style output formatting.
2268  *
2269  * @param h mipi_syst_handle* SyS-T handle
2270  * @param sev mipi_syst_severity severity level (0..7)
2271  * @param id  mipi_syst_u32 catalog ID
2272  * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes
2273  * @param ... optional format arguments
2274  *
2275  * Example:
2276  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2277  *
2278  * MIPI_SYST_CATALOG_PRINTF32(systh, MIPI_SYST_SEVERITY_INFO,
2279  *             0x1122334455667788ull,
2280  *             "The %s jumps over the %s %d times",
2281  *             MIPI_SYST_PARAM_CSTR("cow"),
2282  *             MIPI_SYST_PARAM_CSTR("moon"),
2283  *             MIPI_SYST_PARAM_INT(10));
2284  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2285  */
2286 #define MIPI_SYST_CATPRINTF32(h, sev, id, fmt, ...) \
2287 		MIPI_SYST_CATALOG32((h),\
2288 			(sev),\
2289 			(id),\
2290 			##__VA_ARGS__)
2291 
2292 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
2293 
2294  /**
2295  * Send catalog message together with
2296  * the arguments to support printf() style output formatting.
2297  *
2298  * @param h mipi_syst_handle* SyS-T handle
2299  * @param sev mipi_syst_severity severity level (0..7)
2300  * @param file file ID as 16-bit value
2301  * @param id  mipi_syst_u32 catalog ID
2302  * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes
2303  * @param ... optional format arguments
2304  *
2305  * Example:
2306  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2307  *
2308  * MIPI_SYST_CATALOG_PRINTF32_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10,
2309  *             0x1122334455667788ull,
2310  *             "The %s jumps over the %s %d times",
2311  *             MIPI_SYST_PARAM_CSTR("cow"),
2312  *             MIPI_SYST_PARAM_CSTR("moon"),
2313  *             MIPI_SYST_PARAM_INT(10));
2314  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2315  */
2316 #define MIPI_SYST_CATPRINTF32_LOC16(h, sev, file, id, fmt, ...) \
2317 		MIPI_SYST_CATALOG32_LOC16((h),\
2318 			(sev),\
2319 			(file),\
2320 			(id),\
2321 			##__VA_ARGS__)
2322 
2323  /**
2324  * Send catalog message together with
2325  * the arguments to support printf() style output formatting.
2326  *
2327  * @param h mipi_syst_handle* SyS-T handle
2328  * @param sev mipi_syst_severity severity level (0..7)
2329  * @param file file ID as 32-bit value
2330  * @param id  mipi_syst_u32 catalog ID
2331  * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes
2332  * @param ... optional format arguments
2333  *
2334  * Example:
2335  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2336  *
2337  * MIPI_SYST_CATALOG_PRINTF32_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10,
2338  *             0x1122334455667788ull,
2339  *             "The %s jumps over the %s %d times",
2340  *             MIPI_SYST_PARAM_CSTR("cow"),
2341  *             MIPI_SYST_PARAM_CSTR("moon"),
2342  *             MIPI_SYST_PARAM_INT(10));
2343  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2344  */
2345 #define MIPI_SYST_CATPRINTF32_LOC32(h, sev, file, id, fmt, ...) \
2346 	MIPI_SYST_CATALOG32_LOC32((h),\
2347 			(sev),\
2348 			(id),\
2349 			(file),\
2350 			##__VA_ARGS__)
2351 
2352 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
2353 
2354  /**
2355  * Send catalog message together with
2356  * the arguments to support printf() style output formatting.
2357  *
2358  * @param h mipi_syst_handle* SyS-T handle
2359  * @param sev mipi_syst_severity severity level (0..7)
2360  * @param id  mipi_syst_u32 catalog ID
2361  * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes
2362  * @param ... optional format arguments
2363  *
2364  * Example:
2365  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c}
2366  *
2367  * MIPI_SYST_CATALOG_PRINTF32_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO,
2368  *             0x1122334455667788ull,
2369  *             "The %s jumps over the %s %d times",
2370  *             MIPI_SYST_PARAM_CSTR("cow"),
2371  *             MIPI_SYST_PARAM_CSTR("moon"),
2372  *             MIPI_SYST_PARAM_INT(10));
2373  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2374  */
2375 #define MIPI_SYST_CATPRINTF32_LOCADDR(h, sev, id, fmt, ...) \
2376 		MIPI_SYST_CATALOG32_LOCADDR((h),\
2377 			(sev),\
2378 			(id),\
2379 			##__VA_ARGS__)
2380 
2381 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
2382 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
2383 
2384 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
2385 mipi_syst_write_printf_catalog32(struct mipi_syst_handle* svh,
2386 		struct mipi_syst_msglocation* loc,
2387 		enum mipi_syst_severity severity,
2388 		mipi_syst_u32 id,
2389 		...);
2390 
2391 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
2392 mipi_syst_write_catalog32_args_copy(struct mipi_syst_handle* svh,
2393 		struct mipi_syst_msglocation* loc,
2394 		enum mipi_syst_severity severity,
2395 		mipi_syst_u32 id,
2396 		mipi_syst_u8 *args,
2397 		size_t args_sz);
2398 #endif /* defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API) */
2399 
2400 /** @copydoc MIPI_SYST_CATALOG64_0 */
2401 #define MIPI_SYST_CATALOG32_0(svh, sev, id)\
2402 	(mipi_syst_make_param0(svh),\
2403 	mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
2404 #define MIPI_SYST_CATALOG32_1(svh, sev, id, p1)\
2405 	(mipi_syst_make_param1(svh, p1),\
2406 	mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
2407 #define MIPI_SYST_CATALOG32_2(svh, sev, id, p1, p2)\
2408 	(mipi_syst_make_param2(svh, p1, p2),\
2409 	mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
2410 #define MIPI_SYST_CATALOG32_3(svh, sev, id, p1, p2, p3)\
2411 	(mipi_syst_make_param3(svh, p1, p2, p3),\
2412 	mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
2413 #define MIPI_SYST_CATALOG32_4(svh, sev, id, p1, p2, p3, p4)\
2414 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
2415 	mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
2416 #define MIPI_SYST_CATALOG32_5(svh, sev, id, p1, p2, p3, p4, p5)\
2417 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
2418 	mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
2419 #define MIPI_SYST_CATALOG32_6(svh, sev, id, p1, p2, p3, p4, p5, p6)\
2420 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
2421 	mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id)))
2422 
2423 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD)
2424 
2425 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS)
2426 
2427 #define MIPI_SYST_CATALOG32_0_LOCADDR(svh, sev, id)\
2428 	(mipi_syst_make_param0(svh),\
2429 	mipi_syst_write_catalog32_message((svh),\
2430 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
2431 	       (sev), (id)))
2432 #define MIPI_SYST_CATALOG32_1_LOCADDR(svh, sev, id, p1)\
2433 	(mipi_syst_make_param1(svh, p1),\
2434 	mipi_syst_write_catalog32_message((svh),\
2435 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
2436 	       (sev), (id)))
2437 #define MIPI_SYST_CATALOG32_2_LOCADDR(svh, sev, id, p1, p2)\
2438 	(mipi_syst_make_param2(svh, p1, p2),\
2439 	mipi_syst_write_catalog32_message((svh),\
2440 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
2441 	       (sev), (id)))
2442 #define MIPI_SYST_CATALOG32_3_LOCADDR(svh, sev, id, p1, p2, p3)\
2443 	(mipi_syst_make_param3(svh, p1, p2, p3),\
2444 	mipi_syst_write_catalog32_message((svh),\
2445 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
2446 	       (sev), (id)))
2447 #define MIPI_SYST_CATALOG32_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)\
2448 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
2449 	mipi_syst_write_catalog32_message((svh),\
2450 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
2451 	       (sev), (id)))
2452 #define MIPI_SYST_CATALOG32_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)\
2453 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
2454 	mipi_syst_write_catalog32_message((svh),\
2455 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
2456 	       (sev), (id)))
2457 #define MIPI_SYST_CATALOG32_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)\
2458 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
2459 	mipi_syst_write_catalog32_message((svh),\
2460 	       mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\
2461 	       (sev), (id)))
2462 
2463 #endif		/* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */
2464 
2465 #define MIPI_SYST_CATALOG32_0_LOC16(svh, sev, file, id)\
2466 	(mipi_syst_make_param0(svh),\
2467 	mipi_syst_write_catalog32_message((svh),\
2468 	       mipi_syst_make_file_location32((svh), \
2469 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
2470 	       (sev), (id)))
2471 #define MIPI_SYST_CATALOG32_1_LOC16(svh, sev, file, id, p1)\
2472 	(mipi_syst_make_param1(svh, p1),\
2473 	mipi_syst_write_catalog32_message((svh),\
2474 	       mipi_syst_make_file_location32((svh), \
2475 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
2476 	       (sev), (id)))
2477 #define MIPI_SYST_CATALOG32_2_LOC16(svh, sev, file, id, p1, p2)\
2478 	(mipi_syst_make_param2(svh, p1, p2),\
2479 	mipi_syst_write_catalog32_message((svh),\
2480 	       mipi_syst_make_file_location32((svh), \
2481 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
2482 	       (sev), (id)))
2483 #define MIPI_SYST_CATALOG32_3_LOC16(svh, sev, file, id, p1, p2, p3)\
2484 	(mipi_syst_make_param3(svh, p1, p2, p3),\
2485 	mipi_syst_write_catalog32_message((svh),\
2486 	       mipi_syst_make_file_location32((svh), \
2487 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
2488 	       (sev), (id)))
2489 #define MIPI_SYST_CATALOG32_4_LOC16(svh, sev, file, id, p1, p2, p3, p4)\
2490 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
2491 	mipi_syst_write_catalog32_message((svh),\
2492 	       mipi_syst_make_file_location32((svh), \
2493 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
2494 	       (sev), (id)))
2495 #define MIPI_SYST_CATALOG32_5_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5)\
2496 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
2497 	mipi_syst_write_catalog32_message((svh),\
2498 	       mipi_syst_make_file_location32((svh), \
2499 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
2500 	       (sev), (id)))
2501 #define MIPI_SYST_CATALOG32_6_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\
2502 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
2503 	mipi_syst_write_catalog32_message((svh),\
2504 	       mipi_syst_make_file_location32((svh), \
2505 		   (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\
2506 	       (sev), (id)))
2507 
2508 #define MIPI_SYST_CATALOG32_0_LOC32(svh, sev, file, id)\
2509 	(mipi_syst_make_param0(svh),\
2510 	mipi_syst_write_catalog32_message((svh),\
2511 	       mipi_syst_make_file_location64((svh), \
2512 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
2513 	       (sev), (id)))
2514 #define MIPI_SYST_CATALOG32_1_LOC32(svh, sev, file, id, p1)\
2515 	(mipi_syst_make_param1(svh, p1),\
2516 	mipi_syst_write_catalog32_message((svh),\
2517 	       mipi_syst_make_file_location64((svh), \
2518 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
2519 	       (sev), (id)))
2520 #define MIPI_SYST_CATALOG32_2_LOC32(svh, sev, file, id, p1, p2)\
2521 	(mipi_syst_make_param2(svh, p1, p2),\
2522 	mipi_syst_write_catalog32_message((svh),\
2523 	       mipi_syst_make_file_location64((svh), \
2524 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
2525 	       (sev), (id)))
2526 #define MIPI_SYST_CATALOG32_3_LOC32(svh, sev, file, id, p1, p2, p3)\
2527 	(mipi_syst_make_param3(svh, p1, p2, p3),\
2528 	mipi_syst_write_catalog32_message((svh),\
2529 	       mipi_syst_make_file_location64((svh), \
2530 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
2531 	       (sev), (id)))
2532 #define MIPI_SYST_CATALOG32_4_LOC32(svh, sev, file, id, p1, p2, p3, p4)\
2533 	(mipi_syst_make_param4(svh, p1, p2, p3, p4),\
2534 	mipi_syst_write_catalog32_message((svh),\
2535 	       mipi_syst_make_file_location64((svh), \
2536 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
2537 	       (sev), (id)))
2538 #define MIPI_SYST_CATALOG32_5_LOC32(svh, sev, file, id, p1, p2, p3, p4, p5)\
2539 	(mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\
2540 	mipi_syst_write_catalog32_message((svh),\
2541 	       mipi_syst_make_file_location64((svh), \
2542 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
2543 	       (sev), (id)))
2544 #define MIPI_SYST_CATALOG32_6_LOC32(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\
2545 	(mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\
2546 	mipi_syst_write_catalog32_message((svh),\
2547 	       mipi_syst_make_file_location64((svh), \
2548 		   (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\
2549 	       (sev), (id)))
2550 
2551 #endif				/* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */
2552 /** @} */
2553 
2554 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV
2555 mipi_syst_write_catalog32_message(struct mipi_syst_handle* svh,
2556 				 struct mipi_syst_msglocation* loc,
2557 				 enum mipi_syst_severity severity,
2558 				 mipi_syst_u32 catid);
2559 
2560 #endif				/* defined(MIPI_SYST_PCFG_ENABLE_CATID32_API) */
2561 
2562 
2563 
2564 #endif	/* !MIPI_SYST_DISABLE_ALL */
2565 
2566 /* Define undefined API's to nothing. This ensures source compatibility
2567  * independent of the SyS-T feature configuration.
2568  */
2569 #ifndef MIPI_SYST_INIT
2570 #define MIPI_SYST_INIT(f, p)
2571 #endif
2572 
2573 #ifndef MIPI_SYST_SHUTDOWN
2574 #define MIPI_SYST_SHUTDOWN(x)
2575 #endif
2576 
2577 #ifndef MIPI_SYST_INIT_HANDLE
2578 #define MIPI_SYST_INIT_HANDLE(h, p) (struct mipi_syst_handle*)0
2579 #endif
2580 
2581 #ifndef MIPI_SYST_ENABLE_HANDLE_CHECKSUM
2582 #define MIPI_SYST_ENABLE_HANDLE_CHECKSUM(h, v)
2583 #endif
2584 #ifndef MIPI_SYST_GET_HANDLE_CHECKSUM
2585 #define MIPI_SYST_GET_HANDLE_CHECKSUM(h) 0
2586 #endif
2587 #ifndef MIPI_SYST_ENABLE_HANDLE_COUNTER
2588 #define MIPI_SYST_ENABLE_HANDLE_COUNTER(h, v)
2589 #endif
2590 #ifndef MIPI_SYST_GET_HANDLE_COUNTER
2591 #define MIPI_SYST_GET_HANDLE_COUNTER(h) 0
2592 #endif
2593 #ifndef MIPI_SYST_SET_HANDLE_MODULE_UNIT
2594 #define MIPI_SYST_SET_HANDLE_MODULE_UNIT(p, m, u)
2595 #endif
2596 
2597 #ifndef MIPI_SYST_SET_HANDLE_GUID_UNIT
2598 #define MIPI_SYST_SET_HANDLE_GUID_UNIT(p, g, u)
2599 #endif
2600 
2601 #ifndef MIPI_SYST_ENABLE_HANDLE_TIMESTAMP
2602 #define MIPI_SYST_ENABLE_HANDLE_TIMESTAMP(h, v)
2603 #endif
2604 #ifndef MIPI_SYST_GET_HANDLE_TIMESTAMP
2605 #define MIPI_SYST_GET_HANDLE_TIMESTAMP(h) 0
2606 #endif
2607 
2608 #ifndef MIPI_SYST_INIT
2609 #define MIPI_SYST_INIT(f, p)
2610 #endif
2611 
2612 #ifndef MIPI_SYST_SHUTDOWN
2613 #define MIPI_SYST_SHUTDOWN()
2614 #endif
2615 
2616 #ifndef MIPI_SYST_INIT_HANDLE
2617 #define MIPI_SYST_INIT_HANDLE(h, p)
2618 #endif
2619 
2620 #ifndef MIPI_SYST_ALLOC_HANDLE
2621 #define MIPI_SYST_ALLOC_HANDLE(p) (struct mipi_syst_handle*)0
2622 #endif
2623 
2624 #ifndef MIPI_SYST_ENABLE_HANDLE_CHECKSUM
2625 #define MIPI_SYST_ENABLE_HANDLE_CHECKSUM(h,v)
2626 #endif
2627 
2628 #ifndef MIPI_SYST_ENABLE_HANDLE_COUNTER
2629 #define MIPI_SYST_ENABLE_HANDLE_COUNTER(h,v)
2630 #endif
2631 
2632 #ifndef MIPI_SYST_ENABLE_HANDLE_LENGTH
2633 #define MIPI_SYST_ENABLE_HANDLE_LENGTH(h,v)
2634 #endif
2635 
2636 #ifndef MIPI_SYST_SET_HANDLE_MODULE_UNIT
2637 #define MIPI_SYST_SET_HANDLE_MODULE_UNIT(p, m, u)
2638 #endif
2639 
2640 #ifndef MIPI_SYST_SET_HANDLE_GUID_UNIT
2641 #define MIPI_SYST_SET_HANDLE_GUID_UNIT(p, o, u)
2642 #endif
2643 
2644 #ifndef MIPI_SYST_SHORT32
2645 #define MIPI_SYST_SHORT32(h, v)
2646 #endif
2647 
2648 #ifndef MIPI_SYST_WRITE
2649 #define MIPI_SYST_WRITE(h, sev, id, p, len)
2650 #endif
2651 #ifndef MIPI_SYST_WRITE_LOCADDR
2652 #define MIPI_SYST_WRITE_LOCADDR(h, sev, id,  p, len)
2653 #endif
2654 #ifndef MIPI_SYST_WRITE_LOC16
2655 #define MIPI_SYST_WRITE_LOC16(h, sev, f, id,  p, len)
2656 #endif
2657 #ifndef MIPI_SYST_WRITE_LOC32
2658 #define MIPI_SYST_WRITE_LOC32(h, sev, f, id,  p, len)
2659 #endif
2660 
2661 #ifndef MIPI_SYST_DELETE_HANDLE
2662 #define MIPI_SYST_DELETE_HANDLE(h)
2663 #endif
2664 
2665 #ifndef MIPI_SYST_DEBUG
2666 #define MIPI_SYST_DEBUG(svh, sev, str, len)
2667 #endif
2668 #ifndef MIPI_SYST_DEBUG_LOCADDR
2669 #define MIPI_SYST_DEBUG_LOCADDR(svh, sev, str, len)
2670 #endif
2671 #ifndef MIPI_SYST_DEBUG_LOC16
2672 #define MIPI_SYST_DEBUG_LOC16(svh, sev, file, str, len)
2673 #endif
2674 #ifndef MIPI_SYST_DEBUG_LOC32
2675 #define MIPI_SYST_DEBUG_LOC32(svh, sev, file, str, len)
2676 #endif
2677 #ifndef MIPI_SYST_FUNC_ENTER
2678 #define MIPI_SYST_FUNC_ENTER(svh, sev)
2679 #endif
2680 #ifndef MIPI_SYST_FUNC_ENTER_LOCADDR
2681 #define MIPI_SYST_FUNC_ENTER_LOCADDR(svh, sev)
2682 #endif
2683 #ifndef MIPI_SYST_FUNC_ENTER_LOC16
2684 #define MIPI_SYST_FUNC_ENTER_LOC16(svh, sev, file)
2685 #endif
2686 #ifndef MIPI_SYST_FUNC_ENTER_LOC32
2687 #define MIPI_SYST_FUNC_ENTER_LOC32(svh, sev, file)
2688 #endif
2689 #ifndef MIPI_SYST_FUNC_EXIT
2690 #define MIPI_SYST_FUNC_EXIT(svh, sev)
2691 #endif
2692 #ifndef MIPI_SYST_FUNC_EXIT_LOCADDR
2693 #endif
2694 #ifndef MIPI_SYST_FUNC_EXIT_LOCADDR
2695 #define MIPI_SYST_FUNC_EXIT_LOCADDR(svh, sev)
2696 #endif
2697 #ifndef MIPI_SYST_FUNC_EXIT_LOC16
2698 #define MIPI_SYST_FUNC_EXIT_LOC16(svh, sev, file)
2699 #endif
2700 #ifndef MIPI_SYST_FUNC_EXIT_LOC32
2701 #define MIPI_SYST_FUNC_EXIT_LOC32(svh, sev, file)
2702 #endif
2703 #ifndef MIPI_SYST_ASSERT
2704 #define MIPI_SYST_ASSERT(svh, sev, cond)
2705 #endif
2706 #ifndef MIPI_SYST_ASSERT_LOC16
2707 #define MIPI_SYST_ASSERT_LOC16(svh, sev, file, cond)
2708 #endif
2709 #ifndef MIPI_SYST_ASSERT_LOC32
2710 #define MIPI_SYST_ASSERT_LOC32(svh, sev, file, cond)
2711 #endif
2712 #ifndef MIPI_SYST_ASSERT_LOCADDR
2713 #define MIPI_SYST_ASSERT_LOCADDR(svh, sev, cond)
2714 #endif
2715 
2716 #ifndef MIPI_SYST_CATALOG32_0
2717 #define MIPI_SYST_CATALOG32_0(svh, sev, id)
2718 #endif
2719 #ifndef MIPI_SYST_CATALOG32_1
2720 #define MIPI_SYST_CATALOG32_1(svh, sev, id, p1)
2721 #endif
2722 #ifndef MIPI_SYST_CATALOG32_2
2723 #define MIPI_SYST_CATALOG32_2(svh, sev, id, p1, p2)
2724 #endif
2725 #ifndef MIPI_SYST_CATALOG32_3
2726 #define MIPI_SYST_CATALOG32_3(svh, sev, id, p1, p2, p3)
2727 #endif
2728 #ifndef MIPI_SYST_CATALOG32_4
2729 #define MIPI_SYST_CATALOG32_4(svh, sev, id, p1, p2, p3, p4)
2730 #endif
2731 #ifndef MIPI_SYST_CATALOG32_5
2732 #define MIPI_SYST_CATALOG32_5(svh, sev, id, p1, p2, p3, p4, p5)
2733 #endif
2734 #ifndef MIPI_SYST_CATALOG32_6
2735 #define MIPI_SYST_CATALOG32_6(svh, sev, id, p1, p2, p3, p4, p5, p6)
2736 #endif
2737 
2738 #ifndef MIPI_SYST_CATALOG32_0_LOCADDR
2739 #define MIPI_SYST_CATALOG32_0_LOCADDR(svh, sev, id)
2740 #endif
2741 #ifndef MIPI_SYST_CATALOG32_1_LOCADDR
2742 #define MIPI_SYST_CATALOG32_1_LOCADDR(svh, sev, id, p1)
2743 #endif
2744 #ifndef MIPI_SYST_CATALOG32_2_LOCADDR
2745 #define MIPI_SYST_CATALOG32_2_LOCADDR(svh, sev, id, p1, p2)
2746 #endif
2747 #ifndef MIPI_SYST_CATALOG32_3_LOCADDR
2748 #define MIPI_SYST_CATALOG32_3_LOCADDR(svh, sev, id, p1, p2, p3)
2749 #endif
2750 #ifndef MIPI_SYST_CATALOG32_4_LOCADDR
2751 #define MIPI_SYST_CATALOG32_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)
2752 #endif
2753 #ifndef MIPI_SYST_CATALOG32_5_LOCADDR
2754 #define MIPI_SYST_CATALOG32_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)
2755 #endif
2756 #ifndef MIPI_SYST_CATALOG32_6_LOCADDR
2757 #define MIPI_SYST_CATALOG32_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)
2758 #endif
2759 
2760 #ifndef MIPI_SYST_CATALOG32_0_LOC16
2761 #define MIPI_SYST_CATALOG32_0_LOC16(svh, sev, f, id)
2762 #endif
2763 #ifndef MIPI_SYST_CATALOG32_1_LOC16
2764 #define MIPI_SYST_CATALOG32_1_LOC16(svh, sev, f, id, p1)
2765 #endif
2766 #ifndef MIPI_SYST_CATALOG32_2_LOC16
2767 #define MIPI_SYST_CATALOG32_2_LOC16(svh, sev, f, id, p1, p2)
2768 #endif
2769 #ifndef MIPI_SYST_CATALOG32_3_LOC16
2770 #define MIPI_SYST_CATALOG32_3_LOC16(svh, sev, f, id, p1, p2, p3)
2771 #endif
2772 #ifndef MIPI_SYST_CATALOG32_4_LOC16
2773 #define MIPI_SYST_CATALOG32_4_LOC16(svh, sev, f, id, p1, p2, p3, p4)
2774 #endif
2775 #ifndef MIPI_SYST_CATALOG32_5_LOC16
2776 #define MIPI_SYST_CATALOG32_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5)
2777 #endif
2778 #ifndef MIPI_SYST_CATALOG32_6_LOC16
2779 #define MIPI_SYST_CATALOG32_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
2780 #endif
2781 
2782 #ifndef MIPI_SYST_CATALOG32_0_LOC32
2783 #define MIPI_SYST_CATALOG32_0_LOC32(svh, sev, f, id)
2784 #endif
2785 #ifndef MIPI_SYST_CATALOG32_1_LOC32
2786 #define MIPI_SYST_CATALOG32_1_LOC32(svh, sev, f, id, p1)
2787 #endif
2788 #ifndef MIPI_SYST_CATALOG32_2_LOC32
2789 #define MIPI_SYST_CATALOG32_2_LOC32(svh, sev, f, id, p1, p2)
2790 #endif
2791 #ifndef MIPI_SYST_CATALOG32_3_LOC32
2792 #define MIPI_SYST_CATALOG32_3_LOC32(svh, sev, f, id, p1, p2, p3)
2793 #endif
2794 #ifndef MIPI_SYST_CATALOG32_4_LOC32
2795 #define MIPI_SYST_CATALOG32_4_LOC32(svh, sev, f, id, p1, p2, p3, p4)
2796 #endif
2797 #ifndef MIPI_SYST_CATALOG32_5_LOC32
2798 #define MIPI_SYST_CATALOG32_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5)
2799 #endif
2800 #ifndef MIPI_SYST_CATALOG32_6_LOC32
2801 #define MIPI_SYST_CATALOG32_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
2802 #endif
2803 
2804 #ifndef MIPI_SYST_CATALOG64_0
2805 #define MIPI_SYST_CATALOG64_0(svh, sev, id)
2806 #endif
2807 #ifndef MIPI_SYST_CATALOG64_1
2808 #define MIPI_SYST_CATALOG64_1(svh, sev, id, p1)
2809 #endif
2810 #ifndef MIPI_SYST_CATALOG64_2
2811 #define MIPI_SYST_CATALOG64_2(svh, sev, id, p1, p2)
2812 #endif
2813 #ifndef MIPI_SYST_CATALOG64_3
2814 #define MIPI_SYST_CATALOG64_3(svh, sev, id, p1, p2, p3)
2815 #endif
2816 #ifndef MIPI_SYST_CATALOG64_4
2817 #define MIPI_SYST_CATALOG64_4(svh, sev, id, p1, p2, p3, p4)
2818 #endif
2819 #ifndef MIPI_SYST_CATALOG64_5
2820 #define MIPI_SYST_CATALOG64_5(svh, sev, id, p1, p2, p3, p4, p5)
2821 #endif
2822 #ifndef MIPI_SYST_CATALOG64_6
2823 #define MIPI_SYST_CATALOG64_6(svh, sev, id, p1, p2, p3, p4, p5, p6)
2824 #endif
2825 
2826 #ifndef MIPI_SYST_CATALOG64_0_LOCADDR
2827 #define MIPI_SYST_CATALOG64_0_LOCADDR(svh, sev, id)
2828 #endif
2829 #ifndef MIPI_SYST_CATALOG64_1_LOCADDR
2830 #define MIPI_SYST_CATALOG64_1_LOCADDR(svh, sev, id, p1)
2831 #endif
2832 #ifndef MIPI_SYST_CATALOG64_2_LOCADDR
2833 #define MIPI_SYST_CATALOG64_2_LOCADDR(svh, sev, id, p1, p2)
2834 #endif
2835 #ifndef MIPI_SYST_CATALOG64_3_LOCADDR
2836 #define MIPI_SYST_CATALOG64_3_LOCADDR(svh, sev, id, p1, p2, p3)
2837 #endif
2838 #ifndef MIPI_SYST_CATALOG64_4_LOCADDR
2839 #define MIPI_SYST_CATALOG64_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)
2840 #endif
2841 #ifndef MIPI_SYST_CATALOG64_5_LOCADDR
2842 #define MIPI_SYST_CATALOG64_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)
2843 #endif
2844 #ifndef MIPI_SYST_CATALOG64_6_LOCADDR
2845 #define MIPI_SYST_CATALOG64_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)
2846 #endif
2847 
2848 #ifndef MIPI_SYST_CATALOG64_0_LOC16
2849 #define MIPI_SYST_CATALOG64_0_LOC16(svh, sev, f, id)
2850 #endif
2851 #ifndef MIPI_SYST_CATALOG64_1_LOC16
2852 #define MIPI_SYST_CATALOG64_1_LOC16(svh, sev, f, id, p1)
2853 #endif
2854 #ifndef MIPI_SYST_CATALOG64_2_LOC16
2855 #define MIPI_SYST_CATALOG64_2_LOC16(svh, sev, f, id, p1, p2)
2856 #endif
2857 #ifndef MIPI_SYST_CATALOG64_3_LOC16
2858 #define MIPI_SYST_CATALOG64_3_LOC16(svh, sev, f, id, p1, p2, p3)
2859 #endif
2860 #ifndef MIPI_SYST_CATALOG64_4_LOC16
2861 #define MIPI_SYST_CATALOG64_4_LOC16(svh, sev, f, id, p1, p2, p3, p4)
2862 #endif
2863 #ifndef MIPI_SYST_CATALOG64_5_LOC16
2864 #define MIPI_SYST_CATALOG64_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5)
2865 #endif
2866 #ifndef MIPI_SYST_CATALOG64_6_LOC16
2867 #define MIPI_SYST_CATALOG64_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
2868 #endif
2869 
2870 #ifndef MIPI_SYST_CATALOG64_0_LOC32
2871 #define MIPI_SYST_CATALOG64_0_LOC32(svh, sev, f, id)
2872 #endif
2873 #ifndef MIPI_SYST_CATALOG64_1_LOC32
2874 #define MIPI_SYST_CATALOG64_1_LOC32(svh, sev, f, id, p1)
2875 #endif
2876 #ifndef MIPI_SYST_CATALOG64_2_LOC32
2877 #define MIPI_SYST_CATALOG64_2_LOC32(svh, sev, f, id, p1, p2)
2878 #endif
2879 #ifndef MIPI_SYST_CATALOG64_3_LOC32
2880 #define MIPI_SYST_CATALOG64_3_LOC32(svh, sev, f, id, p1, p2, p3)
2881 #endif
2882 #ifndef MIPI_SYST_CATALOG64_4_LOC32
2883 #define MIPI_SYST_CATALOG64_4_LOC32(svh, sev, f, id, p1, p2, p3, p4)
2884 #endif
2885 #ifndef MIPI_SYST_CATALOG64_5_LOC32
2886 #define MIPI_SYST_CATALOG64_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5)
2887 #endif
2888 #ifndef MIPI_SYST_CATALOG64_6_LOC32
2889 #define MIPI_SYST_CATALOG64_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
2890 #endif
2891 
2892 #ifndef MIPI_SYST_CLOCK_SYNC
2893 #define MIPI_SYST_CLOCK_SYNC(h,c,f)
2894 #endif
2895 
2896 #ifndef MIPI_SYST_PRINTF
2897 #define MIPI_SYST_PRINTF(...)
2898 #endif
2899 #ifndef MIPI_SYST_PRINTF_LOC16
2900 #define MIPI_SYST_PRINTF_LOC16(...)
2901 #endif
2902 #ifndef MIPI_SYST_PRINTF_LOC32
2903 #define MIPI_SYST_PRINTF_LOC32(...)
2904 #endif
2905 #ifndef MIPI_SYST_PRINTF_LOCADDR
2906 #define MIPI_SYST_PRINTF_LOCADDR(...)
2907 #endif
2908 
2909 #ifndef MIPI_SYST_CATPRINTF64
2910 #define MIPI_SYST_CATPRINTF64(...)
2911 #endif
2912 #ifndef MIPI_SYST_CATPRINTF64_LOC16
2913 #define MIPI_SYST_CATPRINTF64_LOC16(...)
2914 #endif
2915 #ifndef MIPI_SYST_CATPRINTF64_LOC32
2916 #define MMIPI_SYST_CATPRINTF64_LOC32(...)
2917 #endif
2918 #ifndef MIPI_SYST_CATPRINTF64_LOCADDR
2919 #define MIPI_SYST_CATPRINTF64_LOCADDR(...)
2920 #endif
2921 #ifndef MIPI_SYST_CATPRINTF32
2922 #define MIPI_SYST_CATPRINTF32(...)
2923 #endif
2924 #ifndef MIPI_SYST_CATPRINTF32_LOC16
2925 #define MIPI_SYST_CATPRINTF32_LOC16(...)
2926 #endif
2927 #ifndef MIPI_SYST_CATPRINTF32_LOC32
2928 #define MMIPI_SYST_CATPRINTF32_LOC32(...)
2929 #endif
2930 #ifndef MIPI_SYST_CATPRINTF32_LOCADDR
2931 #define MIPI_SYST_CATPRINTF32_LOCADDR(...)
2932 #endif
2933 
2934 /* Map CATPRINTF calls to their corresponding catalog APIs
2935  * by dropping the format string parameter.
2936  */
2937  /**
2938  * @defgroup PrintfApi Printf style catalog Message Macros
2939  * @ingroup ApiSets
2940  *
2941  * Printf style catalog message instrumentation API wrappers.
2942  * The  `MIPI_SYST_CATPRINTF{ID-WIDTH}_{PARAMETER-COUNT}`
2943  * macros call their corresponding catalog API macro by dropping
2944  * the format parameter. The API is intended to have
2945  * printf style instrumentation inside the sources, but drop the format
2946  * string during compilation and replace it with a catalog API call
2947  * instead. Source scanning tools are used to extract the format strings
2948  * from sources into catalog dictionary files. The dictionary files can
2949  * then be used to reconstruct the printf formatting during trace decode
2950  * time. This saves both space and execution time in the resulting
2951  * application, and bandwidth over a trace link.
2952  *
2953  *  This API set is enabled or disabled by the
2954  * #MIPI_SYST_PCFG_ENABLE_CATID64_API and/or #MIPI_SYST_PCFG_ENABLE_CATID32_API
2955  * platform feature defines.
2956  * @{
2957  */
2958 #define MIPI_SYST_CATPRINTF32_0(svh, sev, id, fmt)\
2959 	MIPI_SYST_CATALOG32_0(svh, sev, id)
2960 #define MIPI_SYST_CATPRINTF32_1(svh, sev, id, fmt, p1)\
2961 	MIPI_SYST_CATALOG32_1(svh, sev, id, p1)
2962 #define MIPI_SYST_CATPRINTF32_2(svh, sev, id, fmt, p1, p2)\
2963 	MIPI_SYST_CATALOG32_2(svh, sev, id, p1, p2)
2964 #define MIPI_SYST_CATPRINTF32_3(svh, sev, id, fmt, p1, p2, p3)\
2965 	MIPI_SYST_CATALOG32_3(svh, sev, id, p1, p2, p3)
2966 #define MIPI_SYST_CATPRINTF32_4(svh, sev, id, fmt, p1, p2, p3, p4)\
2967 	MIPI_SYST_CATALOG32_4(svh, sev, id, p1, p2, p3, p4)
2968 #define MIPI_SYST_CATPRINTF32_5(svh, sev, id, fmt, p1, p2, p3, p4, p5)\
2969 	MIPI_SYST_CATALOG32_5(svh, sev, id, p1, p2, p3, p4, p5)
2970 #define MIPI_SYST_CATPRINTF32_6(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\
2971 	MIPI_SYST_CATALOG32_6(svh, sev, id, p1, p2, p3, p4, p5, p6)
2972 #define MIPI_SYST_CATPRINTF32_0_LOCADDR(svh, sev, id, fmt)\
2973 	MIPI_SYST_CATALOG32_0_LOCADDR(svh, sev, id)
2974 #define MIPI_SYST_CATPRINTF32_1_LOCADDR(svh, sev, id, fmt, p1)\
2975 	MIPI_SYST_CATALOG32_1_LOCADDR(svh, sev, id, p1)
2976 #define MIPI_SYST_CATPRINTF32_2_LOCADDR(svh, sev, id, fmt, p1, p2)\
2977 	MIPI_SYST_CATALOG32_2_LOCADDR(svh, sev, id, p1, p2)
2978 #define MIPI_SYST_CATPRINTF32_3_LOCADDR(svh, sev, id, fmt, p1, p2, p3)\
2979 	MIPI_SYST_CATALOG32_3_LOCADDR(svh, sev, id, p1, p2, p3)
2980 #define MIPI_SYST_CATPRINTF32_4_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4)\
2981 	MIPI_SYST_CATALOG32_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)
2982 #define MIPI_SYST_CATPRINTF32_5_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5)\
2983 	MIPI_SYST_CATALOG32_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)
2984 #define MIPI_SYST_CATPRINTF32_6_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\
2985 	MIPI_SYST_CATALOG32_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)
2986 #define MIPI_SYST_CATPRINTF32_0_LOC16(svh, sev, f, id, fmt)\
2987 	MIPI_SYST_CATALOG32_0_LOC16(svh, sev, f, id)
2988 #define MIPI_SYST_CATPRINTF32_1_LOC16(svh, sev, f, id, fmt, p1)\
2989 	MIPI_SYST_CATALOG32_1_LOC16(svh, sev, f, id, p1)
2990 #define MIPI_SYST_CATPRINTF32_2_LOC16(svh, sev, f, id, fmt, p1, p2)\
2991 	MIPI_SYST_CATALOG32_2_LOC16(svh, sev, f, id, p1, p2)
2992 #define MIPI_SYST_CATPRINTF32_3_LOC16(svh, sev, f, id, fmt, p1, p2, p3)\
2993 	MIPI_SYST_CATALOG32_3_LOC16(svh, sev, f, id, p1, p2, p3)
2994 #define MIPI_SYST_CATPRINTF32_4_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4)\
2995 	MIPI_SYST_CATALOG32_4_LOC16(svh, sev, f, id, p1, p2, p3, p4)
2996 #define MIPI_SYST_CATPRINTF32_5_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\
2997 	MIPI_SYST_CATALOG32_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5)
2998 #define MIPI_SYST_CATPRINTF32_6_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\
2999 	MIPI_SYST_CATALOG32_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
3000 #define MIPI_SYST_CATPRINTF32_0_LOC32(svh, sev, f, id, fmt)\
3001 	MIPI_SYST_CATALOG32_0_LOC32(svh, sev, f, id)
3002 #define MIPI_SYST_CATPRINTF32_1_LOC32(svh, sev, f, id, fmt, p1)\
3003 	MIPI_SYST_CATALOG32_1_LOC32(svh, sev, f, id, p1)
3004 #define MIPI_SYST_CATPRINTF32_2_LOC32(svh, sev, f, id, fmt, p1, p2)\
3005 	MIPI_SYST_CATALOG32_2_LOC32(svh, sev, f, id, p1, p2)
3006 #define MIPI_SYST_CATPRINTF32_3_LOC32(svh, sev, f, id, fmt, p1, p2, p3)\
3007 	MIPI_SYST_CATALOG32_3_LOC32(svh, sev, f, id, p1, p2, p3)
3008 #define MIPI_SYST_CATPRINTF32_4_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4)\
3009 	MIPI_SYST_CATALOG32_4_LOC32(svh, sev, f, id, p1, p2, p3, p4)
3010 #define MIPI_SYST_CATPRINTF32_5_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\
3011 	MIPI_SYST_CATALOG32_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5)
3012 #define MIPI_SYST_CATPRINTF32_6_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\
3013 	MIPI_SYST_CATALOG32_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
3014 #define MIPI_SYST_CATPRINTF64_0(svh, sev, id, fmt)\
3015 	MIPI_SYST_CATALOG64_0(svh, sev, id)
3016 #define MIPI_SYST_CATPRINTF64_1(svh, sev, id, fmt, p1)\
3017 	MIPI_SYST_CATALOG64_1(svh, sev, id, p1)
3018 #define MIPI_SYST_CATPRINTF64_2(svh, sev, id, fmt, p1, p2)\
3019 	MIPI_SYST_CATALOG64_2(svh, sev, id, p1, p2)
3020 #define MIPI_SYST_CATPRINTF64_3(svh, sev, id, fmt, p1, p2, p3)\
3021 	MIPI_SYST_CATALOG64_3(svh, sev, id, p1, p2, p3)
3022 #define MIPI_SYST_CATPRINTF64_4(svh, sev, id, fmt, p1, p2, p3, p4)\
3023 	MIPI_SYST_CATALOG64_4(svh, sev, id, p1, p2, p3, p4)
3024 #define MIPI_SYST_CATPRINTF64_5(svh, sev, id, fmt, p1, p2, p3, p4, p5)\
3025 	MIPI_SYST_CATALOG64_5(svh, sev, id, p1, p2, p3, p4, p5)
3026 #define MIPI_SYST_CATPRINTF64_6(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\
3027 	MIPI_SYST_CATALOG64_6(svh, sev, id, p1, p2, p3, p4, p5, p6)
3028 #define MIPI_SYST_CATPRINTF64_0_LOCADDR(svh, sev, id, fmt)\
3029 	MIPI_SYST_CATALOG64_0_LOCADDR(svh, sev, id)
3030 #define MIPI_SYST_CATPRINTF64_1_LOCADDR(svh, sev, id, fmt, p1)\
3031 	MIPI_SYST_CATALOG64_1_LOCADDR(svh, sev, id, p1)
3032 #define MIPI_SYST_CATPRINTF64_2_LOCADDR(svh, sev, id, fmt, p1, p2)\
3033 	MIPI_SYST_CATALOG64_2_LOCADDR(svh, sev, id, p1, p2)
3034 #define MIPI_SYST_CATPRINTF64_3_LOCADDR(svh, sev, id, fmt, p1, p2, p3)\
3035 	MIPI_SYST_CATALOG64_3_LOCADDR(svh, sev, id, p1, p2, p3)
3036 #define MIPI_SYST_CATPRINTF64_4_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4)\
3037 	MIPI_SYST_CATALOG64_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)
3038 #define MIPI_SYST_CATPRINTF64_5_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5)\
3039 	MIPI_SYST_CATALOG64_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)
3040 #define MIPI_SYST_CATPRINTF64_6_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\
3041 	MIPI_SYST_CATALOG64_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)
3042 #define MIPI_SYST_CATPRINTF64_0_LOC16(svh, sev, f, id, fmt)\
3043 	MIPI_SYST_CATALOG64_0_LOC16(svh, sev, f, id)
3044 #define MIPI_SYST_CATPRINTF64_1_LOC16(svh, sev, f, id, fmt, p1)\
3045 	MIPI_SYST_CATALOG64_1_LOC16(svh, sev, f, id, p1)
3046 #define MIPI_SYST_CATPRINTF64_2_LOC16(svh, sev, f, id, fmt, p1, p2)\
3047 	MIPI_SYST_CATALOG64_2_LOC16(svh, sev, f, id, p1, p2)
3048 #define MIPI_SYST_CATPRINTF64_3_LOC16(svh, sev, f, id, fmt, p1, p2, p3)\
3049 	MIPI_SYST_CATALOG64_3_LOC16(svh, sev, f, id, p1, p2, p3)
3050 #define MIPI_SYST_CATPRINTF64_4_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4)\
3051 	MIPI_SYST_CATALOG64_4_LOC16(svh, sev, f, id, p1, p2, p3, p4)
3052 #define MIPI_SYST_CATPRINTF64_5_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\
3053 	MIPI_SYST_CATALOG64_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5)
3054 #define MIPI_SYST_CATPRINTF64_6_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\
3055 	MIPI_SYST_CATALOG64_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
3056 #define MIPI_SYST_CATPRINTF64_0_LOC32(svh, sev, f, id, fmt)\
3057 	MIPI_SYST_CATALOG64_0_LOC32(svh, sev, f, id)
3058 #define MIPI_SYST_CATPRINTF64_1_LOC32(svh, sev, f, id, fmt, p1)\
3059 	MIPI_SYST_CATALOG64_1_LOC32(svh, sev, f, id, p1)
3060 #define MIPI_SYST_CATPRINTF64_2_LOC32(svh, sev, f, id, fmt, p1, p2)\
3061 	MIPI_SYST_CATALOG64_2_LOC32(svh, sev, f, id, p1, p2)
3062 #define MIPI_SYST_CATPRINTF64_3_LOC32(svh, sev, f, id, fmt, p1, p2, p3)\
3063 	MIPI_SYST_CATALOG64_3_LOC32(svh, sev, f, id, p1, p2, p3)
3064 #define MIPI_SYST_CATPRINTF64_4_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4)\
3065 	MIPI_SYST_CATALOG64_4_LOC32(svh, sev, f, id, p1, p2, p3, p4)
3066 #define MIPI_SYST_CATPRINTF64_5_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\
3067 	MIPI_SYST_CATALOG64_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5)
3068 #define MIPI_SYST_CATPRINTF64_6_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\
3069 	MIPI_SYST_CATALOG64_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6)
3070 /** @} */
3071 
3072 #ifdef __cplusplus
3073 }	/* extern C */
3074 #endif
3075 #endif
3076