Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make taskYIELD available to unprivileged tasks #817

Merged
merged 10 commits into from
Oct 6, 2023
6 changes: 6 additions & 0 deletions portable/ARMv8M/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/ARMv8M/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM23/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM23/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM23_NTZ/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM23_NTZ/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM33/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM33/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM33_NTZ/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM33_NTZ/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM35P/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM35P/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM35P_NTZ/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM35P_NTZ/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM55/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM55/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM55_NTZ/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM55_NTZ/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM85/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM85/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/GCC/ARM_CM85_NTZ/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
10 changes: 9 additions & 1 deletion portable/GCC/ARM_CM85_NTZ/non_secure/portmacrocommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,20 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
#define portSVC_SYSTEM_CALL_ENTER 4 /* System calls with upto 4 parameters. */
#define portSVC_SYSTEM_CALL_ENTER_1 5 /* System calls with 5 parameters. */
#define portSVC_SYSTEM_CALL_EXIT 6
#define portSVC_YIELD 7
/*-----------------------------------------------------------*/

/**
* @brief Scheduler utilities.
*/
#define portYIELD() vPortYield()
#if ( configENABLE_MPU == 1 )
#define portYIELD() __asm volatile ( "svc %0" ::"i" ( portSVC_YIELD ) : "memory" )
#define portYIELD_WITHIN_API() vPortYield()
#else
#define portYIELD() vPortYield()
#define portYIELD_WITHIN_API() vPortYield()
#endif

#define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) )
#define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
Expand Down
6 changes: 6 additions & 0 deletions portable/IAR/ARM_CM23/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
break;
#endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 1 ) */

#if ( configENABLE_MPU == 1 )
case portSVC_YIELD:
vPortYield();
break;
#endif /* configENABLE_MPU == 1 */

default:
/* Incorrect SVC call. */
configASSERT( pdFALSE );
Expand Down
Loading