module xdc.runtime.Main

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 ... ]
C synopsis target-domain sourced in xdc/runtime/Main.xdc
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

C synopsis target-domain
Types_ModuleId Main_Module_id();
// Get this module's unique id
 
Bool Main_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle Main_Module_heap();
// 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
 
XDCscript usage meta-domain sourced in xdc/runtime/Main.xdc
var Main = xdc.useModule('xdc.runtime.Main');
module-wide config parameters
 
 
metaonly config Main.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
Main.common$ = Types.Common$ undefined;
 
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.
generated on Thu, 01 Mar 2012 16:58:40 GMT