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 ... ]
#include <ti/sysbios/rts/gnu/ReentSupport.h>
Functions common to all target modules |
|
|
Constants |
| |
extern const Bool | |
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 in the version of Newlib
distributed with SYS/BIOS. 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()
extern const Assert_Id ReentSupport_A_badThreadType;
config ReentSupport_enableReentSupport // module-wide |
 |
Enable re-entrancy support
extern const Bool ReentSupport_enableReentSupport;
Module-Wide Built-Ins |
 |
// Get this module's unique id
Bool ReentSupport_Module_startupDone();
// Test if this module has completed startup
// 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
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."
};
generated on Sat, 19 Sep 2020 02:07:24 GMT