module ti.sysbios.rts.gnu.ReentSupport

Newlib RTS library re-entrancy support module

The Reentrancy Support module implements locking APIs for the Newlib libraries and provides an overloaded implementation of the library's __getreent() function to make the C runtime library calls re-entrant and thread safe. [ more ... ]
C synopsis target-domain sourced in ti/sysbios/rts/gnu/ReentSupport.xdc
DETAILS
The Reentrancy Support module implements locking APIs for the Newlib libraries and provides an overloaded implementation of the library's __getreent() function to make the C runtime library calls re-entrant and thread safe.
The C runtime library (newlib libc/libm) functions internally call __getreent() to get the address of the currently executing thread's reentrancy structure.
The __getreent() function allocates storage for the reentrancy structure when it is called for the very first time within a thread context. Any subsequent calls to __getreent() within the same thread context read the current thread's stored context to determine the previously allocated reentrancy structure's address and return it.
When a thread is deleted, the DeleteHook is called and will free any memory that was allocated to store the reentrancy structure associated with the thread.
The C runtime library calls locking APIs to ensure thread safety. The locking APIs are defined in the sys/lock.h header that is distributed with XDC tools. This module provides an implementation for these locking APIs.
Reentrancy support is enabled by default if tasking is enabled and can be disabled by adding the following code to the application's config script.
  var ReentSupport = xdc.useModule('ti.sysbios.rts.gnu.ReentSupport');

  // 'true' to enable Task level reentrancy support (default)
  // 'false' to disable Task level reentrancy support
  ReentSupport.enableReentSupport = false;
Note: Calling C runtime functions from SWI and HWI threads is not supported and will generate an exception if reentrancy support is enabled.
 
config ReentSupport_A_badThreadType  // module-wide

Asserted in ReentSupport_getReent()

C synopsis target-domain
extern const Assert_Id ReentSupport_A_badThreadType;
 
 
config ReentSupport_enableReentSupport  // module-wide

Enable re-entrancy support

C synopsis target-domain
extern const Bool ReentSupport_enableReentSupport;
 
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId ReentSupport_Module_id();
// Get this module's unique id
 
Bool ReentSupport_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle ReentSupport_Module_heap();
// The heap from which this module allocates memory
 
Bool ReentSupport_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 ReentSupport_Module_getMask();
// Returns the diagnostics mask for this module
 
Void ReentSupport_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
 
Configuration settings sourced in ti/sysbios/rts/gnu/ReentSupport.xdc
var ReentSupport = xdc.useModule('ti.sysbios.rts.gnu.ReentSupport');
module-wide config parameters
        msg: "A_badThreadType: Cannot call a C runtime library API from a Hwi or Swi thread."
    };
 
 
 
config ReentSupport.A_badThreadType  // module-wide

Asserted in ReentSupport_getReent()

Configuration settings
ReentSupport.A_badThreadType = Assert.Desc {
    msg: "A_badThreadType: Cannot call a C runtime library API from a Hwi or Swi thread."
};
 
C SYNOPSIS
 
config ReentSupport.enableReentSupport  // module-wide

Enable re-entrancy support

Configuration settings
ReentSupport.enableReentSupport = Bool true;
 
C SYNOPSIS
 
metaonly config ReentSupport.common$  // module-wide

Common module configuration parameters

Configuration settings
ReentSupport.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, 25 May 2017 22:10:20 GMT