Configuration "stand-in" for application code
This module is used to enable "module" configuration of application code
that is not part of a module. Configuration of this
Main module is
used for all code not in a module.
[
more ... ]
#include <xdc/runtime/Main.h>
module-wide built-ins
XDCscript usage |
meta-domain |
var Main = xdc.useModule('xdc.runtime.Main');
module-wide config parameters
@Gated
module Main {
module-wide config parameters
}
DETAILS
This module is used to enable "module" configuration of application code
that is not part of a module. Configuration of this Main module is
used for all code not in a module.
For example, an ILogger "service provider" for all code that is not in
a RTSC module can be configured by setting this module's logger; when
code that is not in a module calls Log_print(), for example, this
module's ILogger handles the event.
Since this module is "gated", the user can also assign a gate to this
module for use by any code that is not in a module. This gate can be used
to serialize access to global data by multiple threads in the system.
#include <xdc/runtime/Main.h>
#include <xdc/runtime/Gate.h>
:
int global = 0;
int main() {
: // create a bunch of threads
}
void thread() {
IArg key = Gate_enterModule(); // enter critical section
global++; // safely update global data
Gate_leaveModule(key); // leave critical section
}
metaonly config Main.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.
module-wide built-ins |
|
// Get this module's unique id
Bool Main_Module_startupDone( );
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool Main_Module_hasMask( );
// Test whether this module has a diagnostics mask
Bits16 Main_Module_getMask( );
// Returns the diagnostics mask for this module
Void Main_Module_setMask( Bits16 mask );
// Set the diagnostics mask for this module
generated on Wed, 06 Jan 2010 18:40:43 GMT