]> begriffs open source - freertos/commit
Change the xRunningPrivileged check from "!=true" to "==false" (#109)
authorGaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Fri, 31 Jul 2020 02:32:31 +0000 (19:32 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Jul 2020 02:32:31 +0000 (19:32 -0700)
commit4383c8fae30c8a44c9fe07b7cef3b86f0c5cd72b
tree5e96aaeaa7184dee9b169056a885a33ad65e0487
parent676d99e302e75342a0645232eef16ed536c98434
Change the xRunningPrivileged check from "!=true" to "==false" (#109)

The expected behaviour of portIS_PRIVILEGED is:
- return 0 if the processor is not running privileged.
- return 1 if the processor is running privileged.

Some TI ports do not return 1 when the processor is running privileged
causing the following check to fail: if( xRunningPrivileged != pdTRUE )

This commit change the check to: if( xRunningPrivileged == pdFALSE ). It
ensures that the check is successful even on the ports which return incorrect
value from portIS_PRIVILEGED when the processor is running privileged.

See https://forums.freertos.org/t/kernel-bug-nested-mpu-wrapper-calls-generate-an-exception/10391

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
portable/Common/mpu_wrappers.c