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>
Functions common to all target modules |
|
|
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
}
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
var Main = xdc.useModule('xdc.runtime.Main');
module-wide config parameters
generated on Fri, 25 Jun 2010 22:40:34 GMT