This implementation provides a fully functional implementation of
all methods specified by ISystemSupport.
The module maintains an internal buffer (with a configurable size)
that stores on the "output". When full, the data is over-written. When
System_flush() is called the characters in the internal buffer are
"output" using the user configuratble
outputFxn.
As with all
ISystemSupport modules, this module is the back-end for the
System module; application code does not directly call these
functions.
typedef SysMin.OutputFxn |
|
Output characters in the specified buffer
typedef Void (*SysMin_OutputFxn)(Char*,UInt);
DETAILS
The first parameter is a pointer to a buffer of characters to be
output. The second parameter is the number of characters in the
buffer to output.
This function may be called with 0 as the second parameter. In this
case, the function should simply return.
metaonly struct SysMin.BufferEntryView |
|
XDCscript usage |
meta-domain |
var obj = new SysMin.BufferEntryView;
obj.entry = String ...
metaonly struct SysMin.ModuleView |
|
XDCscript usage |
meta-domain |
var obj = new SysMin.ModuleView;
obj.outBuf = Ptr ...
obj.outBufIndex = UInt ...
obj.wrapped = Bool ...
config SysMin.bufSize // module-wide |
|
Size (in MAUs) of the output
XDCscript usage |
meta-domain |
SysMin.bufSize = SizeT 1024;
extern const SizeT SysMin_bufSize;
DETAILS
An internal buffer of this size is allocated. All output is stored
in this internal buffer.
If 0 is specified for the size, no buffer is created.
config SysMin.flushAtExit // module-wide |
|
Flush the internal buffer during exit or abort
XDCscript usage |
meta-domain |
SysMin.flushAtExit = Bool true;
extern const Bool SysMin_flushAtExit;
DETAILS
If the application's target is a TI target, the internal buffer is
flushed via the HOSTwrite function in the TI C Run Time Support
(RTS) library.
If the application's target is not a TI target, the internal buffer
is flushed to stdout via fwrite(..., stdout).
Setting this parameter to false reduces the footprint of the
application at the expense of not getting output when the application
ends via a System_exit(), System_abort(), exit() or abort().
config SysMin.outputFxn // module-wide |
|
User suplied character output function
XDCscript usage |
meta-domain |
SysMin.outputFxn = Void(*)(Char*,UInt) null;
DETAILS
If this parameter is set to a non-null value, the specified
function will be called by to output characters buffered within
SysMin.
For example, if you define a function named myOutputFxn, the
following configuration fragment will cause SysMin to call
myOutputFxn whenever the character buffer is flushed.
var SysMin = xdc.useModule("xdc.runtime.SysMin");
SysMin.outputFxn = "&myOutputFxn";
If this parameter is not set, a default function will be used which
uses the ANSI C Standard Library function fwrite() (or HOSTwrite
in the TI C Run Time Support library) to output
accumulated output characters.
SEE
metaonly config SysMin.common$ // module-wide |
|
Common module configuration parameters
XDCscript usage |
meta-domain |
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
metaonly config SysMin.sectionName // module-wide |
|
Section where the internal character output buffer is placed
XDCscript usage |
meta-domain |
SysMin.sectionName = String null;
DETAILS
The default is to have no explicit placement; i.e., the linker is
free to place it anywhere in the memory map.
SysMin.abort( ) // module-wide |
|
Backend for System.abort()
Void SysMin_abort( String str );
ARGUMENTS
str
message to output just prior to aborting
If non-NULL, this string should be output just prior to
terminating.
message to output just prior to aborting
If non-NULL, this string should be output just prior to
terminating.
DETAILS
This function is called by
System.abort() prior to calling
the ANSI C Standard library function
abort(). So, to ensure the
abort processing of the system's ANSI C Standard library completes,
this function should return to its caller.
This abort function writes the string to the internal
output buffer and then gives all internal output to the
outputFxn function if the
flushAtExit
configuration parameter is true.
SEE
SysMin.exit( ) // module-wide |
|
Backend for System.exit()
Void SysMin_exit( Int stat );
ARGUMENTS
stat
status value passed to all "atexit" handlers
This value is passed to all "atexit" handles bound via
System.atexit(). If the application exits via the
ANSI C Standard
exit() function rather than via System_exit(),
stat will be equal to
System.STATUS_UNKNOWN.
DETAILS
This function is called as part the normal "atexit" processing
performed by the ANSI C Standard Library's
exit() function;
System.exit() directly calls ANSI
exit().
This function is called after all "atexit" handlers bound via
System.atexit() are run and it
is always called while "inside" the the
System gate.
To ensure that all exit processing of the system's ANSI C
Standard Library completes, this function should return to its caller.
Exit handlers bound using the ANSI C Standard Library atexit()
function may run before or after this function.
This exit function gives all internal output to the
outputFxn function if the
flushAtExit
configuration parameter is true.
SEE
SysMin.flush( ) // module-wide |
|
Backend for System.flush()
DETAILS
This function is simply called by
System_flush
to output any characters buffered by the underlying
SystemSupport
module to an output device.
The
flush writes the contents of the internal character buffer
via the
outputFxn function.
WARNING
The
System gate is used for thread safety during the
entire flush operation, so care must be taken when flushing with
this
ISystemSupport module. Depending on the nature of the
System gate, your application's interrupt latency
may become a function of the
bufSize parameter!
SEE
SysMin.putch( ) // module-wide |
|
Backend for System.printf() and System.putch()
Void SysMin_putch( Char ch );
ARGUMENTS
ch
character to output
DETAILS
Output a single character. This function is called by
System_printf() to write each character
of formated output specified by its arguments.
Places the character into an internal buffer. The
flush
sends the internal buffer to the
outputFxn function.
The internal buffer is also sent to the
SysMin_outputFxn
function by
exit and
abort if the
flushAtExit configuration parameter is true.
SEE
SysMin.ready( ) // module-wide |
|
Test if character output can proceed
DETAILS
This function is called by
System prior to performing
any character output . If this function returns
FALSE, the
System
functions that would normally call
putch() simply return
(with an appropriate error status) without ever calling
putch.
This function returns true if the internal buffer is non-zero.
SEE
module-wide built-ins |
|
// Get this module's unique id
Bool SysMin_Module_startupDone( );
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool SysMin_Module_hasMask( );
// Test whether this module has a diagnostics mask
Bits16 SysMin_Module_getMask( );
// Returns the diagnostics mask for this module
Void SysMin_Module_setMask( Bits16 mask );
// Set the diagnostics mask for this module