nanokernel: tighten _is_thread_essential()

Of the 3 related functions;
  _thread_essential_set()
  _thread_essential_clear()
  _is_thread_essential()

The first two are parameter-less and always operate on
"_nanokernel.current". The last one takes a 'thread' parameter but will
operate on _nanokernel.current if the parameter is NULL. All calls to
_is_thread_essential() pass NULL!

This change makes the 3 functions consistent by removing the parameter
to the 3rd function. This should also be marginally more efficient,
though consistency was the motivation. This change corrects the doc
preamble to all 3 functions.

(These functions would probably be better as inlines. Also, the choice
of when to use wrappers seems a bit arbitrary. E.g. there's nothing
for setting/testing the "FIBER" flag.)

Change-Id: Ie3589f8a28b227c6d7a3a31b664d3b3e6e9c6d17
Signed-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>
This commit is contained in:
Geoff Thorpe 2016-04-18 08:28:45 -05:00 committed by Benjamin Walsh
commit ded3070c1c
5 changed files with 12 additions and 15 deletions

View file

@ -74,7 +74,7 @@ void _SysFatalErrorHandler(unsigned int reason, const NANO_ESF * pEsf)
ARG_UNUSED(reason);
ARG_UNUSED(pEsf);
if ((curCtx == NANO_CTX_ISR) || _is_thread_essential(NULL)) {
if ((curCtx == NANO_CTX_ISR) || _is_thread_essential()) {
PRINTK("Fatal fault in %s ! Spinning...\n",
NANO_CTX_ISR == curCtx
? "ISR"