Move the logic to get TLS information from an inline function to a normal function. For the unaligned case, it is probably too large to be inlined.
Also fixes some minor things from review of previous commits.
CONFIG_TLS_ALIGNED will select the (legacy) aligned stack implementation of TLS. If CONFIG_TLS_ALIGNED is not defined, then the new, implementation of TLS using an unaligned stack will be enabled.
The "info" structure was used non initialized and causing bad sounds at
boot. The start() function is anyway called later on when actually playing
sounds.
rdrand was checking the wrong return value for the intrinsics
so it would block forever. The read function was also not returning
the actual number of bytes read.
This was tested by running the rand example application
NuttShell (NSH) NuttX-9.0.0
nsh>rand
Reading 8 random numbers
Random values (0x101584f70):
0000: 019a172df7d539f2df8550362e2d3f74 9b467c51ebe30b9f6510e540e34fabcc ...-..9...P6.-?t .F|Q....e..@.O..
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Something change on the GitHub side that has broken credentials
between the the fetch and buld workflow steps. There is no
way to tell the checkout action to only re-auth so we have it
checkout the repo again, but it will use what it already has.
In the future we can change fetch step to just compute the
target refs and store them in a script that we can call to
set the environment variables for the targets much like
this patch.
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
There is a DEBUGPANIC in some logic. This happens if a a task exists at certain points with priority inheritance enabled. This event was not expected in the original design (although logic was provided to support it). Since, apparently, it does happen, the DEBUGPANIC must be removed.
Noted by Brennan Ashton.
The sched_get_stackinfo() interface was just added. However, it occurs to me that it is a dangerous feature and could lead to security problems. In FLAT and PROTECTED modes, if you get access to any other threads stack, you could do harm.
This commit adds some level of security. Basically, it implements these rules:
1. Any thread may query its own stack,
2. A kernel thread may query the stack of any other thread
3. Application threads, however, may query only the stacks of threads within the same task group, i.e., the main thread and any of the child pthreads created with the main thread as a parent or grandparent or great-grandpart ...
The new OS interface, sched_get_stackinfo() combines two pthread-specific interfaces into a single generic interface. The existing pthread_get_stackaddr_np() and pthread_get_stacksize_np() are moved from sched/pthread to libs/libc/pthread.
There are two motivations for this change: First, it reduces the number of system calls. Secondly, it adds a common hook that is going to used for a future implementation of TLS.