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 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) 1431 1432 /** 1433 * Send UTF-8 character string in C99 printf format together with 1434 * the arguments to support printf() style output formatting. 1435 * 1436 * @param h mipi_syst_handle* SyS-T handle 1437 * @param severity mipi_syst_severity severity level (0..7) 1438 * @param file 16-bit user defined file ID 1439 * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes 1440 * @param ... optional format arguments 1441 * 1442 * Example: 1443 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1444 * 1445 * MIPI_SYST_PRINTF_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10, 1446 * "The %s jumps over the %s %d times", "cow", "moon", 10); 1447 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1448 */ 1449 #define MIPI_SYST_PRINTF_LOC16(h, severity, file, str, ...) \ 1450 mipi_syst_write_printf_string((h), \ 1451 mipi_syst_make_file_location32((h), \ 1452 (mipi_syst_u16)(file), \ 1453 (mipi_syst_u16)MIPI_SYST_LINE),\ 1454 (severity),\ 1455 (str),\ 1456 ##__VA_ARGS__) 1457 1458 /** 1459 * Send UTF-8 character string in C99 printf format together with 1460 * the arguments to support printf() style output formatting. 1461 * 1462 * @param h mipi_syst_handle* SyS-T handle 1463 * @param severity mipi_syst_severity severity level (0..7) 1464 * @param file 32-bit user defined file ID 1465 * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes 1466 * @param ... optional format arguments 1467 * 1468 * Example: 1469 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1470 * 1471 * MIPI_SYST_PRINTF_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10, 1472 * "The %s jumps over the %s %d times", "cow", "moon", 10); 1473 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1474 */ 1475 #define MIPI_SYST_PRINTF_LOC32(h, severity, file, str, ...) \ 1476 mipi_syst_write_printf_string((h), \ 1477 mipi_syst_make_file_location64((h), \ 1478 (mipi_syst_u32)(file), \ 1479 (mipi_syst_u32)MIPI_SYST_LINE),\ 1480 (severity),\ 1481 (str),\ 1482 ##__VA_ARGS__) 1483 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) 1484 1485 /** 1486 * Send UTF-8 character string in C99 printf format together with 1487 * the arguments to support printf() style output formatting. 1488 * 1489 * @param h mipi_syst_handle* SyS-T handle 1490 * @param severity mipi_syst_severity severity level (0..7) 1491 * @param str const mipi_syst_u8 * pointer to UTF-8 string bytes 1492 * @param ... optional format arguments 1493 * 1494 * Example: 1495 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1496 * 1497 * MIPI_SYST_PRINTF_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO, 1498 * "The %s jumps over the %s %d times", "cow", "moon", 10); 1499 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1500 */ 1501 #define MIPI_SYST_PRINTF_LOCADDR(h, severity, str, ...) \ 1502 mipi_syst_write_printf_string((h), \ 1503 mipi_syst_make_address_location((h),\ 1504 mipi_syst_return_addr()),\ 1505 (severity), \ 1506 (str),\ 1507 ##__VA_ARGS__) 1508 1509 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */ 1510 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */ 1511 1512 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV 1513 mipi_syst_write_printf_string(struct mipi_syst_handle* svh, 1514 struct mipi_syst_msglocation* loc, 1515 enum mipi_syst_severity severity, 1516 const char *fmt, 1517 ...); 1518 #endif /* MIPI_SYST_PCFG_ENABLE_PRINTF_API */ 1519 1520 /** @} */ 1521 1522 /** Parameter encoding values for vararg style catalog APIs 1523 */ 1524 enum mipi_syst_catalog_parameter_types { 1525 _MIPI_SYST_CATARG_END = 0, /**< end of parameter list */ 1526 _MIPI_SYST_CATARG_D = 1, /**< int like %d */ 1527 _MIPI_SYST_CATARG_LD = 2, /**< long like %ld */ 1528 _MIPI_SYST_CATARG_LLD = 3, /**< long long like %lld */ 1529 _MIPI_SYST_CATARG_ZD = 4, /**< size_t like %z */ 1530 _MIPI_SYST_CATARG_TD = 5, /**< ptrdiff_t like %t */ 1531 _MIPI_SYST_CATARG_F = 6, /**< double like %f */ 1532 _MIPI_SYST_CATARG_LF = 7, /**< long double like %lf */ 1533 _MIPI_SYST_CATARG_C = 8, /**< char like %c */ 1534 _MIPI_SYST_CATARG_HHD = 9, /**< short like %hhd */ 1535 _MIPI_SYST_CATARG_LC = 10, /**< long char like %lc */ 1536 _MIPI_SYST_CATARG_P = 11, /**< void * like %p or %n */ 1537 _MIPI_SYST_CATARG_CSTR = 12 /**< char * like %s */ 1538 }; 1539 #define _MIPI_SYST_MK_PARAM_LIST(tag, p) _MIPI_SYST_CATARG_##tag, p 1540 1541 #define MIPI_SYST_PARAM_INT(p) _MIPI_SYST_MK_PARAM_LIST(D, (p)) /**< int like %d */ 1542 #define MIPI_SYST_PARAM_LONG(p) _MIPI_SYST_MK_PARAM_LIST(LD, (p)) /**< long like %ld */ 1543 #define MIPI_SYST_PARAM_LONGLONG(p) _MIPI_SYST_MK_PARAM_LIST(LLD, (p)) /**< long long like %lld */ 1544 #define MIPI_SYST_PARAM_SIZE_T(p) _MIPI_SYST_MK_PARAM_LIST(ZD, (p)) /**< size_t like %z */ 1545 #define MIPI_SYST_PARAM_PTRDIFF_T(p) _MIPI_SYST_MK_PARAM_LIST(TD, (p)) /**< ptrdiff_t like %t */ 1546 #define MIPI_SYST_PARAM_FLOAT(p) _MIPI_SYST_MK_PARAM_LIST(F, (p)) /**< float like %f */ 1547 #define MIPI_SYST_PARAM_DOUBLE(p) _MIPI_SYST_MK_PARAM_LIST(F, (p)) /**< double like %f */ 1548 #define MIPI_SYST_PARAM_LONGDOUBLE(p) _MIPI_SYST_MK_PARAM_LIST(LF, (p)) /**< long double like %lf */ 1549 #define MIPI_SYST_PARAM_CHAR(p) _MIPI_SYST_MK_PARAM_LIST(C, (p)) /**< char like %c */ 1550 #define MIPI_SYST_PARAM_SHORT(p) _MIPI_SYST_MK_PARAM_LIST(HHD, (p)) /**< short like %hhd */ 1551 #define MIPI_SYST_PARAM_WCHAR(p) _MIPI_SYST_MK_PARAM_LIST(LC, (p)) /**< long char like %lc */ 1552 #define MIPI_SYST_PARAM_PTR(p) _MIPI_SYST_MK_PARAM_LIST(P, (p)) /**< void * like %p or %n */ 1553 #define MIPI_SYST_PARAM_CSTR(p) _MIPI_SYST_MK_PARAM_LIST(CSTR, (p)) /**< char * like %s */ 1554 1555 /** 1556 * @defgroup CatAPI64 64-Bit Catalog Message Macros 1557 * @ingroup ApiSets 1558 * 1559 * Catalog message instrumentation API 1560 * 1561 * Note: This API set is enabled or disabled by the 1562 * #MIPI_SYST_PCFG_ENABLE_CATID64_API and/or #MIPI_SYST_PCFG_ENABLE_CATID32_API 1563 * platform feature defines. 1564 * @{ 1565 */ 1566 1567 #if defined(MIPI_SYST_PCFG_ENABLE_CATID64_API) 1568 1569 /** 1570 * Send catalog message with 0-6 parameters.<BR> 1571 * This family of Macros is used to send 32 or 64-bit wide catalog 1572 * message IDs with up to six 32-bit wide parameters into the trace stream. 1573 * The macro names are encoded in the following way: 1574 * MIPI_SYST_CATALOG{ID-WIDTH}_{PARAMETER-COUNT} 1575 * 1576 * Example: A 32-bit ID using catalog function with 3 parameters whould be 1577 * called MIPI_SYST_CATALOG32_3. 1578 * 1579 * @param svh mipi_syst_handle* SyS-T handle 1580 * @param sev mipi_syst_severity severity level (0..7) 1581 * @param id catalog ID 1582 * 1583 * Up to 6 32-Bit numeric parameter follow the catalog ID. 1584 * 1585 * Example: 1586 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1587 * 1588 * // emit plain catalog id (no parameter) 1589 * // 1590 * MIPI_SYST_CATALOG32_0(svh, MIPI_SYST_SEVERITY_ERROR, MSGID_INIT_FAIL); 1591 * 1592 * // catalog id with one parameter 1593 * // 1594 * MIPI_SYST_CATALOG32_1(svh, MIPI_SYST_SEVERITY_INFO, MSGID_SETLEVEL, 0x3); 1595 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1596 */ 1597 #define MIPI_SYST_CATALOG64_0(svh, sev, id)\ 1598 (mipi_syst_make_param0(svh),\ 1599 mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 1600 #define MIPI_SYST_CATALOG64_1(svh, sev, id, p1)\ 1601 (mipi_syst_make_param1(svh, p1),\ 1602 mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 1603 #define MIPI_SYST_CATALOG64_2(svh, sev, id, p1, p2)\ 1604 (mipi_syst_make_param2(svh, p1, p2),\ 1605 mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 1606 #define MIPI_SYST_CATALOG64_3(svh, sev, id, p1, p2, p3)\ 1607 (mipi_syst_make_param3(svh, p1, p2, p3),\ 1608 mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 1609 #define MIPI_SYST_CATALOG64_4(svh, sev, id, p1, p2, p3, p4)\ 1610 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 1611 mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 1612 #define MIPI_SYST_CATALOG64_5(svh, sev, id, p1, p2, p3, p4, p5)\ 1613 (mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\ 1614 mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 1615 #define MIPI_SYST_CATALOG64_6(svh, sev, id, p1, p2, p3, p4, p5, p6)\ 1616 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 1617 mipi_syst_write_catalog64_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 1618 1619 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) 1620 1621 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) 1622 1623 #define MIPI_SYST_CATALOG64_0_LOCADDR(svh, sev, id)\ 1624 (mipi_syst_make_param0(svh),\ 1625 mipi_syst_write_catalog64_message((svh),\ 1626 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 1627 (sev), (id))) 1628 #define MIPI_SYST_CATALOG64_1_LOCADDR(svh, sev, id, p1)\ 1629 (mipi_syst_make_param1(svh, p1),\ 1630 mipi_syst_write_catalog64_message((svh),\ 1631 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 1632 (sev), (id))) 1633 #define MIPI_SYST_CATALOG64_2_LOCADDR(svh, sev, id, p1, p2)\ 1634 (mipi_syst_make_param2(svh, p1, p2),\ 1635 mipi_syst_write_catalog64_message((svh),\ 1636 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 1637 (sev), (id))) 1638 #define MIPI_SYST_CATALOG64_3_LOCADDR(svh, sev, id, p1, p2, p3)\ 1639 (mipi_syst_make_param3(svh, p1, p2, p3),\ 1640 mipi_syst_write_catalog64_message((svh),\ 1641 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 1642 (sev), (id))) 1643 #define MIPI_SYST_CATALOG64_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)\ 1644 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 1645 mipi_syst_write_catalog64_message((svh),\ 1646 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 1647 (sev), (id))) 1648 #define MIPI_SYST_CATALOG64_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)\ 1649 (mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\ 1650 mipi_syst_write_catalog64_message((svh),\ 1651 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 1652 (sev), (id))) 1653 #define MIPI_SYST_CATALOG64_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)\ 1654 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 1655 mipi_syst_write_catalog64_message((svh),\ 1656 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 1657 (sev), (id))) 1658 1659 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */ 1660 1661 #define MIPI_SYST_CATALOG64_0_LOC16(svh, sev, file, id)\ 1662 (mipi_syst_make_param0(svh),\ 1663 mipi_syst_write_catalog64_message((svh),\ 1664 mipi_syst_make_file_location32((svh), \ 1665 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 1666 (sev), (id))) 1667 #define MIPI_SYST_CATALOG64_1_LOC16(svh, sev, file, id, p1)\ 1668 (mipi_syst_make_param1(svh, p1),\ 1669 mipi_syst_write_catalog64_message((svh),\ 1670 mipi_syst_make_file_location32((svh), \ 1671 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 1672 (sev), (id))) 1673 #define MIPI_SYST_CATALOG64_2_LOC16(svh, sev, file, id, p1, p2)\ 1674 (mipi_syst_make_param2(svh, p1, p2),\ 1675 mipi_syst_write_catalog64_message((svh),\ 1676 mipi_syst_make_file_location32((svh), \ 1677 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 1678 (sev), (id))) 1679 #define MIPI_SYST_CATALOG64_3_LOC16(svh, sev, file, id, p1, p2, p3)\ 1680 (mipi_syst_make_param3(svh, p1, p2, p3),\ 1681 mipi_syst_write_catalog64_message((svh),\ 1682 mipi_syst_make_file_location32((svh), \ 1683 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 1684 (sev), (id))) 1685 #define MIPI_SYST_CATALOG64_4_LOC16(svh, sev, file, id, p1, p2, p3, p4)\ 1686 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 1687 mipi_syst_write_catalog64_message((svh),\ 1688 mipi_syst_make_file_location32((svh), \ 1689 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 1690 (sev), (id))) 1691 #define MIPI_SYST_CATALOG64_5_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5)\ 1692 (mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\ 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_6_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\ 1698 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 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 1704 #define MIPI_SYST_CATALOG64_0_LOC32(svh, sev, file, id)\ 1705 (mipi_syst_make_param0(svh),\ 1706 mipi_syst_write_catalog64_message((svh),\ 1707 mipi_syst_make_file_location64((svh), \ 1708 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 1709 (sev), (id))) 1710 #define MIPI_SYST_CATALOG64_1_LOC32(svh, sev, file, id, p1)\ 1711 (mipi_syst_make_param1(svh, p1),\ 1712 mipi_syst_write_catalog64_message((svh),\ 1713 mipi_syst_make_file_location64((svh), \ 1714 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 1715 (sev), (id))) 1716 #define MIPI_SYST_CATALOG64_2_LOC32(svh, sev, file, id, p1, p2)\ 1717 (mipi_syst_make_param2(svh, p1, p2),\ 1718 mipi_syst_write_catalog64_message((svh),\ 1719 mipi_syst_make_file_location64((svh), \ 1720 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 1721 (sev), (id))) 1722 #define MIPI_SYST_CATALOG64_3_LOC32(svh, sev, file, id, p1, p2, p3)\ 1723 (mipi_syst_make_param3(svh, p1, p2, p3),\ 1724 mipi_syst_write_catalog64_message((svh),\ 1725 mipi_syst_make_file_location64((svh), \ 1726 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 1727 (sev), (id))) 1728 #define MIPI_SYST_CATALOG64_4_LOC32(svh, sev, file, id, p1, p2, p3, p4)\ 1729 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 1730 mipi_syst_write_catalog64_message((svh),\ 1731 mipi_syst_make_file_location64((svh), \ 1732 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 1733 (sev), (id))) 1734 #define MIPI_SYST_CATALOG64_5_LOC32(svh, sev, file, id, p1, p2, p3, p4, p5)\ 1735 (mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\ 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_6_LOC32(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\ 1741 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 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 1747 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */ 1748 1749 #if defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API) 1750 1751 /** 1752 * Send vararg catalog message 1753 * 1754 * @param svh mipi_syst_handle* SyS-T handle 1755 * @param severity mipi_syst_severity severity level (0..7) 1756 * @param id mipi_syst_u64 catalog ID 1757 * @param ... optional format arguments. 1758 * 1759 * The optional parameters are passed to the function as a sequence of pairs, 1760 * each containing a type tag with a value from the enumeration 1761 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 1762 * 1763 * Example: 1764 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1765 * 1766 * MIPI_SYST_CATALOG64(svh, MIPI_SYST_SEVERITY_INFO, 1767 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 1768 * MIPI_SYST_PARAM_STRING("cow"), 1769 * MIPI_SYST_PARAM_STRING("moon"), 1770 * MIPI_SYST_PARAM_INT(10)); 1771 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1772 */ 1773 #define MIPI_SYST_CATALOG64(svh, severity, id, ...) \ 1774 mipi_syst_write_printf_catalog64((svh), MIPI_SYST_NOLOCATION, \ 1775 (severity),\ 1776 (id),\ 1777 ##__VA_ARGS__,\ 1778 _MIPI_SYST_CATARG_END) 1779 1780 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) 1781 1782 /** 1783 * Send vararg catalog message 1784 * 1785 * @param svh mipi_syst_handle* SyS-T handle 1786 * @param severity mipi_syst_severity severity level (0..7) 1787 * @param file file ID as 16-bit value 1788 * @param id mipi_syst_u64 catalog ID 1789 * @param ... optional format arguments. 1790 * 1791 * The optional parameters are passed to the function as a sequence of pairs, 1792 * each containing a type tag with a value from the enumeration 1793 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 1794 * 1795 * Example: 1796 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1797 * 1798 * MIPI_SYST_CATALOG64_LOC16(svh, MIPI_SYST_SEVERITY_INFO, 10, 1799 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 1800 * MIPI_SYST_PARAM_STRING("cow"), 1801 * MIPI_SYST_PARAM_STRING("moon"), 1802 * MIPI_SYST_PARAM_INT(10)); 1803 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1804 */ 1805 #define MIPI_SYST_CATALOG64_LOC16(svh, severity, file, id, ...) \ 1806 mipi_syst_write_printf_catalog64((svh), \ 1807 mipi_syst_make_file_location32((svh), \ 1808 (mipi_syst_u16)(file), \ 1809 (mipi_syst_u16)MIPI_SYST_LINE),\ 1810 (severity),\ 1811 (id),\ 1812 ##__VA_ARGS__,\ 1813 _MIPI_SYST_CATARG_END)) 1814 /** 1815 * Send vararg catalog message 1816 * 1817 * @param h mipi_syst_handle* SyS-T handle 1818 * @param severity mipi_syst_severity severity level (0..7) 1819 * @param file file ID as 32-bit value 1820 * @param id mipi_syst_u64 catalog ID 1821 * @param ... optional format arguments. 1822 * 1823 * The optional parameters are passed to the function as a sequence of pairs, 1824 * each containing a type tag with a value from the enumeration 1825 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 1826 * 1827 * 1828 * Example: 1829 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1830 * 1831 * MIPI_SYST_CATALOG64_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10, 1832 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 1833 * MIPI_SYST_PARAM_STRING("cow"), 1834 * MIPI_SYST_PARAM_STRING("moon"), 1835 * MIPI_SYST_PARAM_INT(10)); 1836 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1837 */ 1838 #define MIPI_SYST_CATALOG64_LOC32(h, severity, file, id, ...) \ 1839 mipi_syst_write_printf_catalog64((h), \ 1840 mipi_syst_make_file_location64((h), \ 1841 (mipi_syst_u32)(file), \ 1842 (mipi_syst_u32)MIPI_SYST_LINE),\ 1843 (severity),\ 1844 (id),\ 1845 ##__VA_ARGS__,\ 1846 _MIPI_SYST_CATARG_END)) 1847 1848 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) 1849 /** 1850 * Send vararg catalog message 1851 * 1852 * @param h mipi_syst_handle* SyS-T handle 1853 * @param severity mipi_syst_severity severity level (0..7) 1854 * @param id mipi_syst_u64 catalog ID 1855 * @param ... optional format arguments. 1856 * 1857 * The optional parameters are passed to the function as a sequence of pairs, 1858 * each containing a type tag with a value from the enumeration 1859 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 1860 * 1861 * 1862 * Example: 1863 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1864 * 1865 * MIPI_SYST_CATALOG64_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO, 1866 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 1867 * MIPI_SYST_PARAM_STRING("cow"), 1868 * MIPI_SYST_PARAM_STRING("moon"), 1869 * MIPI_SYST_PARAM_INT(10)); 1870 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1871 */ 1872 #define MIPI_SYST_CATALOG64_LOCADDR(h, severity, id, ...) \ 1873 mipi_syst_write_printf_catalog64((h), \ 1874 mipi_syst_make_address_location((h),\ 1875 mipi_syst_return_addr()),\ 1876 (severity), \ 1877 (id),\ 1878 ##__VA_ARGS__,\ 1879 _MIPI_SYST_CATARG_END)) 1880 1881 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */ 1882 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */ 1883 1884 1885 /** 1886 * Vararg style catalog message the contains the 1887 * fmt string in addition to the id. The fmt string is not 1888 * used by this API and removed during compilation. It is only 1889 * present to support source code scanning tools that compute 1890 * the ID to fmt string mapping. The API only sends the ID and 1891 * the arguments to support printf() style output formatting 1892 * by decoding software. 1893 * 1894 * @param svh mipi_syst_handle* SyS-T handle 1895 * @param severity mipi_syst_severity severity level (0..7) 1896 * @param id mipi_syst_u64 catalog ID 1897 * @param fmt UTF-8 printf style format string 1898 * @param ... optional format arguments 1899 * 1900 * Example: 1901 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1902 * 1903 * MIPI_SYST_CATPRINTF64(svh, MIPI_SYST_SEVERITY_INFO, 1904 * 0x1122334455667788ull, 1905 * "The %s jumps over the %s %d times", 1906 * MIPI_SYST_PARAM_STRING("cow"), 1907 * MIPI_SYST_PARAM_STRING("moon"), 1908 * MIPI_SYST_PARAM_INT(10)); 1909 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1910 */ 1911 #define MIPI_SYST_CATPRINTF64(svh, severity, id, fmt, ...) \ 1912 MIPI_SYST_CATALOG64((svh),\ 1913 (severity),\ 1914 (id),\ 1915 ##__VA_ARGS__) 1916 1917 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) 1918 1919 /** 1920 * Vararg style catalog message the contains the 1921 * fmt string in addition to the id. The fmt string is not 1922 * used by this API and removed during compilation. It is only 1923 * present to support source code scanning tools that compute 1924 * the ID to fmt string mapping. The API only sends the ID and 1925 * the arguments to support printf() style output formatting 1926 * by decoding software. 1927 * 1928 * @param h mipi_syst_handle* SyS-T handle 1929 * @param severity mipi_syst_severity severity level (0..7) 1930 * @param file file ID as 16-bit value 1931 * @param id mipi_syst_u64 catalog ID 1932 * @param fmt UTF-8 printf style format string 1933 * @param ... optional format arguments 1934 * 1935 * Example: 1936 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1937 * 1938 * MIPI_SYST_CATPRINTF64_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10 1939 * 0x1122334455667788ull, 1940 * "The %s jumps over the %s %d times", 1941 * MIPI_SYST_PARAM_STRING("cow"), 1942 * MIPI_SYST_PARAM_STRING("moon"), 1943 * MIPI_SYST_PARAM_INT(10)); 1944 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1945 */ 1946 #define MIPI_SYST_CATPRINTF64_LOC16(h, severity, file, id, fmt, ...) \ 1947 MIPI_SYST_CATALOG64_LOC16((h),\ 1948 (severity),\ 1949 (file),\ 1950 (id),\ 1951 ##__VA_ARGS__) 1952 /** 1953 * Vararg style catalog message the contains the 1954 * fmt string in addition to the id. The fmt string is not 1955 * used by this API and removed during compilation. It is only 1956 * present to support source code scanning tools that compute 1957 * the ID to fmt string mapping. The API only sends the ID and 1958 * the arguments to support printf() style output formatting 1959 * by decoding software. 1960 * 1961 * @param h mipi_syst_handle* SyS-T handle 1962 * @param severity mipi_syst_severity severity level (0..7) 1963 * @param file file ID as 32-bit value 1964 * @param id mipi_syst_u64 catalog ID 1965 * @param fmt UTF-8 printf style format string 1966 * @param ... optional format arguments 1967 * 1968 * Example: 1969 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 1970 * 1971 * MIPI_SYST_CATPRINTF64_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10, 1972 * 0x1122334455667788ull, 1973 * "The %s jumps over the %s %d times", 1974 * MIPI_SYST_PARAM_STRING("cow"), 1975 * MIPI_SYST_PARAM_STRING("moon"), 1976 * MIPI_SYST_PARAM_INT(10)); 1977 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1978 */ 1979 #define MIPI_SYST_CATPRINTF64_LOC32(h, severity, file, id, fmt, ...) \ 1980 MIPI_SYST_CATALOG64_LOC32((h),\ 1981 (severity),\ 1982 (file),\ 1983 (id),\ 1984 ##__VA_ARGS__) 1985 1986 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) 1987 1988 /** 1989 * Vararg style catalog message the contains the 1990 * fmt string in addition to the id. The fmt string is not 1991 * used by this API and removed during compilation. It is only 1992 * present to support source code scanning tools that compute 1993 * the ID to fmt string mapping. The API only sends the ID and 1994 * the arguments to support printf() style output formatting 1995 * by decoding software. 1996 * 1997 * @param h mipi_syst_handle* SyS-T handle 1998 * @param severity mipi_syst_severity severity level (0..7) 1999 * @param id mipi_syst_u64 catalog ID 2000 * @param fmt UTF-8 printf style format string 2001 * @param ... optional format arguments 2002 * 2003 * Example: 2004 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2005 * 2006 * MIPI_SYST_CATPRINTF64_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO, 2007 * 0x1122334455667788ull, 2008 * "The %s jumps over the %s %d times", 2009 * MIPI_SYST_PARAM_STRING("cow"), 2010 * MIPI_SYST_PARAM_STRING("moon"), 2011 * MIPI_SYST_PARAM_INT(10)); 2012 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2013 */ 2014 #define MIPI_SYST_CATPRINTF64_LOCADDR(h, severity, id, fmt, ...) \ 2015 MIPI_SYST_CATALOG64_LOCADDR((h),\ 2016 (severity),\ 2017 (id),\ 2018 ##__VA_ARGS__) 2019 2020 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */ 2021 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */ 2022 2023 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV 2024 mipi_syst_write_printf_catalog64(struct mipi_syst_handle* svh, 2025 struct mipi_syst_msglocation* loc, 2026 enum mipi_syst_severity severity, 2027 mipi_syst_u64 id, 2028 ...); 2029 #endif /* #if defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API) */ 2030 2031 /** @} */ 2032 2033 /* API function prototypes */ 2034 2035 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV 2036 mipi_syst_write_catalog64_message(struct mipi_syst_handle* svh, 2037 struct mipi_syst_msglocation* loc, 2038 enum mipi_syst_severity severity, 2039 mipi_syst_u64 catid); 2040 2041 #endif /* defined(MIPI_SYST_PCFG_ENABLE_CATID64_API) */ 2042 2043 #if defined(MIPI_SYST_PCFG_ENABLE_CATID32_API) 2044 /** 2045 * @defgroup CatAPI32 32-Bit Catalog Message Macros 2046 * @ingroup ApiSets 2047 * 2048 * Catalog message instrumentation API 2049 * @{ 2050 */ 2051 2052 #if defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API) 2053 /** 2054 * Send vararg catalog message 2055 * 2056 * @param h mipi_syst_handle* SyS-T handle 2057 * @param severity mipi_syst_severity severity level (0..7) 2058 * @param id mipi_syst_u32 catalog ID 2059 * @param ... optional format arguments 2060 * 2061 * The optional parameters are passed to the function as a sequence of pairs, 2062 * each containing a type tag with a value from the enumeration 2063 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 2064 * 2065 * Example: 2066 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2067 * 2068 * MIPI_SYST_CATALOG32(systh, MIPI_SYST_SEVERITY_INFO, 2069 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 2070 * MIPI_SYST_PARAM_CSTR("cow"), 2071 * MIPI_SYST_PARAM_CSTR("moon"), 2072 * MIPI_SYST_PARAM_INT(10)); 2073 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2074 */ 2075 #define MIPI_SYST_CATALOG32(h, severity, id, ...) \ 2076 mipi_syst_write_printf_catalog32((h), MIPI_SYST_NOLOCATION, \ 2077 (severity),\ 2078 (id),\ 2079 ##__VA_ARGS__,\ 2080 _MIPI_SYST_CATARG_END) 2081 2082 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) 2083 2084 /** 2085 * Send vararg catalog message 2086 * 2087 * @param h mipi_syst_handle* SyS-T handle 2088 * @param severity mipi_syst_severity severity level (0..7) 2089 * @param file file ID as 16-bit value 2090 * @param id mipi_syst_u32 catalog ID 2091 * @param ... optional format arguments 2092 * 2093 * The optional parameters are passed to the function as a sequence of pairs, 2094 * each containing a type tag with a value from the enumeration 2095 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 2096 * 2097 * Example: 2098 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2099 * 2100 * MIPI_SYST_CATALOG32_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10, 2101 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 2102 * MIPI_SYST_PARAM_CSTR("cow"), 2103 * MIPI_SYST_PARAM_CSTR("moon"), 2104 * MIPI_SYST_PARAM_INT(10)); 2105 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2106 */ 2107 #define MIPI_SYST_CATALOG32_LOC16(h, severity, file, id, ...) \ 2108 mipi_syst_write_printf_catalog32((h), \ 2109 mipi_syst_make_file_location32((h), \ 2110 (mipi_syst_u16)(file), \ 2111 (mipi_syst_u16)MIPI_SYST_LINE),\ 2112 (severity),\ 2113 (id),\ 2114 ##__VA_ARGS__,\ 2115 _MIPI_SYST_CATARG_END)) 2116 2117 /** 2118 * Send vararg catalog message 2119 * 2120 * @param h mipi_syst_handle* SyS-T handle 2121 * @param severity mipi_syst_severity severity level (0..7) 2122 * @param file file ID as 32-bit value 2123 * @param id mipi_syst_u32 catalog ID 2124 * @param ... optional format arguments 2125 * 2126 * The optional parameters are passed to the function as a sequence of pairs, 2127 * each containing a type tag with a value from the enumeration 2128 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 2129 * 2130 * Example: 2131 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2132 * 2133 * MIPI_SYST_CATALOG32_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10, 2134 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 2135 * MIPI_SYST_PARAM_CSTR("cow"), 2136 * MIPI_SYST_PARAM_CSTR("moon"), 2137 * MIPI_SYST_PARAM_INT(10)); 2138 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2139 */ 2140 #define MIPI_SYST_CATALOG32_LOC32(h, severity, file, id, ...) \ 2141 mipi_syst_write_printf_catalog32((h), \ 2142 mipi_syst_make_file_location64((h), \ 2143 (mipi_syst_u32)(file), \ 2144 (mipi_syst_u32)MIPI_SYST_LINE),\ 2145 (severity),\ 2146 (id),\ 2147 ##__VA_ARGS__,\ 2148 _MIPI_SYST_CATARG_END)) 2149 2150 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) 2151 2152 /** 2153 * Send vararg catalog message 2154 * 2155 * @param h mipi_syst_handle* SyS-T handle 2156 * @param severity mipi_syst_severity severity level (0..7) 2157 * @param id mipi_syst_u32 catalog ID 2158 * @param ... optional format arguments 2159 * 2160 * The optional parameters are passed to the function as a sequence of pairs, 2161 * each containing a type tag with a value from the enumeration 2162 * #mipi_syst_catalog_parameter_types, and then a value of the specified type. 2163 * 2164 * Example: 2165 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2166 * 2167 * MIPI_SYST_CATALOG32_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO, 2168 * MIPI_SYST_HASH("The %s jumps over the %s %d times",0), 2169 * MIPI_SYST_PARAM_CSTR("cow"), 2170 * MIPI_SYST_PARAM_CSTR("moon"), 2171 * MIPI_SYST_PARAM_INT(10)); 2172 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2173 */ 2174 #define MIPI_SYST_CATALOG32_LOCADDR(h, severity, id, ...) \ 2175 mipi_syst_write_printf_catalog32((h), \ 2176 mipi_syst_make_address_location((h),\ 2177 mipi_syst_return_addr()),\ 2178 (severity), \ 2179 (id),\ 2180 ##__VA_ARGS__,\ 2181 _MIPI_SYST_CATARG_END)) 2182 2183 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */ 2184 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */ 2185 2186 /** 2187 * Send catalog message together with 2188 * the arguments to support printf() style output formatting. 2189 * 2190 * @param h mipi_syst_handle* SyS-T handle 2191 * @param sev mipi_syst_severity severity level (0..7) 2192 * @param id mipi_syst_u32 catalog ID 2193 * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes 2194 * @param ... optional format arguments 2195 * 2196 * Example: 2197 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2198 * 2199 * MIPI_SYST_CATALOG_PRINTF32(systh, MIPI_SYST_SEVERITY_INFO, 2200 * 0x1122334455667788ull, 2201 * "The %s jumps over the %s %d times", 2202 * MIPI_SYST_PARAM_CSTR("cow"), 2203 * MIPI_SYST_PARAM_CSTR("moon"), 2204 * MIPI_SYST_PARAM_INT(10)); 2205 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2206 */ 2207 #define MIPI_SYST_CATPRINTF32(h, sev, id, fmt, ...) \ 2208 MIPI_SYST_CATALOG32((h),\ 2209 (sev),\ 2210 (id),\ 2211 ##__VA_ARGS__) 2212 2213 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) 2214 2215 /** 2216 * Send catalog message together with 2217 * the arguments to support printf() style output formatting. 2218 * 2219 * @param h mipi_syst_handle* SyS-T handle 2220 * @param sev mipi_syst_severity severity level (0..7) 2221 * @param file file ID as 16-bit value 2222 * @param id mipi_syst_u32 catalog ID 2223 * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes 2224 * @param ... optional format arguments 2225 * 2226 * Example: 2227 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2228 * 2229 * MIPI_SYST_CATALOG_PRINTF32_LOC16(systh, MIPI_SYST_SEVERITY_INFO, 10, 2230 * 0x1122334455667788ull, 2231 * "The %s jumps over the %s %d times", 2232 * MIPI_SYST_PARAM_CSTR("cow"), 2233 * MIPI_SYST_PARAM_CSTR("moon"), 2234 * MIPI_SYST_PARAM_INT(10)); 2235 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2236 */ 2237 #define MIPI_SYST_CATPRINTF32_LOC16(h, sev, file, id, fmt, ...) \ 2238 MIPI_SYST_CATALOG32_LOC16((h),\ 2239 (sev),\ 2240 (file),\ 2241 (id),\ 2242 ##__VA_ARGS__) 2243 2244 /** 2245 * Send catalog message together with 2246 * the arguments to support printf() style output formatting. 2247 * 2248 * @param h mipi_syst_handle* SyS-T handle 2249 * @param sev mipi_syst_severity severity level (0..7) 2250 * @param file file ID as 32-bit value 2251 * @param id mipi_syst_u32 catalog ID 2252 * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes 2253 * @param ... optional format arguments 2254 * 2255 * Example: 2256 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2257 * 2258 * MIPI_SYST_CATALOG_PRINTF32_LOC32(systh, MIPI_SYST_SEVERITY_INFO, 10, 2259 * 0x1122334455667788ull, 2260 * "The %s jumps over the %s %d times", 2261 * MIPI_SYST_PARAM_CSTR("cow"), 2262 * MIPI_SYST_PARAM_CSTR("moon"), 2263 * MIPI_SYST_PARAM_INT(10)); 2264 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2265 */ 2266 #define MIPI_SYST_CATPRINTF32_LOC32(h, sev, file, id, fmt, ...) \ 2267 MIPI_SYST_CATALOG32_LOC32((h),\ 2268 (sev),\ 2269 (id),\ 2270 (file),\ 2271 ##__VA_ARGS__) 2272 2273 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) 2274 2275 /** 2276 * Send catalog message together with 2277 * the arguments to support printf() style output formatting. 2278 * 2279 * @param h mipi_syst_handle* SyS-T handle 2280 * @param sev mipi_syst_severity severity level (0..7) 2281 * @param id mipi_syst_u32 catalog ID 2282 * @param fmt const mipi_syst_u8 * pointer to UTF-8 string bytes 2283 * @param ... optional format arguments 2284 * 2285 * Example: 2286 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.c} 2287 * 2288 * MIPI_SYST_CATALOG_PRINTF32_LOCADDR(systh, MIPI_SYST_SEVERITY_INFO, 2289 * 0x1122334455667788ull, 2290 * "The %s jumps over the %s %d times", 2291 * MIPI_SYST_PARAM_CSTR("cow"), 2292 * MIPI_SYST_PARAM_CSTR("moon"), 2293 * MIPI_SYST_PARAM_INT(10)); 2294 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2295 */ 2296 #define MIPI_SYST_CATPRINTF32_LOCADDR(h, sev, id, fmt, ...) \ 2297 MIPI_SYST_CATALOG32_LOCADDR((h),\ 2298 (sev),\ 2299 (id),\ 2300 ##__VA_ARGS__) 2301 2302 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */ 2303 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */ 2304 2305 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV 2306 mipi_syst_write_printf_catalog32(struct mipi_syst_handle* svh, 2307 struct mipi_syst_msglocation* loc, 2308 enum mipi_syst_severity severity, 2309 mipi_syst_u32 id, 2310 ...); 2311 2312 #endif /* defined(MIPI_SYST_PCFG_ENABLE_PRINTF_API) */ 2313 2314 /** @copydoc MIPI_SYST_CATALOG64_0 */ 2315 #define MIPI_SYST_CATALOG32_0(svh, sev, id)\ 2316 (mipi_syst_make_param0(svh),\ 2317 mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 2318 #define MIPI_SYST_CATALOG32_1(svh, sev, id, p1)\ 2319 (mipi_syst_make_param1(svh, p1),\ 2320 mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 2321 #define MIPI_SYST_CATALOG32_2(svh, sev, id, p1, p2)\ 2322 (mipi_syst_make_param2(svh, p1, p2),\ 2323 mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 2324 #define MIPI_SYST_CATALOG32_3(svh, sev, id, p1, p2, p3)\ 2325 (mipi_syst_make_param3(svh, p1, p2, p3),\ 2326 mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 2327 #define MIPI_SYST_CATALOG32_4(svh, sev, id, p1, p2, p3, p4)\ 2328 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 2329 mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 2330 #define MIPI_SYST_CATALOG32_5(svh, sev, id, p1, p2, p3, p4, p5)\ 2331 (mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\ 2332 mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 2333 #define MIPI_SYST_CATALOG32_6(svh, sev, id, p1, p2, p3, p4, p5, p6)\ 2334 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 2335 mipi_syst_write_catalog32_message((svh), MIPI_SYST_NOLOCATION, (sev), (id))) 2336 2337 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) 2338 2339 #if defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) 2340 2341 #define MIPI_SYST_CATALOG32_0_LOCADDR(svh, sev, id)\ 2342 (mipi_syst_make_param0(svh),\ 2343 mipi_syst_write_catalog32_message((svh),\ 2344 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 2345 (sev), (id))) 2346 #define MIPI_SYST_CATALOG32_1_LOCADDR(svh, sev, id, p1)\ 2347 (mipi_syst_make_param1(svh, p1),\ 2348 mipi_syst_write_catalog32_message((svh),\ 2349 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 2350 (sev), (id))) 2351 #define MIPI_SYST_CATALOG32_2_LOCADDR(svh, sev, id, p1, p2)\ 2352 (mipi_syst_make_param2(svh, p1, p2),\ 2353 mipi_syst_write_catalog32_message((svh),\ 2354 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 2355 (sev), (id))) 2356 #define MIPI_SYST_CATALOG32_3_LOCADDR(svh, sev, id, p1, p2, p3)\ 2357 (mipi_syst_make_param3(svh, p1, p2, p3),\ 2358 mipi_syst_write_catalog32_message((svh),\ 2359 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 2360 (sev), (id))) 2361 #define MIPI_SYST_CATALOG32_4_LOCADDR(svh, sev, id, p1, p2, p3, p4)\ 2362 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 2363 mipi_syst_write_catalog32_message((svh),\ 2364 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 2365 (sev), (id))) 2366 #define MIPI_SYST_CATALOG32_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5)\ 2367 (mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\ 2368 mipi_syst_write_catalog32_message((svh),\ 2369 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 2370 (sev), (id))) 2371 #define MIPI_SYST_CATALOG32_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6)\ 2372 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 2373 mipi_syst_write_catalog32_message((svh),\ 2374 mipi_syst_make_address_location((svh), mipi_syst_return_addr()),\ 2375 (sev), (id))) 2376 2377 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_ADDRESS) */ 2378 2379 #define MIPI_SYST_CATALOG32_0_LOC16(svh, sev, file, id)\ 2380 (mipi_syst_make_param0(svh),\ 2381 mipi_syst_write_catalog32_message((svh),\ 2382 mipi_syst_make_file_location32((svh), \ 2383 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 2384 (sev), (id))) 2385 #define MIPI_SYST_CATALOG32_1_LOC16(svh, sev, file, id, p1)\ 2386 (mipi_syst_make_param1(svh, p1),\ 2387 mipi_syst_write_catalog32_message((svh),\ 2388 mipi_syst_make_file_location32((svh), \ 2389 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 2390 (sev), (id))) 2391 #define MIPI_SYST_CATALOG32_2_LOC16(svh, sev, file, id, p1, p2)\ 2392 (mipi_syst_make_param2(svh, p1, p2),\ 2393 mipi_syst_write_catalog32_message((svh),\ 2394 mipi_syst_make_file_location32((svh), \ 2395 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 2396 (sev), (id))) 2397 #define MIPI_SYST_CATALOG32_3_LOC16(svh, sev, file, id, p1, p2, p3)\ 2398 (mipi_syst_make_param3(svh, p1, p2, p3),\ 2399 mipi_syst_write_catalog32_message((svh),\ 2400 mipi_syst_make_file_location32((svh), \ 2401 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 2402 (sev), (id))) 2403 #define MIPI_SYST_CATALOG32_4_LOC16(svh, sev, file, id, p1, p2, p3, p4)\ 2404 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 2405 mipi_syst_write_catalog32_message((svh),\ 2406 mipi_syst_make_file_location32((svh), \ 2407 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 2408 (sev), (id))) 2409 #define MIPI_SYST_CATALOG32_5_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5)\ 2410 (mipi_syst_make_param5(svh, p1, p2, p3, p4, p5),\ 2411 mipi_syst_write_catalog32_message((svh),\ 2412 mipi_syst_make_file_location32((svh), \ 2413 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 2414 (sev), (id))) 2415 #define MIPI_SYST_CATALOG32_6_LOC16(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\ 2416 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 2417 mipi_syst_write_catalog32_message((svh),\ 2418 mipi_syst_make_file_location32((svh), \ 2419 (mipi_syst_u16)(file), (mipi_syst_u16)MIPI_SYST_LINE),\ 2420 (sev), (id))) 2421 2422 #define MIPI_SYST_CATALOG32_0_LOC32(svh, sev, file, id)\ 2423 (mipi_syst_make_param0(svh),\ 2424 mipi_syst_write_catalog32_message((svh),\ 2425 mipi_syst_make_file_location64((svh), \ 2426 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 2427 (sev), (id))) 2428 #define MIPI_SYST_CATALOG32_1_LOC32(svh, sev, file, id, p1)\ 2429 (mipi_syst_make_param1(svh, p1),\ 2430 mipi_syst_write_catalog32_message((svh),\ 2431 mipi_syst_make_file_location64((svh), \ 2432 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 2433 (sev), (id))) 2434 #define MIPI_SYST_CATALOG32_2_LOC32(svh, sev, file, id, p1, p2)\ 2435 (mipi_syst_make_param2(svh, p1, p2),\ 2436 mipi_syst_write_catalog32_message((svh),\ 2437 mipi_syst_make_file_location64((svh), \ 2438 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 2439 (sev), (id))) 2440 #define MIPI_SYST_CATALOG32_3_LOC32(svh, sev, file, id, p1, p2, p3)\ 2441 (mipi_syst_make_param3(svh, p1, p2, p3),\ 2442 mipi_syst_write_catalog32_message((svh),\ 2443 mipi_syst_make_file_location64((svh), \ 2444 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 2445 (sev), (id))) 2446 #define MIPI_SYST_CATALOG32_4_LOC32(svh, sev, file, id, p1, p2, p3, p4)\ 2447 (mipi_syst_make_param4(svh, p1, p2, p3, p4),\ 2448 mipi_syst_write_catalog32_message((svh),\ 2449 mipi_syst_make_file_location64((svh), \ 2450 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 2451 (sev), (id))) 2452 #define MIPI_SYST_CATALOG32_5_LOC32(svh, sev, file, 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_file_location64((svh), \ 2456 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 2457 (sev), (id))) 2458 #define MIPI_SYST_CATALOG32_6_LOC32(svh, sev, file, id, p1, p2, p3, p4, p5, p6)\ 2459 (mipi_syst_make_param6(svh, p1, p2, p3, p4, p5, p6),\ 2460 mipi_syst_write_catalog32_message((svh),\ 2461 mipi_syst_make_file_location64((svh), \ 2462 (mipi_syst_u32)(file), (mipi_syst_u32)MIPI_SYST_LINE),\ 2463 (sev), (id))) 2464 2465 #endif /* defined(MIPI_SYST_PCFG_ENABLE_LOCATION_RECORD) */ 2466 /** @} */ 2467 2468 MIPI_SYST_EXPORT void MIPI_SYST_CALLCONV 2469 mipi_syst_write_catalog32_message(struct mipi_syst_handle* svh, 2470 struct mipi_syst_msglocation* loc, 2471 enum mipi_syst_severity severity, 2472 mipi_syst_u32 catid); 2473 2474 #endif /* defined(MIPI_SYST_PCFG_ENABLE_CATID32_API) */ 2475 2476 2477 2478 #endif /* !MIPI_SYST_DISABLE_ALL */ 2479 2480 /* Define undefined API's to nothing. This ensures source compatibility 2481 * independent of the SyS-T feature configuration. 2482 */ 2483 #ifndef MIPI_SYST_INIT 2484 #define MIPI_SYST_INIT(f, p) 2485 #endif 2486 2487 #ifndef MIPI_SYST_SHUTDOWN 2488 #define MIPI_SYST_SHUTDOWN(x) 2489 #endif 2490 2491 #ifndef MIPI_SYST_INIT_HANDLE 2492 #define MIPI_SYST_INIT_HANDLE(h, p) (struct mipi_syst_handle*)0 2493 #endif 2494 2495 #ifndef MIPI_SYST_ENABLE_HANDLE_CHECKSUM 2496 #define MIPI_SYST_ENABLE_HANDLE_CHECKSUM(h, v) 2497 #endif 2498 #ifndef MIPI_SYST_GET_HANDLE_CHECKSUM 2499 #define MIPI_SYST_GET_HANDLE_CHECKSUM(h) 0 2500 #endif 2501 #ifndef MIPI_SYST_ENABLE_HANDLE_COUNTER 2502 #define MIPI_SYST_ENABLE_HANDLE_COUNTER(h, v) 2503 #endif 2504 #ifndef MIPI_SYST_GET_HANDLE_COUNTER 2505 #define MIPI_SYST_GET_HANDLE_COUNTER(h) 0 2506 #endif 2507 #ifndef MIPI_SYST_SET_HANDLE_MODULE_UNIT 2508 #define MIPI_SYST_SET_HANDLE_MODULE_UNIT(p, m, u) 2509 #endif 2510 2511 #ifndef MIPI_SYST_SET_HANDLE_GUID_UNIT 2512 #define MIPI_SYST_SET_HANDLE_GUID_UNIT(p, g, u) 2513 #endif 2514 2515 #ifndef MIPI_SYST_ENABLE_HANDLE_TIMESTAMP 2516 #define MIPI_SYST_ENABLE_HANDLE_TIMESTAMP(h, v) 2517 #endif 2518 #ifndef MIPI_SYST_GET_HANDLE_TIMESTAMP 2519 #define MIPI_SYST_GET_HANDLE_TIMESTAMP(h) 0 2520 #endif 2521 2522 #ifndef MIPI_SYST_INIT 2523 #define MIPI_SYST_INIT(f, p) 2524 #endif 2525 2526 #ifndef MIPI_SYST_SHUTDOWN 2527 #define MIPI_SYST_SHUTDOWN() 2528 #endif 2529 2530 #ifndef MIPI_SYST_INIT_HANDLE 2531 #define MIPI_SYST_INIT_HANDLE(h, p) 2532 #endif 2533 2534 #ifndef MIPI_SYST_ALLOC_HANDLE 2535 #define MIPI_SYST_ALLOC_HANDLE(p) (struct mipi_syst_handle*)0 2536 #endif 2537 2538 #ifndef MIPI_SYST_ENABLE_HANDLE_CHECKSUM 2539 #define MIPI_SYST_ENABLE_HANDLE_CHECKSUM(h,v) 2540 #endif 2541 2542 #ifndef MIPI_SYST_ENABLE_HANDLE_COUNTER 2543 #define MIPI_SYST_ENABLE_HANDLE_COUNTER(h,v) 2544 #endif 2545 2546 #ifndef MIPI_SYST_ENABLE_HANDLE_LENGTH 2547 #define MIPI_SYST_ENABLE_HANDLE_LENGTH(h,v) 2548 #endif 2549 2550 #ifndef MIPI_SYST_SET_HANDLE_MODULE_UNIT 2551 #define MIPI_SYST_SET_HANDLE_MODULE_UNIT(p, m, u) 2552 #endif 2553 2554 #ifndef MIPI_SYST_SET_HANDLE_GUID_UNIT 2555 #define MIPI_SYST_SET_HANDLE_GUID_UNIT(p, o, u) 2556 #endif 2557 2558 #ifndef MIPI_SYST_SHORT32 2559 #define MIPI_SYST_SHORT32(h, v) 2560 #endif 2561 2562 #ifndef MIPI_SYST_WRITE 2563 #define MIPI_SYST_WRITE(h, sev, id, p, len) 2564 #endif 2565 #ifndef MIPI_SYST_WRITE_LOCADDR 2566 #define MIPI_SYST_WRITE_LOCADDR(h, sev, id, p, len) 2567 #endif 2568 #ifndef MIPI_SYST_WRITE_LOC16 2569 #define MIPI_SYST_WRITE_LOC16(h, sev, f, id, p, len) 2570 #endif 2571 #ifndef MIPI_SYST_WRITE_LOC32 2572 #define MIPI_SYST_WRITE_LOC32(h, sev, f, id, p, len) 2573 #endif 2574 2575 #ifndef MIPI_SYST_DELETE_HANDLE 2576 #define MIPI_SYST_DELETE_HANDLE(h) 2577 #endif 2578 2579 #ifndef MIPI_SYST_DEBUG 2580 #define MIPI_SYST_DEBUG(svh, sev, str, len) 2581 #endif 2582 #ifndef MIPI_SYST_DEBUG_LOCADDR 2583 #define MIPI_SYST_DEBUG_LOCADDR(svh, sev, str, len) 2584 #endif 2585 #ifndef MIPI_SYST_DEBUG_LOC16 2586 #define MIPI_SYST_DEBUG_LOC16(svh, sev, file, str, len) 2587 #endif 2588 #ifndef MIPI_SYST_DEBUG_LOC32 2589 #define MIPI_SYST_DEBUG_LOC32(svh, sev, file, str, len) 2590 #endif 2591 #ifndef MIPI_SYST_FUNC_ENTER 2592 #define MIPI_SYST_FUNC_ENTER(svh, sev) 2593 #endif 2594 #ifndef MIPI_SYST_FUNC_ENTER_LOCADDR 2595 #define MIPI_SYST_FUNC_ENTER_LOCADDR(svh, sev) 2596 #endif 2597 #ifndef MIPI_SYST_FUNC_ENTER_LOC16 2598 #define MIPI_SYST_FUNC_ENTER_LOC16(svh, sev, file) 2599 #endif 2600 #ifndef MIPI_SYST_FUNC_ENTER_LOC32 2601 #define MIPI_SYST_FUNC_ENTER_LOC32(svh, sev, file) 2602 #endif 2603 #ifndef MIPI_SYST_FUNC_EXIT 2604 #define MIPI_SYST_FUNC_EXIT(svh, sev) 2605 #endif 2606 #ifndef MIPI_SYST_FUNC_EXIT_LOCADDR 2607 #endif 2608 #ifndef MIPI_SYST_FUNC_EXIT_LOCADDR 2609 #define MIPI_SYST_FUNC_EXIT_LOCADDR(svh, sev) 2610 #endif 2611 #ifndef MIPI_SYST_FUNC_EXIT_LOC16 2612 #define MIPI_SYST_FUNC_EXIT_LOC16(svh, sev, file) 2613 #endif 2614 #ifndef MIPI_SYST_FUNC_EXIT_LOC32 2615 #define MIPI_SYST_FUNC_EXIT_LOC32(svh, sev, file) 2616 #endif 2617 #ifndef MIPI_SYST_ASSERT 2618 #define MIPI_SYST_ASSERT(svh, sev, cond) 2619 #endif 2620 #ifndef MIPI_SYST_ASSERT_LOC16 2621 #define MIPI_SYST_ASSERT_LOC16(svh, sev, file, cond) 2622 #endif 2623 #ifndef MIPI_SYST_ASSERT_LOC32 2624 #define MIPI_SYST_ASSERT_LOC32(svh, sev, file, cond) 2625 #endif 2626 #ifndef MIPI_SYST_ASSERT_LOCADDR 2627 #define MIPI_SYST_ASSERT_LOCADDR(svh, sev, cond) 2628 #endif 2629 2630 #ifndef MIPI_SYST_CATALOG32_0 2631 #define MIPI_SYST_CATALOG32_0(svh, sev, id) 2632 #endif 2633 #ifndef MIPI_SYST_CATALOG32_1 2634 #define MIPI_SYST_CATALOG32_1(svh, sev, id, p1) 2635 #endif 2636 #ifndef MIPI_SYST_CATALOG32_2 2637 #define MIPI_SYST_CATALOG32_2(svh, sev, id, p1, p2) 2638 #endif 2639 #ifndef MIPI_SYST_CATALOG32_3 2640 #define MIPI_SYST_CATALOG32_3(svh, sev, id, p1, p2, p3) 2641 #endif 2642 #ifndef MIPI_SYST_CATALOG32_4 2643 #define MIPI_SYST_CATALOG32_4(svh, sev, id, p1, p2, p3, p4) 2644 #endif 2645 #ifndef MIPI_SYST_CATALOG32_5 2646 #define MIPI_SYST_CATALOG32_5(svh, sev, id, p1, p2, p3, p4, p5) 2647 #endif 2648 #ifndef MIPI_SYST_CATALOG32_6 2649 #define MIPI_SYST_CATALOG32_6(svh, sev, id, p1, p2, p3, p4, p5, p6) 2650 #endif 2651 2652 #ifndef MIPI_SYST_CATALOG32_0_LOCADDR 2653 #define MIPI_SYST_CATALOG32_0_LOCADDR(svh, sev, id) 2654 #endif 2655 #ifndef MIPI_SYST_CATALOG32_1_LOCADDR 2656 #define MIPI_SYST_CATALOG32_1_LOCADDR(svh, sev, id, p1) 2657 #endif 2658 #ifndef MIPI_SYST_CATALOG32_2_LOCADDR 2659 #define MIPI_SYST_CATALOG32_2_LOCADDR(svh, sev, id, p1, p2) 2660 #endif 2661 #ifndef MIPI_SYST_CATALOG32_3_LOCADDR 2662 #define MIPI_SYST_CATALOG32_3_LOCADDR(svh, sev, id, p1, p2, p3) 2663 #endif 2664 #ifndef MIPI_SYST_CATALOG32_4_LOCADDR 2665 #define MIPI_SYST_CATALOG32_4_LOCADDR(svh, sev, id, p1, p2, p3, p4) 2666 #endif 2667 #ifndef MIPI_SYST_CATALOG32_5_LOCADDR 2668 #define MIPI_SYST_CATALOG32_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5) 2669 #endif 2670 #ifndef MIPI_SYST_CATALOG32_6_LOCADDR 2671 #define MIPI_SYST_CATALOG32_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6) 2672 #endif 2673 2674 #ifndef MIPI_SYST_CATALOG32_0_LOC16 2675 #define MIPI_SYST_CATALOG32_0_LOC16(svh, sev, f, id) 2676 #endif 2677 #ifndef MIPI_SYST_CATALOG32_1_LOC16 2678 #define MIPI_SYST_CATALOG32_1_LOC16(svh, sev, f, id, p1) 2679 #endif 2680 #ifndef MIPI_SYST_CATALOG32_2_LOC16 2681 #define MIPI_SYST_CATALOG32_2_LOC16(svh, sev, f, id, p1, p2) 2682 #endif 2683 #ifndef MIPI_SYST_CATALOG32_3_LOC16 2684 #define MIPI_SYST_CATALOG32_3_LOC16(svh, sev, f, id, p1, p2, p3) 2685 #endif 2686 #ifndef MIPI_SYST_CATALOG32_4_LOC16 2687 #define MIPI_SYST_CATALOG32_4_LOC16(svh, sev, f, id, p1, p2, p3, p4) 2688 #endif 2689 #ifndef MIPI_SYST_CATALOG32_5_LOC16 2690 #define MIPI_SYST_CATALOG32_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5) 2691 #endif 2692 #ifndef MIPI_SYST_CATALOG32_6_LOC16 2693 #define MIPI_SYST_CATALOG32_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2694 #endif 2695 2696 #ifndef MIPI_SYST_CATALOG32_0_LOC32 2697 #define MIPI_SYST_CATALOG32_0_LOC32(svh, sev, f, id) 2698 #endif 2699 #ifndef MIPI_SYST_CATALOG32_1_LOC32 2700 #define MIPI_SYST_CATALOG32_1_LOC32(svh, sev, f, id, p1) 2701 #endif 2702 #ifndef MIPI_SYST_CATALOG32_2_LOC32 2703 #define MIPI_SYST_CATALOG32_2_LOC32(svh, sev, f, id, p1, p2) 2704 #endif 2705 #ifndef MIPI_SYST_CATALOG32_3_LOC32 2706 #define MIPI_SYST_CATALOG32_3_LOC32(svh, sev, f, id, p1, p2, p3) 2707 #endif 2708 #ifndef MIPI_SYST_CATALOG32_4_LOC32 2709 #define MIPI_SYST_CATALOG32_4_LOC32(svh, sev, f, id, p1, p2, p3, p4) 2710 #endif 2711 #ifndef MIPI_SYST_CATALOG32_5_LOC32 2712 #define MIPI_SYST_CATALOG32_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5) 2713 #endif 2714 #ifndef MIPI_SYST_CATALOG32_6_LOC32 2715 #define MIPI_SYST_CATALOG32_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2716 #endif 2717 2718 #ifndef MIPI_SYST_CATALOG64_0 2719 #define MIPI_SYST_CATALOG64_0(svh, sev, id) 2720 #endif 2721 #ifndef MIPI_SYST_CATALOG64_1 2722 #define MIPI_SYST_CATALOG64_1(svh, sev, id, p1) 2723 #endif 2724 #ifndef MIPI_SYST_CATALOG64_2 2725 #define MIPI_SYST_CATALOG64_2(svh, sev, id, p1, p2) 2726 #endif 2727 #ifndef MIPI_SYST_CATALOG64_3 2728 #define MIPI_SYST_CATALOG64_3(svh, sev, id, p1, p2, p3) 2729 #endif 2730 #ifndef MIPI_SYST_CATALOG64_4 2731 #define MIPI_SYST_CATALOG64_4(svh, sev, id, p1, p2, p3, p4) 2732 #endif 2733 #ifndef MIPI_SYST_CATALOG64_5 2734 #define MIPI_SYST_CATALOG64_5(svh, sev, id, p1, p2, p3, p4, p5) 2735 #endif 2736 #ifndef MIPI_SYST_CATALOG64_6 2737 #define MIPI_SYST_CATALOG64_6(svh, sev, id, p1, p2, p3, p4, p5, p6) 2738 #endif 2739 2740 #ifndef MIPI_SYST_CATALOG64_0_LOCADDR 2741 #define MIPI_SYST_CATALOG64_0_LOCADDR(svh, sev, id) 2742 #endif 2743 #ifndef MIPI_SYST_CATALOG64_1_LOCADDR 2744 #define MIPI_SYST_CATALOG64_1_LOCADDR(svh, sev, id, p1) 2745 #endif 2746 #ifndef MIPI_SYST_CATALOG64_2_LOCADDR 2747 #define MIPI_SYST_CATALOG64_2_LOCADDR(svh, sev, id, p1, p2) 2748 #endif 2749 #ifndef MIPI_SYST_CATALOG64_3_LOCADDR 2750 #define MIPI_SYST_CATALOG64_3_LOCADDR(svh, sev, id, p1, p2, p3) 2751 #endif 2752 #ifndef MIPI_SYST_CATALOG64_4_LOCADDR 2753 #define MIPI_SYST_CATALOG64_4_LOCADDR(svh, sev, id, p1, p2, p3, p4) 2754 #endif 2755 #ifndef MIPI_SYST_CATALOG64_5_LOCADDR 2756 #define MIPI_SYST_CATALOG64_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5) 2757 #endif 2758 #ifndef MIPI_SYST_CATALOG64_6_LOCADDR 2759 #define MIPI_SYST_CATALOG64_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6) 2760 #endif 2761 2762 #ifndef MIPI_SYST_CATALOG64_0_LOC16 2763 #define MIPI_SYST_CATALOG64_0_LOC16(svh, sev, f, id) 2764 #endif 2765 #ifndef MIPI_SYST_CATALOG64_1_LOC16 2766 #define MIPI_SYST_CATALOG64_1_LOC16(svh, sev, f, id, p1) 2767 #endif 2768 #ifndef MIPI_SYST_CATALOG64_2_LOC16 2769 #define MIPI_SYST_CATALOG64_2_LOC16(svh, sev, f, id, p1, p2) 2770 #endif 2771 #ifndef MIPI_SYST_CATALOG64_3_LOC16 2772 #define MIPI_SYST_CATALOG64_3_LOC16(svh, sev, f, id, p1, p2, p3) 2773 #endif 2774 #ifndef MIPI_SYST_CATALOG64_4_LOC16 2775 #define MIPI_SYST_CATALOG64_4_LOC16(svh, sev, f, id, p1, p2, p3, p4) 2776 #endif 2777 #ifndef MIPI_SYST_CATALOG64_5_LOC16 2778 #define MIPI_SYST_CATALOG64_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5) 2779 #endif 2780 #ifndef MIPI_SYST_CATALOG64_6_LOC16 2781 #define MIPI_SYST_CATALOG64_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2782 #endif 2783 2784 #ifndef MIPI_SYST_CATALOG64_0_LOC32 2785 #define MIPI_SYST_CATALOG64_0_LOC32(svh, sev, f, id) 2786 #endif 2787 #ifndef MIPI_SYST_CATALOG64_1_LOC32 2788 #define MIPI_SYST_CATALOG64_1_LOC32(svh, sev, f, id, p1) 2789 #endif 2790 #ifndef MIPI_SYST_CATALOG64_2_LOC32 2791 #define MIPI_SYST_CATALOG64_2_LOC32(svh, sev, f, id, p1, p2) 2792 #endif 2793 #ifndef MIPI_SYST_CATALOG64_3_LOC32 2794 #define MIPI_SYST_CATALOG64_3_LOC32(svh, sev, f, id, p1, p2, p3) 2795 #endif 2796 #ifndef MIPI_SYST_CATALOG64_4_LOC32 2797 #define MIPI_SYST_CATALOG64_4_LOC32(svh, sev, f, id, p1, p2, p3, p4) 2798 #endif 2799 #ifndef MIPI_SYST_CATALOG64_5_LOC32 2800 #define MIPI_SYST_CATALOG64_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5) 2801 #endif 2802 #ifndef MIPI_SYST_CATALOG64_6_LOC32 2803 #define MIPI_SYST_CATALOG64_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2804 #endif 2805 2806 #ifndef MIPI_SYST_CLOCK_SYNC 2807 #define MIPI_SYST_CLOCK_SYNC(h,c,f) 2808 #endif 2809 2810 #ifndef MIPI_SYST_PRINTF 2811 #define MIPI_SYST_PRINTF(...) 2812 #endif 2813 #ifndef MIPI_SYST_PRINTF_LOC16 2814 #define MIPI_SYST_PRINTF_LOC16(...) 2815 #endif 2816 #ifndef MIPI_SYST_PRINTF_LOC32 2817 #define MIPI_SYST_PRINTF_LOC32(...) 2818 #endif 2819 #ifndef MIPI_SYST_PRINTF_LOCADDR 2820 #define MIPI_SYST_PRINTF_LOCADDR(...) 2821 #endif 2822 2823 #ifndef MIPI_SYST_CATPRINTF64 2824 #define MIPI_SYST_CATPRINTF64(...) 2825 #endif 2826 #ifndef MIPI_SYST_CATPRINTF64_LOC16 2827 #define MIPI_SYST_CATPRINTF64_LOC16(...) 2828 #endif 2829 #ifndef MIPI_SYST_CATPRINTF64_LOC32 2830 #define MMIPI_SYST_CATPRINTF64_LOC32(...) 2831 #endif 2832 #ifndef MIPI_SYST_CATPRINTF64_LOCADDR 2833 #define MIPI_SYST_CATPRINTF64_LOCADDR(...) 2834 #endif 2835 #ifndef MIPI_SYST_CATPRINTF32 2836 #define MIPI_SYST_CATPRINTF32(...) 2837 #endif 2838 #ifndef MIPI_SYST_CATPRINTF32_LOC16 2839 #define MIPI_SYST_CATPRINTF32_LOC16(...) 2840 #endif 2841 #ifndef MIPI_SYST_CATPRINTF32_LOC32 2842 #define MMIPI_SYST_CATPRINTF32_LOC32(...) 2843 #endif 2844 #ifndef MIPI_SYST_CATPRINTF32_LOCADDR 2845 #define MIPI_SYST_CATPRINTF32_LOCADDR(...) 2846 #endif 2847 2848 /* Map CATPRINTF calls to their corresponding catalog APIs 2849 * by dropping the format string parameter. 2850 */ 2851 /** 2852 * @defgroup PrintfApi Printf style catalog Message Macros 2853 * @ingroup ApiSets 2854 * 2855 * Printf style catalog message instrumentation API wrappers. 2856 * The `MIPI_SYST_CATPRINTF{ID-WIDTH}_{PARAMETER-COUNT}` 2857 * macros call their corresponding catalog API macro by dropping 2858 * the format parameter. The API is intended to have 2859 * printf style instrumentation inside the sources, but drop the format 2860 * string during compilation and replace it with a catalog API call 2861 * instead. Source scanning tools are used to extract the format strings 2862 * from sources into catalog dictionary files. The dictionary files can 2863 * then be used to reconstruct the printf formatting during trace decode 2864 * time. This saves both space and execution time in the resulting 2865 * application, and bandwidth over a trace link. 2866 * 2867 * This API set is enabled or disabled by the 2868 * #MIPI_SYST_PCFG_ENABLE_CATID64_API and/or #MIPI_SYST_PCFG_ENABLE_CATID32_API 2869 * platform feature defines. 2870 * @{ 2871 */ 2872 #define MIPI_SYST_CATPRINTF32_0(svh, sev, id, fmt)\ 2873 MIPI_SYST_CATALOG32_0(svh, sev, id) 2874 #define MIPI_SYST_CATPRINTF32_1(svh, sev, id, fmt, p1)\ 2875 MIPI_SYST_CATALOG32_1(svh, sev, id, p1) 2876 #define MIPI_SYST_CATPRINTF32_2(svh, sev, id, fmt, p1, p2)\ 2877 MIPI_SYST_CATALOG32_2(svh, sev, id, p1, p2) 2878 #define MIPI_SYST_CATPRINTF32_3(svh, sev, id, fmt, p1, p2, p3)\ 2879 MIPI_SYST_CATALOG32_3(svh, sev, id, p1, p2, p3) 2880 #define MIPI_SYST_CATPRINTF32_4(svh, sev, id, fmt, p1, p2, p3, p4)\ 2881 MIPI_SYST_CATALOG32_4(svh, sev, id, p1, p2, p3, p4) 2882 #define MIPI_SYST_CATPRINTF32_5(svh, sev, id, fmt, p1, p2, p3, p4, p5)\ 2883 MIPI_SYST_CATALOG32_5(svh, sev, id, p1, p2, p3, p4, p5) 2884 #define MIPI_SYST_CATPRINTF32_6(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\ 2885 MIPI_SYST_CATALOG32_6(svh, sev, id, p1, p2, p3, p4, p5, p6) 2886 #define MIPI_SYST_CATPRINTF32_0_LOCADDR(svh, sev, id, fmt)\ 2887 MIPI_SYST_CATALOG32_0_LOCADDR(svh, sev, id) 2888 #define MIPI_SYST_CATPRINTF32_1_LOCADDR(svh, sev, id, fmt, p1)\ 2889 MIPI_SYST_CATALOG32_1_LOCADDR(svh, sev, id, p1) 2890 #define MIPI_SYST_CATPRINTF32_2_LOCADDR(svh, sev, id, fmt, p1, p2)\ 2891 MIPI_SYST_CATALOG32_2_LOCADDR(svh, sev, id, p1, p2) 2892 #define MIPI_SYST_CATPRINTF32_3_LOCADDR(svh, sev, id, fmt, p1, p2, p3)\ 2893 MIPI_SYST_CATALOG32_3_LOCADDR(svh, sev, id, p1, p2, p3) 2894 #define MIPI_SYST_CATPRINTF32_4_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4)\ 2895 MIPI_SYST_CATALOG32_4_LOCADDR(svh, sev, id, p1, p2, p3, p4) 2896 #define MIPI_SYST_CATPRINTF32_5_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5)\ 2897 MIPI_SYST_CATALOG32_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5) 2898 #define MIPI_SYST_CATPRINTF32_6_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\ 2899 MIPI_SYST_CATALOG32_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6) 2900 #define MIPI_SYST_CATPRINTF32_0_LOC16(svh, sev, f, id, fmt)\ 2901 MIPI_SYST_CATALOG32_0_LOC16(svh, sev, f, id) 2902 #define MIPI_SYST_CATPRINTF32_1_LOC16(svh, sev, f, id, fmt, p1)\ 2903 MIPI_SYST_CATALOG32_1_LOC16(svh, sev, f, id, p1) 2904 #define MIPI_SYST_CATPRINTF32_2_LOC16(svh, sev, f, id, fmt, p1, p2)\ 2905 MIPI_SYST_CATALOG32_2_LOC16(svh, sev, f, id, p1, p2) 2906 #define MIPI_SYST_CATPRINTF32_3_LOC16(svh, sev, f, id, fmt, p1, p2, p3)\ 2907 MIPI_SYST_CATALOG32_3_LOC16(svh, sev, f, id, p1, p2, p3) 2908 #define MIPI_SYST_CATPRINTF32_4_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4)\ 2909 MIPI_SYST_CATALOG32_4_LOC16(svh, sev, f, id, p1, p2, p3, p4) 2910 #define MIPI_SYST_CATPRINTF32_5_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\ 2911 MIPI_SYST_CATALOG32_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5) 2912 #define MIPI_SYST_CATPRINTF32_6_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\ 2913 MIPI_SYST_CATALOG32_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2914 #define MIPI_SYST_CATPRINTF32_0_LOC32(svh, sev, f, id, fmt)\ 2915 MIPI_SYST_CATALOG32_0_LOC32(svh, sev, f, id) 2916 #define MIPI_SYST_CATPRINTF32_1_LOC32(svh, sev, f, id, fmt, p1)\ 2917 MIPI_SYST_CATALOG32_1_LOC32(svh, sev, f, id, p1) 2918 #define MIPI_SYST_CATPRINTF32_2_LOC32(svh, sev, f, id, fmt, p1, p2)\ 2919 MIPI_SYST_CATALOG32_2_LOC32(svh, sev, f, id, p1, p2) 2920 #define MIPI_SYST_CATPRINTF32_3_LOC32(svh, sev, f, id, fmt, p1, p2, p3)\ 2921 MIPI_SYST_CATALOG32_3_LOC32(svh, sev, f, id, p1, p2, p3) 2922 #define MIPI_SYST_CATPRINTF32_4_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4)\ 2923 MIPI_SYST_CATALOG32_4_LOC32(svh, sev, f, id, p1, p2, p3, p4) 2924 #define MIPI_SYST_CATPRINTF32_5_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\ 2925 MIPI_SYST_CATALOG32_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5) 2926 #define MIPI_SYST_CATPRINTF32_6_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\ 2927 MIPI_SYST_CATALOG32_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2928 #define MIPI_SYST_CATPRINTF64_0(svh, sev, id, fmt)\ 2929 MIPI_SYST_CATALOG64_0(svh, sev, id) 2930 #define MIPI_SYST_CATPRINTF64_1(svh, sev, id, fmt, p1)\ 2931 MIPI_SYST_CATALOG64_1(svh, sev, id, p1) 2932 #define MIPI_SYST_CATPRINTF64_2(svh, sev, id, fmt, p1, p2)\ 2933 MIPI_SYST_CATALOG64_2(svh, sev, id, p1, p2) 2934 #define MIPI_SYST_CATPRINTF64_3(svh, sev, id, fmt, p1, p2, p3)\ 2935 MIPI_SYST_CATALOG64_3(svh, sev, id, p1, p2, p3) 2936 #define MIPI_SYST_CATPRINTF64_4(svh, sev, id, fmt, p1, p2, p3, p4)\ 2937 MIPI_SYST_CATALOG64_4(svh, sev, id, p1, p2, p3, p4) 2938 #define MIPI_SYST_CATPRINTF64_5(svh, sev, id, fmt, p1, p2, p3, p4, p5)\ 2939 MIPI_SYST_CATALOG64_5(svh, sev, id, p1, p2, p3, p4, p5) 2940 #define MIPI_SYST_CATPRINTF64_6(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\ 2941 MIPI_SYST_CATALOG64_6(svh, sev, id, p1, p2, p3, p4, p5, p6) 2942 #define MIPI_SYST_CATPRINTF64_0_LOCADDR(svh, sev, id, fmt)\ 2943 MIPI_SYST_CATALOG64_0_LOCADDR(svh, sev, id) 2944 #define MIPI_SYST_CATPRINTF64_1_LOCADDR(svh, sev, id, fmt, p1)\ 2945 MIPI_SYST_CATALOG64_1_LOCADDR(svh, sev, id, p1) 2946 #define MIPI_SYST_CATPRINTF64_2_LOCADDR(svh, sev, id, fmt, p1, p2)\ 2947 MIPI_SYST_CATALOG64_2_LOCADDR(svh, sev, id, p1, p2) 2948 #define MIPI_SYST_CATPRINTF64_3_LOCADDR(svh, sev, id, fmt, p1, p2, p3)\ 2949 MIPI_SYST_CATALOG64_3_LOCADDR(svh, sev, id, p1, p2, p3) 2950 #define MIPI_SYST_CATPRINTF64_4_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4)\ 2951 MIPI_SYST_CATALOG64_4_LOCADDR(svh, sev, id, p1, p2, p3, p4) 2952 #define MIPI_SYST_CATPRINTF64_5_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5)\ 2953 MIPI_SYST_CATALOG64_5_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5) 2954 #define MIPI_SYST_CATPRINTF64_6_LOCADDR(svh, sev, id, fmt, p1, p2, p3, p4, p5, p6)\ 2955 MIPI_SYST_CATALOG64_6_LOCADDR(svh, sev, id, p1, p2, p3, p4, p5, p6) 2956 #define MIPI_SYST_CATPRINTF64_0_LOC16(svh, sev, f, id, fmt)\ 2957 MIPI_SYST_CATALOG64_0_LOC16(svh, sev, f, id) 2958 #define MIPI_SYST_CATPRINTF64_1_LOC16(svh, sev, f, id, fmt, p1)\ 2959 MIPI_SYST_CATALOG64_1_LOC16(svh, sev, f, id, p1) 2960 #define MIPI_SYST_CATPRINTF64_2_LOC16(svh, sev, f, id, fmt, p1, p2)\ 2961 MIPI_SYST_CATALOG64_2_LOC16(svh, sev, f, id, p1, p2) 2962 #define MIPI_SYST_CATPRINTF64_3_LOC16(svh, sev, f, id, fmt, p1, p2, p3)\ 2963 MIPI_SYST_CATALOG64_3_LOC16(svh, sev, f, id, p1, p2, p3) 2964 #define MIPI_SYST_CATPRINTF64_4_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4)\ 2965 MIPI_SYST_CATALOG64_4_LOC16(svh, sev, f, id, p1, p2, p3, p4) 2966 #define MIPI_SYST_CATPRINTF64_5_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\ 2967 MIPI_SYST_CATALOG64_5_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5) 2968 #define MIPI_SYST_CATPRINTF64_6_LOC16(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\ 2969 MIPI_SYST_CATALOG64_6_LOC16(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2970 #define MIPI_SYST_CATPRINTF64_0_LOC32(svh, sev, f, id, fmt)\ 2971 MIPI_SYST_CATALOG64_0_LOC32(svh, sev, f, id) 2972 #define MIPI_SYST_CATPRINTF64_1_LOC32(svh, sev, f, id, fmt, p1)\ 2973 MIPI_SYST_CATALOG64_1_LOC32(svh, sev, f, id, p1) 2974 #define MIPI_SYST_CATPRINTF64_2_LOC32(svh, sev, f, id, fmt, p1, p2)\ 2975 MIPI_SYST_CATALOG64_2_LOC32(svh, sev, f, id, p1, p2) 2976 #define MIPI_SYST_CATPRINTF64_3_LOC32(svh, sev, f, id, fmt, p1, p2, p3)\ 2977 MIPI_SYST_CATALOG64_3_LOC32(svh, sev, f, id, p1, p2, p3) 2978 #define MIPI_SYST_CATPRINTF64_4_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4)\ 2979 MIPI_SYST_CATALOG64_4_LOC32(svh, sev, f, id, p1, p2, p3, p4) 2980 #define MIPI_SYST_CATPRINTF64_5_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5)\ 2981 MIPI_SYST_CATALOG64_5_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5) 2982 #define MIPI_SYST_CATPRINTF64_6_LOC32(svh, sev, f, id, fmt, p1, p2, p3, p4, p5, p6)\ 2983 MIPI_SYST_CATALOG64_6_LOC32(svh, sev, f, id, p1, p2, p3, p4, p5, p6) 2984 /** @} */ 2985 2986 #ifdef __cplusplus 2987 } /* extern C */ 2988 #endif 2989 #endif 2990