1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32
33 34 35
36 import xdc.runtime.Diags;
37
38 /*!
39 * UIA Standard Error Events
40 *
41 * The UIAErr module defines standard error events that allow
42 * tooling to identify common errors in a consistent way. They are all
43 * intended to be used with the Log_writeX APIs and, in the future, with
44 * crash dump APIs, and provide a way to log errors in a more standardized
45 * way than the generic Log_error API enables.
46 *
47 * The events in this module have one of the following event priority levels:
48 * EMERGENCY: used to indicate a non-recoverable situation (e.g. a crash, with
49 * the event containing information about the cause of the crash)
50 * CRITICAL: used to indicate a sever error that should raise an alarm or
51 * cause a notification message to be sent to a system administrator.
52 * ERROR: used to indicate a recoverable error that does not require an alarm
53 * to be raised.
54 *
55 * The following special formatting specifiers may be used to define the
56 * msg field of the UIAErr events:
57
58 * %$S - a string parameter that can provide additional formatting specifiers
59 * Note that $S use in strings passed in as a paramter is not supported.
60 *@p
61 * %$F - a specifier for a string parameter containing the file name (__FILE__) and
62 * an integer parameter containing the line number (__LINE__).
63 *
64 * The generation of UIAErr events is controlled by a module's diagnostics
65 * mask, which is described in details in `{@link xdc.runtime.Diags}`.
66 * `UIAErr` events are generated only when the Diags.STATUS bit is set
67 * in the module's diagnostics mask. The Diags.STATUS bit is set to ALWAYS_ON
68 * by default.
69 *
70 * The following configuration script demonstrates how to enable use of
71 * UIAErr events within an application. Since the Diags.STATUS bits are set
72 * to ALWAYS_ON by default, no explicit code is required to enable the
73 * Diags Masks for these events.
74 *
75 * @a(Examples)
76 * Example 1: This is part of the XDC configuration file for the application:
77 *
78 * @p(code)
79 * var UIAErr = xdc.useModule('ti.uia.events.UIAErr');
80 * var Diags = xdc.useModule('xdc.runtime.Diags');
81 * var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
82 * var Defaults = xdc.useModule('xdc.runtime.Defaults');
83 * var logger = LoggerSys.create();
84 *
85 * Defaults.common$.logger = logger;
86 * @p
87 *
88 * @p(html)
89 * <hr />
90 * @p
91 *
92 * Example 2: The following example configures a module to support logging
93 * of STATUS events, but defers the actual activation and deactivation of the
94 * logging until runtime. See the `{@link Diags#setMask Diags_setMask()}`
95 * function for details on specifying the control string.
96 *
97 * This is a part of the XDC configuration file for the application:
98 *
99 * @p(code)
100 * var UIAErr = xdc.useModule('ti.uia.events.UIAErr');
101 * var Diags = xdc.useModule('xdc.runtime.Diags');
102 * var Mod = xdc.useModule('my.pkg.Mod');
103 *
104 * Mod.common$.diags_STATUS = Diags.RUNTIME_OFF;
105 * @p
106 *
107 * This is a part of the C code for the application:
108 *
109 * @p(code)
110 * // turn on logging of STATUS events in the module
111 * Diags_setMask("my.pkg.Mod+S");
112 *
113 * // turn off logging of STATUS events in the module
114 * Diags_setMask("my.pkg.Mod-S");
115 * @p
116 */
117 module UIAErr inherits IUIAEvent {
118
119 /*!
120 * ======== error ========
121 * Event to use to log an existing software Error Code.
122 *
123 * UIAErr_error is used primarily to support logging of legacy error codes with minimal
124 * overhead. Metadata is generated for this event that provides a predefined format
125 * specifier string that can be used to display the error code with. This minimizes the
126 * number of parameters that need to be logged with the event (it only requires the
127 * actual error code to be logged). Unlike the Log_error API, no __FILE__ or
128 * __LINE__ information about the call-site is logged with the error code.
129 *
130 * @a(Example)
131 * The following C code shows how to log a legacy error code as a UIA event.
132 *
133 * @p(code)
134 * #include <xdc/runtime/Log.h>
135 * #include <ti/uia/events/UIAErr.h>
136 * ...
137 * Int myErrorCode = 0xEC0DE;
138 * Log_write1(UIAErr_error,myErrorCode);
139 * ...
140 * @p The following text is an example of what will be displayed for the event:
141 * @p(code)
142 * "ERROR: ErrorCode:0xECODE"
143 *
144 * @param(%x) integer that identifies the type of error
145 * @see #errorWithStr
146 */
147 config xdc.runtime.Log.Event error = {
148 mask: Diags.STATUS,
149 level: Diags.ERROR,
150 msg: "ERROR: ErrorCode:0x%x"
151 };
152
153 /*!
154 * ======== errorWithStr ========
155 * Event to use to log an existing software Error Code and fmt string
156 *
157 * UIAErr_errorWithStr is used primarily to support logging of legacy error codes along
158 * with user-defined strings that describe the error. Unlike the Log_error API,
159 * no __FILE__ or __LINE__ information about the call-site is logged with the error code.
160 *
161 * @a(Example)
162 * The following C code shows how to log a legacy error code as a UIA event.
163 *
164 * @p(code)
165 * #include <xdc/runtime/Log.h>
166 * #include <ti/uia/events/UIAErr.h>
167 * ...
168 * Int myErrorCode = 0xEC0DE;
169 * String myErrorStr = "Legacy Error String for error 0xECODE";
170 * ...
171 * Log_write2(UIAErr_errorWithStr,myErrorCode,(IArg)myErrorStr);
172 * ...
173 * @p The following text is an example of what will be displayed for the event:
174 * @p(code)
175 * "ERROR: ErrorCode:0xECODE. Legacy Error String for error 0xECODE"
176 *
177 * @param(%x) integer that identifies the type of error
178 * @param(%$S) fmt string used to format the event message.
179 *
180 * Up to 6 additional arguments can be logged with this event if
181 * required. The formatting string should provide format specifiers
182 * for each of the additional arguments
183 *
184 * @see #error
185 *
186 */
187 config xdc.runtime.Log.Event errorWithStr = {
188 mask: Diags.STATUS,
189 level: Diags.ERROR,
190 msg: "ERROR: ErrorCode:0x%x. %$S"
191 };
192
193 /*!
194 * ======== hwError ========
195 * hardware error event code
196 *
197 * Used to log a generic hardware error.
198 * Unlike the Log_error API, no __FILE__ or __LINE__ information about
199 * the call-site is logged with the error code.
200 *
201 * @a(Example)
202 * The following C code shows how to log a legacy error code as a UIA event.
203 *
204 * @p(code)
205 * #include <xdc/runtime/Log.h>
206 * #include <ti/uia/events/UIAErr.h>
207 * ...
208 * Int myHWErrorCode = 0xEC0DE;
209 * ...
210 * Log_write1(UIAErr_hwError,myHWErrorCode);
211 * ...
212 * @p The following text is an example of what will be displayed for the event:
213 * @p(code)
214 * "HW ERROR: ErrorCode:0xECODE."
215 *
216 * @param(%x) integer that identifies the type of warning
217 * @see #error
218 */
219 config xdc.runtime.Log.Event hwError = {
220 mask: Diags.STATUS,
221 level: Diags.ERROR,
222 msg: "HW ERROR: ErrorCode:0x%x"};
223
224 /*!
225 * ======== hwErrorWithStr ========
226 * hardware error event code and fmt string
227 *
228 * Used to log a generic hardware error.
229 * @a(Example)
230 * The following C code shows how to log a legacy error code and an
231 * associated string as a UIA event.
232 *
233 * @p(code)
234 * #include <xdc/runtime/Log.h>
235 * #include <ti/uia/events/UIAErr.h>
236 * ...
237 * Int myHWErrorCode = 0xEC0DE;
238 * String myHWErrorStr = "My description of hardware error 0xEC0DE";
239 * ...
240 * Log_write2(UIAErr_hwErrorWithStr,myHWErrorCode,(IArg)myHWErrorStr);
241 * ...
242 * @p The following text is an example of what will be displayed for the event:
243 * @p(code)
244 * "HW ERROR: ErrorCode:0xECODE. My description of hardware error 0xEC0DE"
245 *
246 * @param(%x) integer that identifies the type of error
247 * @param(%$S) fmt string used to format the event message.
248 *
249 * Up to 6 additional arguments can be logged with this event if
250 * required. The formatting string should provide format specifiers
251 * for each of the additional arguments
252 *
253 * @see #error
254 *
255 */
256 config xdc.runtime.Log.Event hwErrorWithStr = {
257 mask: Diags.STATUS,
258 level: Diags.ERROR,
259 msg: "HW ERROR: ErrorCode:0x%x. %$S"};
260
261 /*!
262 * ======== fatal ========
263 * fatal error code
264 *
265 * Used to log a fatal, nonrecoverable error (Event level = EMERGENCY)
266 *
267 * @a(Example)
268 * The following C code shows how to log a fatal error code as a UIA event.
269 *
270 * @p(code)
271 * #include <xdc/runtime/Log.h>
272 * #include <ti/uia/events/UIAErr.h>
273 * ...
274 * Int myFatalErrorCode = 0xDEADC0DE;
275 * ...
276 * Log_write1(UIAErr_fatal,myFatalErrorCode);
277 * ...
278 * @p The following text is an example of what will be displayed for the event:
279 * @p(code)
280 * "FATAL ERROR: ErrorCode:0xDEADC0DE."
281 * @param(%x) integer that identifies the type of error
282 * @see #error
283 */
284 config xdc.runtime.Log.Event fatal = {
285 mask: Diags.STATUS,
286 level: Diags.EMERGENCY,
287 msg: "FATAL ERROR: ErrorCode:0x%x"};
288
289 /*!
290 * ======== fatalWithStr ========
291 * fatal error event code and fmt string
292 *
293 * Used to log a fatal, nonrecoverable error.
294 *
295 * @a(Example)
296 * The following C code shows how to log a legacy error code and an
297 * associated string as a UIA event.
298 *
299 * @p(code)
300 * #include <xdc/runtime/Log.h>
301 * #include <ti/uia/events/UIAErr.h>
302 * ...
303 * Int myFatalErrorCode = 0xDEADC0DE;
304 * String myFatalErrorStr = "My description of fatal error 0xDEADC0DE";
305 * ...
306 * Log_write2(UIAErr_fatalWithStr,myFatalErrorCode,(IArg)myFatalErrorStr);
307 * ...
308 * @p The following text is an example of what will be displayed for the event:
309 * @p(code)
310 * "FATAL ERROR: ErrorCode:0xDEADC0DE. My description of fatal error 0xDEADC0DE"
311 *
312 * @param(%x) integer that identifies the type of error
313 * @param(%$S) fmt string used to format the event message.
314 *
315 * Up to 6 additional arguments can be logged with this event if
316 * required. The formatting string should provide format specifiers
317 * for each of the additional arguments
318 * @see #error
319 */
320 config xdc.runtime.Log.Event fatalWithStr = {
321 mask: Diags.STATUS,
322 level: Diags.EMERGENCY,
323 msg: "FATAL ERROR: ErrorCode:0x%x. %$S"};
324
325 /*!
326 * ======== critical ========
327 * critical error event code
328 *
329 * Used to log a critical error in which the system
330 * has e.g. had to kill certain operations in order to
331 * keep running. (Event Level = CRITICAL)
332 *
333 * @a(Example)
334 * The following C code shows how to log a fatal error code as a UIA event.
335 *
336 * @p(code)
337 * #include <xdc/runtime/Log.h>
338 * #include <ti/uia/events/UIAErr.h>
339 * ...
340 * Int myCriticalErrorCode = 0xACODE;
341 * ...
342 * Log_write1(UIAErr_critical,myCriticalErrorCode);
343 * ...
344 * @p The following text is an example of what will be displayed for the event:
345 * @p(code)
346 * "CRITICAL ERROR: ErrorCode:0xACODE."
347 * @param(%x) integer that identifies the type of error
348 *
349 * @see #error
350 */
351 config xdc.runtime.Log.Event critical = {
352 mask: Diags.STATUS,
353 level: Diags.CRITICAL,
354 msg: "CRITICAL ERROR: ErrorCode:0x%x"};
355
356 /*!
357 * ======== criticalWithStr ========
358 * critical error event code and fmt string
359 *
360 * Used to log a critical error in which the system
361 * has e.g. had to kill certain operations in order to
362 * keep running. (Event Level = CRITICAL)
363 *
364 * @a(Example)
365 * The following C code shows how to log a legacy error code and an
366 * associated string as a UIA event.
367 *
368 * @p(code)
369 * #include <xdc/runtime/Log.h>
370 * #include <ti/uia/events/UIAErr.h>
371 * ...
372 * Int myCriticalErrorCode = 0xAC0DE;
373 * ...
374 * Log_write2(UIAErr_criticalWithStr,myCriticalErrorCode,(IArg)"My description of critical error 0xAC0DE");
375 * ...
376 * @p The following text is an example of what will be displayed for the event:
377 * @p(code)
378 * "CRITICAL ERROR: ErrorCode:0xAC0DE. My description of critical error 0xAC0DE"
379 *
380 * @param(%x) integer that identifies the type of error
381 * @param(%$S) fmt string used to format the event message.
382 *
383 * Up to 6 additional arguments can be logged with this event if
384 * required. The formatting string should provide format specifiers
385 * for each of the additional arguments
386 *
387 * @see #error
388 */
389 config xdc.runtime.Log.Event criticalWithStr = {
390 mask: Diags.STATUS,
391 level: Diags.CRITICAL,
392 msg: "CRITICAL ERROR: ErrorCode:0x%x. %$S"};
393 /*!
394 * ======== exception ========
395 * exception event code
396 *
397 * Used to log that an exception occurred.
398 * Typically used with LogSnapshot or LogCrashDump APIs to
399 * log stack dump data that identifies why the exception occurred.
400 * @a(Example)
401 * The following C code shows how to log an exception that identifies
402 * the file and line number that the exception occurred at as a UIA event.
403 *
404 * @p(code)
405 * #include <xdc/runtime/Log.h>
406 * #include <ti/uia/events/UIAErr.h>
407 * ...
408 * Log_write2(UIAErr_exception,(IArg)__FILE__,__LINE__);
409 * ...
410 * @p The following text is an example of what will be displayed for the event:
411 * @p(code)
412 * "ERROR: Exception at demo.c line 1234."
413 * @param(__FILE__) The file that the exception occurred in
414 * @param(__LINE__) The line that the exception occurred at
415 *
416 * @see #error
417 */
418 config xdc.runtime.Log.Event exception = {
419 mask: Diags.STATUS,
420 level: Diags.ERROR,
421 msg: "ERROR: Exception at %$F."};
422
423 /*!
424 * ======== uncaughtException ========
425 * uncaughtException event code
426 *
427 * Used to log that an uncaught exception occurred.
428 * Typically used with LogSnapshot or LogCrashDump APIs to
429 * log stack dump data that identifies why the exception occurred.
430 * @a(Example)
431 * The following C code shows how to log an exception that identifies
432 * the file and line number that the exception occurred at as a UIA event.
433 *
434 * @p(code)
435 * #include <xdc/runtime/Log.h>
436 * #include <ti/uia/events/UIAErr.h>
437 * ...
438 * Log_write2(UIAErr_uncaughtException,(IArg)__FILE__,__LINE__);
439 * ...
440 * @p The following text is an example of what will be displayed for the event:
441 * @p(code)
442 * "ERROR: Uncaught Exception at demo.c line 1234."
443 * @param(__FILE__) The file that the exception occurred in
444 * @param(__LINE__) The line that the exception occurred at
445 *
446 */
447 config xdc.runtime.Log.Event uncaughtException = {
448 mask: Diags.STATUS,
449 level: Diags.ERROR,
450 msg: "ERROR: Uncaught Exception at %$F."};
451
452 /*!
453 * ======== nullPointerException ========
454 * nullPointerException event code
455 *
456 * Used to log that a null pointer exception occurred.
457 * Typically used with LogSnapshot or LogCrashDump APIs to
458 * log stack dump data that identifies why the exception occurred.
459 * @a(Example)
460 * The following C code shows how to log an exception that identifies
461 * the file and line number that the exception occurred at as a UIA event.
462 *
463 * @p(code)
464 * #include <xdc/runtime/Log.h>
465 * #include <ti/uia/events/UIAErr.h>
466 * ...
467 * Log_write2(UIAErr_nullPointerException,(IArg)__FILE__,__LINE__);
468 * ...
469 * @p The following text is an example of what will be displayed for the event:
470 * @p(code)
471 * "ERROR: Null Pointer Exception at demo.c line 1234."
472 * @param(__FILE__) The file that the exception occurred in
473 * @param(__LINE__) The line that the exception occurred at
474 */
475 config xdc.runtime.Log.Event nullPointerException = {
476 mask: Diags.STATUS,
477 level: Diags.ERROR,
478 msg: "ERROR: Null Pointer Exception at %$F."};
479
480 /*!
481 * ======== unexpectedInterrupt ========
482 * unexpectedInterrupt event code
483 *
484 * Used to log that an unexpected interrupt occurred.
485 * @a(Example)
486 * The following C code shows how to log an exception that identifies
487 * the file and line number that the exception occurred at as a UIA event.
488 *
489 * @p(code)
490 * #include <xdc/runtime/Log.h>
491 * #include <ti/uia/events/UIAErr.h>
492 * ...
493 * Log_write2(UIAErr_unexpectedInterrupt,(IArg)__FILE__,__LINE__);
494 * ...
495 * @p The following text is an example of what will be displayed for the event:
496 * @p(code)
497 * "ERROR: Null Pointer Exception at demo.c line 1234."
498 * @param(__FILE__) The file that the exception occurred in
499 * @param(__LINE__) The line that the exception occurred at
500 */
501 config xdc.runtime.Log.Event unexpectedInterrupt = {
502 mask: Diags.STATUS,
503 level: Diags.ERROR,
504 msg: "ERROR: Unexpected Interrupt at %$F."};
505
506 /*!
507 * ======== memoryAccessFault ========
508 * memoryAccessFault event code
509 *
510 * Used to log that a memory access fault occurred.
511 * @a(Example)
512 * The following C code shows how to log an exception that identifies
513 * the file and line number that the exception occurred at as a UIA event.
514 * Comments in the code can then provide further explication of the error.
515 *
516 * @p(code)
517 * #include <xdc/runtime/Log.h>
518 * #include <ti/uia/events/UIAErr.h>
519 * ...
520 * Log_write3(UIAErr_memoryAccessFault,(IArg)__FILE__,__LINE__,(IArg)badAdrs);
521 * ...
522 * @p The following text is an example of what will be displayed for the event:
523 * @p(code)
524 * "ERROR: Memory Access Fault at demo.c line 1234. [ADRS]0xFFFFFFFF"
525 * @param(__FILE__) The file that the exception occurred in
526 * @param(__LINE__) The line that the exception occurred at
527 * @param(adrs) The address that caused the memory access fault
528 */
529 config xdc.runtime.Log.Event memoryAccessFault = {
530 mask: Diags.STATUS,
531 level: Diags.ERROR,
532 msg: "ERROR: Memory Access Fault at %$F. [ADRS]0x%x"};
533
534 /*!
535 * ======== securityException ========
536 * securityException event code
537 *
538 * Used to log that a security exception occurred.
539 * @a(Example)
540 * The following C code shows how to log an exception that identifies
541 * the file and line number that the exception occurred at as a UIA event.
542 * Comments in the code can then provide further explication of the error.
543 *
544 * @p(code)
545 * #include <xdc/runtime/Log.h>
546 * #include <ti/uia/events/UIAErr.h>
547 * ...
548 * Log_write2(UIAErr_securityException,(IArg)__FILE__,__LINE__);
549 * ...
550 * @p The following text is an example of what will be displayed for the event:
551 * @p(code)
552 * "ERROR: Security Exception at demo.c line 1234."
553 * @param(__FILE__) The file that the exception occurred in
554 * @param(__LINE__) The line that the exception occurred at
555 */
556 config xdc.runtime.Log.Event securityException = {
557 mask: Diags.STATUS,
558 level: Diags.ERROR,
559 msg: "ERROR: Security Exception at %$F."};
560
561 /*!
562 * ======== divisionByZero ========
563 * divisionByZero event code
564 *
565 * Used to log that divide by zero exception occurred.
566 * @a(Example)
567 * The following C code shows how to log an exception that identifies
568 * the file and line number that the exception occurred at as a UIA event.
569 * Comments in the code can then provide further explication of the error.
570 *
571 * @p(code)
572 * #include <xdc/runtime/Log.h>
573 * #include <ti/uia/events/UIAErr.h>
574 * ...
575 * Log_write2(UIAErr_divisionByZero,(IArg)__FILE__,__LINE__);
576 * ...
577 * @p The following text is an example of what will be displayed for the event:
578 * @p(code)
579 * "ERROR: Division by zero at demo.c line 1234."
580 * @param(__FILE__) The file that the exception occurred in
581 * @param(__LINE__) The line that the exception occurred at
582 */
583 config xdc.runtime.Log.Event divisionByZero = {
584 mask: Diags.STATUS,
585 level: Diags.ERROR,
586 msg: "ERROR: Division by zero at %$F."};
587
588 /*!
589 * ======== overflowException ========
590 * overflowException event code
591 *
592 * Used to log that an overflow exception occurred.
593 * @a(Example)
594 * The following C code shows how to log an exception that identifies
595 * the file and line number that the exception occurred at as a UIA event.
596 * Comments in the code can then provide further explication of the error.
597 *
598 * @p(code)
599 * #include <xdc/runtime/Log.h>
600 * #include <ti/uia/events/UIAErr.h>
601 * ...
602 * Log_write2(UIAErr_overflowException,(IArg)__FILE__,__LINE__);
603 * ...
604 * @p The following text is an example of what will be displayed for the event:
605 * @p(code)
606 * "ERROR: Overflow exception at demo.c line 1234."
607 * @param(__FILE__) The file that the exception occurred in
608 * @param(__LINE__) The line that the exception occurred at
609 */
610 config xdc.runtime.Log.Event overflowException = {
611 mask: Diags.STATUS,
612 level: Diags.ERROR,
613 msg: "ERROR: Overflow exception at %$F."};
614
615 /*!
616 * ======== indexOutOfRange ========
617 * indexOutOfRange event code
618 *
619 * Used to log that an index out of range condition occurred.
620 * @a(Example)
621 * The following C code shows how to log an exception that identifies
622 * the file and line number that the exception occurred at as a UIA event.
623 * Comments in the code can then provide further explication of the error.
624 *
625 * @p(code)
626 * #include <xdc/runtime/Log.h>
627 * #include <ti/uia/events/UIAErr.h>
628 * ...
629 * Log_write3(UIAErr_indexOutOfRange,(IArg)__FILE__,__LINE__,badIndex);
630 * ...
631 * @p The following text is an example of what will be displayed for the event:
632 * @p(code)
633 * "ERROR: OIndex out of range at demo.c line 1234. [INDEX]0xFFFFFFFF"
634 * @param(__FILE__) The file that the exception occurred in
635 * @param(__LINE__) The line that the exception occurred at
636 * @param(index) The index value that was out of range
637 */
638 config xdc.runtime.Log.Event indexOutOfRange = {
639 mask: Diags.STATUS,
640 level: Diags.ERROR,
641 msg: "ERROR: Index out of range at %$F. [INDEX]0x%x"};
642
643 /*!
644 * ======== notImplemented ========
645 * notImplemented event code
646 *
647 * Used to log that an attempt to access a feature that is not implemented
648 * @a(Example)
649 * The following C code shows how to log an exception that identifies
650 * the file and line number that the exception occurred at as a UIA event.
651 * Comments in the code can then provide further explication of the error.
652 *
653 * @p(code)
654 * #include <xdc/runtime/Log.h>
655 * #include <ti/uia/events/UIAErr.h>
656 * ...
657 * Log_write2(UIAErr_notImplemented,(IArg)__FILE__,__LINE__);
658 * ...
659 * @p The following text is an example of what will be displayed for the event:
660 * @p(code)
661 * "ERROR: Attempt to access feature that is not implemented at demo.c line 1234."
662 * @param(__FILE__) The file that the exception occurred in
663 * @param(__LINE__) The line that the exception occurred at
664 */
665 config xdc.runtime.Log.Event notImplemented = {
666 mask: Diags.STATUS,
667 level: Diags.ERROR,
668 msg: "ERROR: Attempt to access feature that is not implemented at %$F."};
669
670 /*!
671 * ======== stackOverflow ========
672 * stackOverflow event code
673 *
674 * Used to log that a stack overflow was detected. (Event Level = CRITICAL)
675 * @a(Example)
676 * The following C code shows how to log an exception that identifies
677 * the file and line number that the exception occurred at as a UIA event.
678 * Comments in the code can then provide further explication of the error.
679 *
680 * @p(code)
681 * #include <xdc/runtime/Log.h>
682 * #include <ti/uia/events/UIAErr.h>
683 * ...
684 * Log_write2(UIAErr_stackOverflow,(IArg)__FILE__,__LINE__);
685 * ...
686 * @p The following text is an example of what will be displayed for the event:
687 * @p(code)
688 * "ERROR: Stack Overflow detected at demo.c line 1234."
689 * @param(__FILE__) The file that the exception occurred in
690 * @param(__LINE__) The line that the exception occurred at
691 */
692 config xdc.runtime.Log.Event stackOverflow = {
693 mask: Diags.STATUS,
694 level: Diags.CRITICAL,
695 msg: "ERROR: Stack Overflow detected at %$F."};
696
697 /*!
698 * ======== illegalInstruction ========
699 * illegalInstruction event code
700 *
701 * Used to log that an illegal instruction was executed
702 * @a(Example)
703 * The following C code shows how to log an exception that identifies
704 * the file and line number that the exception occurred at as a UIA event.
705 * Comments in the code can then provide further explication of the error.
706 *
707 * @p(code)
708 * #include <xdc/runtime/Log.h>
709 * #include <ti/uia/events/UIAErr.h>
710 * ...
711 * Log_write2(UIAErr_illegalInstruction,(IArg)__FILE__,__LINE__);
712 * ...
713 * @p The following text is an example of what will be displayed for the event:
714 * @p(code)
715 * "ERROR: Illegal Instruction executed at demo.c line 1234."
716 * @param(__FILE__) The file that the exception occurred in
717 * @param(__LINE__) The line that the exception occurred at
718 */
719 config xdc.runtime.Log.Event illegalInstruction = {
720 mask: Diags.STATUS,
721 level: Diags.ERROR,
722 msg: "ERROR: Illegal Instruction executed at %$F."};
723
724 /*!
725 * ======== entryPointNotFound ========
726 * entryPointNotFound event code
727 *
728 * Used to log that a module or DLL entry point was not found
729 * @a(Example)
730 * The following C code shows how to log an exception that identifies
731 * the file and line number that the exception occurred at as a UIA event.
732 * Comments in the code can then provide further explication of the error.
733 *
734 * @p(code)
735 * #include <xdc/runtime/Log.h>
736 * #include <ti/uia/events/UIAErr.h>
737 * ...
738 * Log_write2(UIAErr_entryPointNotFound,(IArg)__FILE__,__LINE__);
739 * ...
740 * @p The following text is an example of what will be displayed for the event:
741 * @p(code)
742 * "ERROR: Entry Point Not Found at demo.c line 1234."
743 * @param(__FILE__) The file that the exception occurred in
744 * @param(__LINE__) The line that the exception occurred at
745 */
746 config xdc.runtime.Log.Event entryPointNotFound = {
747 mask: Diags.STATUS,
748 level: Diags.ERROR,
749 msg: "ERROR: Entry Point Not Found at %$F."};
750
751 /*!
752 * ======== moduleNotFound ========
753 * moduleNotFound event code
754 *
755 * Used to log that a module was not found
756 * @a(Example)
757 * The following C code shows how to log an exception that identifies
758 * the file and line number that the exception occurred at as a UIA event.
759 * Comments in the code can then provide further explication of the error.
760 *
761 * @p(code)
762 * #include <xdc/runtime/Log.h>
763 * #include <ti/uia/events/UIAErr.h>
764 * ...
765 * Log_write3(UIAErr_moduleNotFound,(IArg)__FILE__,__LINE__,moduleIdThatWasNotFound);
766 * ...
767 * @p The following text is an example of what will be displayed for the event:
768 * @p(code)
769 * "ERROR: Module not found at demo.c line 1234. [MODULE_ID]0x32903"
770 * @param(__FILE__) The file that the exception occurred in
771 * @param(__LINE__) The line that the exception occurred at
772 * @param(moduleId) The Module ID of the module that was not found
773 */
774 config xdc.runtime.Log.Event moduleNotFound = {
775 mask: Diags.STATUS,
776 level: Diags.ERROR,
777 msg: "ERROR: Module not found at %$F. [MODULE_ID]0x%x."};
778
779 /*!
780 * ======== floatingPointError ========
781 * floatingPointError event code
782 *
783 * Used to log that a floating point error occurred
784 * @a(Example)
785 * The following C code shows how to log an exception that identifies
786 * the file and line number that the exception occurred at as a UIA event.
787 * Comments in the code can then provide further explication of the error.
788 *
789 * @p(code)
790 * #include <xdc/runtime/Log.h>
791 * #include <ti/uia/events/UIAErr.h>
792 * ...
793 * Log_write2(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__);
794 * ...
795 * @p The following text is an example of what will be displayed for the event:
796 * @p(code)
797 * "ERROR: Floating Point Error at demo.c line 1234."
798 * @param(__FILE__) The file that the exception occurred in
799 * @param(__LINE__) The line that the exception occurred at
800 */
801 config xdc.runtime.Log.Event floatingPointError = {
802 mask: Diags.STATUS,
803 level: Diags.ERROR,
804 msg: "ERROR: Floating Point Error at %$F."};
805
806 /*!
807 * ======== invalidParameter ========
808 * invalidParameter event code
809 *
810 * Used to log that an invalid parameter was detected
811 * @a(Example)
812 * The following C code shows how to log an exception that identifies
813 * the file and line number that the exception occurred at as a UIA event.
814 * Comments in the code can then provide further explication of the error.
815 *
816 * @p(code)
817 * #include <xdc/runtime/Log.h>
818 * #include <ti/uia/events/UIAErr.h>
819 * ...
820 * Void myFunc(Int caseNumber){
821 * switch(caseNumber){
822 * ...
823 * break;
824 * default :
825 * Log_write4(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__,1,caseNumber);
826 * }
827 * }
828 *
829 * @p The following text is an example of what will be displayed for the event:
830 * @p(code)
831 * "ERROR: Invalid Parameter at demo.c line 1234. [ParamNum]1 [ParamValue]0xFFFFFFFF"
832 * @param(__FILE__) The file that the exception occurred in
833 * @param(__LINE__) The line that the exception occurred at
834 * @param(paramNum) The parameter number in the function's signature that was invalid
835 * @param(paramValue) The invalid parameter value
836 */
837 config xdc.runtime.Log.Event invalidParameter = {
838 mask: Diags.STATUS,
839 level: Diags.ERROR,
840 msg: "ERROR: Invalid Parameter at %$F. [ParamNum]%d [ParamValue]0x%x"};
841
842 }