Coma FW-C2800 User's Guide Page 197

  • Download
  • Add to my manuals
  • Print
  • Page
    / 276
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 196
System Services
Memory and Low-level Functions 5-11
5.2 System Services
The SYS module provides a basic set of system services patterned after
similar functions normally found in the standard C run-time library. As a rule,
DSP/BIOS software modules use the services provided by SYS in lieu of
similar C library functions.
Using the Configuration Tool, you can specify a customized routine that
performs when the program calls one of these SYS functions. See the SYS
reference section in the TMS320 DSP/BIOS API Reference Guide for your
platform for details.
5.2.1 Halting Execution
SYS provides two functions as seen in Example 5-9 for halting program
execution: SYS_exit, which is used for orderly termination; and SYS_abort,
which is reserved for catastrophic situations. Since the actions that should be
performed when exiting or aborting programs are inherently system-
dependent, you can modify configuration settings to invoke your own routines
whenever SYS_exit or SYS_abort is called.
Example 5-9. Coding To Halt Program Execution with SYS_exit or SYS_abort
The functions in Example 5-9 terminate execution by calling whatever routine
is specified for the Exit function and Abort function properties of the SYS
module. The default exit function is UTL_halt. The default abort function is
_UTL_doAbort, which logs an error message and calls _halt. The _halt
function is defined in the boot.c file; it loops infinitely with all processor
interrupts disabled.
SYS_abort accepts a format string plus an optional set of data values
(presumably representing a diagnostic message), which it passes to the
function specified for the Abort function property of the SYS module as shown
in Example 5-10.
Void SYS_exit(status)
Int status;
Void SYS_abort(format, [arg,] ...)
String format;
Arg arg;
Page view 196
1 2 ... 192 193 194 195 196 197 198 199 200 201 202 ... 275 276

Comments to this Manuals

No comments