FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2006 Threads] AT9140008 - ulcriticalNestingPosted by Nobody/Anonymous on July 4, 2006 In the portSAVE_CONTEXT macro, What does the statement do? ( void ) ulCriticalNesting;
Also, ulCriticalNesting - this variable is used to keep track of how many times we have entered in a crtical area and not exited yet. One of the actions that is done in the enter Critical is to disable interrupts by manipulating I and F bits. All thru the code, this variable is manipulated by using portENTER_CRITICAL and portEXIT_CRITICAl - which are called as a pair. When does this variable get incremented without being decremented in the code?
An example would help?
Thanks
RE: AT9140008 - ulcriticalNestingPosted by Richard on July 4, 2006 >In the portSAVE_CONTEXT macro, What does the >statement do? >( void ) ulCriticalNesting;
Stops compiler warnings. Nothing else.
>When does this variable get incremented without >being decremented in the code
They must always get called in pairs, but it is possible for the calls to be nested. Therefore calling EXIT_CRITICAL() will not necessarily result in the variable being set back to zero.
The reason the critical nesting is stored as part of the task context is because each task maintains its own interrupt status. It is possible to yield from a critical section to a task that has interrupts enabled. The reason you might want to do this is if you want to guarantee that interrupts are disabled when the task that yielded next executes.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|