System Services
Memory and Low-level Functions
5-13
Example 5-10.
Using SYS_abort with Optional Data Values
The single vargs parameter is of type va_list and represents the sequence of
arg parameters originally passed to SYS_abort. The function specified for the
Abort function property can pass the format and vargs parameters directly to
SYS_vprintf or SYS_vsprintf prior to terminating program execution. To avoid
the large code overhead of SYS_vprintf or SYS_vsprintf, you can use
LOG_error instead to simply print the format string.
SYS_exit likewise calls whatever function is bound to the Exit function
property, passing on its original status parameter. SYS_exit first executes a
set of handlers registered through the function SYS_atexit as described
Example 5-11.
Example 5-11.
Using Handlers in SYS_exit
The function SYS_atexit provides a mechanism that enables you to stack up
to SYS_NUMHANDLERS (which is set to 8) clean-up routines as shown in
Example 5-12. The handlers are executed before SYS_exit calls the function
bound to the Exit function property. SYS_atexit returns FALSE when its
internal stack is full.
Example 5-12.
Using Multiple SYS_NUMHANDLERS
(*(Abort_function)) (format, vargs)
(*handlerN)(status)
...
(*handler2)(status)
(*handler1)(status)
(*(Exit_function))(status)
Bool SYS_atexit(handler)
Fxn handler;
Содержание TMS320 Series
Страница 1: ...TMS320 DSP BIOS v5 40 User s Guide Literature Number SPRU423G April 2009 ...
Страница 16: ...xvi ...
Страница 152: ...Tasks 4 48 Figure 4 12 Trace from Example 4 7 ...
Страница 168: ...Semaphores 4 64 Figure 4 14 Trace Results from Example 4 11 ...
Страница 202: ...5 20 ...
Страница 287: ...Index 9 Index Void 1 11 W words data memory 3 15 of code 1 5 wrapper function 2 29 ...
Страница 288: ...Index 10 Index ...