This module provides a implementation of the
ISystemSupport
interface that simply calls back the user defined functions to enable the
System module's functionality.
Configuration is as shown below.
var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
SysCallback.abortFxn = "&userAbort";
SysCallback.exitFxn = "&userExit";
SysCallback.flushFxn = "&userFlush";
SysCallback.putchFxn = "&userPutch";
SysCallback.readyFxn = "&userReady";
typedef SysCallback_AbortFxn |
|
Abort function signature
typedef Void (*SysCallback_AbortFxn)(CString);
typedef SysCallback_ExitFxn |
|
Exit function signature
typedef Void (*SysCallback_ExitFxn)(Int);
typedef SysCallback_FlushFxn |
|
Flush function signature
typedef Void (*SysCallback_FlushFxn)();
typedef SysCallback_PutchFxn |
|
Putch function signature
typedef Void (*SysCallback_PutchFxn)(Char);
typedef SysCallback_ReadyFxn |
|
Ready function signature
typedef Bool (*SysCallback_ReadyFxn)();
config SysCallback_abortFxn // module-wide |
|
User supplied abort function
DETAILS
This function is called when the application calls
System.abort() function. If the user supplied funtion
returns, the abort function of the ANSI C Standard library is called.
For more information see the
System.abort() documentation.
By default, this function is configured with a default abort function.
This default abort function spins forever and never returns.
config SysCallback_exitFxn // module-wide |
|
User supplied exit function
DETAILS
This function is called when the application calls
System.exit() function. If the user supplied function
returns, the ANSI C Standard Library atexit processing will be
completed. For more information see the
System.exit()
documentation.
By default, this function is configured with a default exit function.
The default exit function does nothing and returns.
config SysCallback_flushFxn // module-wide |
|
User supplied flush function
DETAILS
This function is called when the application calls
System.flush() function.
By default, this function is configured with a default flush function.
The default flush function does nothing and returns.
config SysCallback_putchFxn // module-wide |
|
User supplied character output function
DETAILS
This function is called whenever the
System module needs to output
a character; e.g., during
System.printf() or
System.putch().
By default, this function is configured with a default putch function.
The default putch function drops the characters.
config SysCallback_readyFxn // module-wide |
|
User supplied ready function
DETAILS
This function is called by the
System module prior to performing any
character output to check if the
SystemSupport module is ready to
accept the character. For more information see the
ISystemSupport.ready() documentation.
By default, this function is configured with a default ready function.
The default ready function returns TRUE always.
SysCallback_abort() // module-wide |
|
Backend for System.abort()
Void SysCallback_abort(CString str);
ARGUMENTS
str
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.
SysCallback_exit() // module-wide |
|
Backend for System.exit()
Void SysCallback_exit(Int stat);
ARGUMENTS
stat
status value passed to all "atexit" handlers
This value is passed to all "atexit" handles bound via
System.atexit().
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.
SEE
SysCallback_flush() // module-wide |
|
Backend for System.flush()
Void SysCallback_flush();
DETAILS
This function is simply called by
System_flush
to output any characters buffered by the underlying
SystemSupport
module to an output device.
SysCallback_putch() // module-wide |
|
Backend for System.printf() and System.putch()
Void SysCallback_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.
SysCallback_ready() // module-wide |
|
Test if character output can proceed
Bool SysCallback_ready();
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.
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool SysCallback_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool SysCallback_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 SysCallback_Module_getMask();
// Returns the diagnostics mask for this module
Void SysCallback_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
config SysCallback.abortFxn // module-wide |
|
User supplied abort function
SysCallback.abortFxn = Void(*)(CString) "&xdc_runtime_SysCallback_defaultAbort";
DETAILS
This function is called when the application calls
System.abort() function. If the user supplied funtion
returns, the abort function of the ANSI C Standard library is called.
For more information see the
System.abort() documentation.
By default, this function is configured with a default abort function.
This default abort function spins forever and never returns.
C SYNOPSIS
config SysCallback.exitFxn // module-wide |
|
User supplied exit function
SysCallback.exitFxn = Void(*)(Int) "&xdc_runtime_SysCallback_defaultExit";
DETAILS
This function is called when the application calls
System.exit() function. If the user supplied function
returns, the ANSI C Standard Library atexit processing will be
completed. For more information see the
System.exit()
documentation.
By default, this function is configured with a default exit function.
The default exit function does nothing and returns.
C SYNOPSIS
config SysCallback.flushFxn // module-wide |
|
User supplied flush function
SysCallback.flushFxn = Void(*)() "&xdc_runtime_SysCallback_defaultFlush";
DETAILS
This function is called when the application calls
System.flush() function.
By default, this function is configured with a default flush function.
The default flush function does nothing and returns.
C SYNOPSIS
config SysCallback.putchFxn // module-wide |
|
User supplied character output function
SysCallback.putchFxn = Void(*)(Char) "&xdc_runtime_SysCallback_defaultPutch";
DETAILS
This function is called whenever the
System module needs to output
a character; e.g., during
System.printf() or
System.putch().
By default, this function is configured with a default putch function.
The default putch function drops the characters.
C SYNOPSIS
config SysCallback.readyFxn // module-wide |
|
User supplied ready function
SysCallback.readyFxn = Bool(*)() "&xdc_runtime_SysCallback_defaultReady";
DETAILS
This function is called by the
System module prior to performing any
character output to check if the
SystemSupport module is ready to
accept the character. For more information see the
ISystemSupport.ready() documentation.
By default, this function is configured with a default ready function.
The default ready function returns TRUE always.
C SYNOPSIS
metaonly config SysCallback.common$ // module-wide |
|
Common module configuration parameters
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.