mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-01 11:53:53 -04:00
Change xPortRaisePrivilege and vPortResetPrivilege to macros
This prevents non-kernel code from calling these functions. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
parent
78da9cb261
commit
7a3848753b
6 changed files with 341 additions and 235 deletions
|
@ -160,17 +160,14 @@ BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) );
|
|||
void vResetPrivilege( void ) __attribute__( ( naked ) );
|
||||
|
||||
/**
|
||||
* @brief Calls the port specific code to raise the privilege.
|
||||
*
|
||||
* @return pdFALSE if privilege was raised, pdTRUE otherwise.
|
||||
* @brief Enter critical section.
|
||||
*/
|
||||
extern BaseType_t xPortRaisePrivilege( void );
|
||||
void vPortEnterCritical( void ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/**
|
||||
* @brief If xRunningPrivileged is not pdTRUE, calls the port specific
|
||||
* code to reset the privilege, otherwise does nothing.
|
||||
* @brief Exit from critical section.
|
||||
*/
|
||||
extern void vPortResetPrivilege( BaseType_t xRunningPrivileged );
|
||||
void vPortExitCritical( void ) FREERTOS_SYSTEM_CALL;
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Each task maintains its own interrupt status in the critical nesting
|
||||
|
@ -483,7 +480,8 @@ void vPortEndScheduler( void )
|
|||
|
||||
void vPortEnterCritical( void )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = xPortRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged;
|
||||
xPortRaisePrivilege( xRunningPrivileged );
|
||||
|
||||
portDISABLE_INTERRUPTS();
|
||||
uxCriticalNesting++;
|
||||
|
@ -494,7 +492,8 @@ void vPortEnterCritical( void )
|
|||
|
||||
void vPortExitCritical( void )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = xPortRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged;
|
||||
xPortRaisePrivilege( xRunningPrivileged );
|
||||
|
||||
configASSERT( uxCriticalNesting );
|
||||
uxCriticalNesting--;
|
||||
|
|
|
@ -173,17 +173,14 @@ BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) );
|
|||
void vResetPrivilege( void ) __attribute__( ( naked ) );
|
||||
|
||||
/**
|
||||
* @brief Calls the port specific code to raise the privilege.
|
||||
*
|
||||
* @return pdFALSE if privilege was raised, pdTRUE otherwise.
|
||||
* @brief Enter critical section.
|
||||
*/
|
||||
extern BaseType_t xPortRaisePrivilege( void );
|
||||
void vPortEnterCritical( void ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
/**
|
||||
* @brief If xRunningPrivileged is not pdTRUE, calls the port specific
|
||||
* code to reset the privilege, otherwise does nothing.
|
||||
* @brief Exit from critical section.
|
||||
*/
|
||||
extern void vPortResetPrivilege( BaseType_t xRunningPrivileged );
|
||||
void vPortExitCritical( void ) FREERTOS_SYSTEM_CALL;
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Each task maintains its own interrupt status in the critical nesting
|
||||
|
@ -519,7 +516,8 @@ void vPortEndScheduler( void )
|
|||
|
||||
void vPortEnterCritical( void )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = xPortRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged;
|
||||
xPortRaisePrivilege( xRunningPrivileged );
|
||||
|
||||
portDISABLE_INTERRUPTS();
|
||||
uxCriticalNesting++;
|
||||
|
@ -530,7 +528,8 @@ void vPortEnterCritical( void )
|
|||
|
||||
void vPortExitCritical( void )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = xPortRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged;
|
||||
xPortRaisePrivilege( xRunningPrivileged );
|
||||
|
||||
configASSERT( uxCriticalNesting );
|
||||
uxCriticalNesting--;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue