/*\r
- * FreeRTOS Kernel V10.2.0\r
- * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r
+ * FreeRTOS Kernel V10.3.0\r
+ * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\r
*\r
* Permission is hereby granted, free of charge, to any person obtaining a copy of\r
* this software and associated documentation files (the "Software"), to deal in\r
}\r
/*-----------------------------------------------------------*/\r
\r
-uint32_t ulSetInterruptMaskFromISR( void ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */\r
+uint32_t ulSetInterruptMask( void ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */\r
{\r
__asm volatile\r
(\r
- " mrs r0, PRIMASK \n"\r
- " cpsid i \n"\r
- " bx lr \n"\r
- ::: "memory"\r
+ " mrs r0, basepri \n" /* r0 = basepri. Return original basepri value. */\r
+ " mov r1, %0 \n" /* r1 = configMAX_SYSCALL_INTERRUPT_PRIORITY. */\r
+ " msr basepri, r1 \n" /* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */\r
+ " dsb \n"\r
+ " isb \n"\r
+ " bx lr \n" /* Return. */\r
+ :: "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) : "memory"\r
);\r
-\r
-#if !defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
- /* To avoid compiler warnings. The return statement will never be reached,\r
- * but some compilers warn if it is not included, while others won't compile\r
- * if it is. */\r
- return 0;\r
-#endif\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vClearInterruptMaskFromISR( __attribute__( ( unused ) ) uint32_t ulMask ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */\r
+void vClearInterruptMask( __attribute__( ( unused ) ) uint32_t ulMask ) /* __attribute__(( naked )) PRIVILEGED_FUNCTION */\r
{\r
__asm volatile\r
(\r
- " msr PRIMASK, r0 \n"\r
- " bx lr \n"\r
+ " msr basepri, r0 \n" /* basepri = ulMask. */\r
+ " dsb \n"\r
+ " isb \n"\r
+ " bx lr \n" /* Return. */\r
::: "memory"\r
);\r
-\r
-#if !defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)\r
- /* Just to avoid compiler warning. ulMask is used from the asm code but\r
- * the compiler can't see that. Some compilers generate warnings without\r
- * the following line, while others generate warnings if the line is\r
- * included. */\r
- ( void ) ulMask;\r
-#endif\r
}\r
/*-----------------------------------------------------------*/\r
\r
" ldr r1, [r2] \n" /* Read pxCurrentTCB. */\r
" str r0, [r1] \n" /* Save the new top of stack in TCB. */\r
" \n"\r
- " cpsid i \n"\r
+ " mov r0, %0 \n" /* r0 = configMAX_SYSCALL_INTERRUPT_PRIORITY */\r
+ " msr basepri, r0 \n" /* Disable interrupts upto configMAX_SYSCALL_INTERRUPT_PRIORITY. */\r
+ " dsb \n"\r
+ " isb \n"\r
" bl vTaskSwitchContext \n"\r
- " cpsie i \n"\r
+ " mov r0, #0 \n" /* r0 = 0. */\r
+ " msr basepri, r0 \n" /* Enable interrupts. */\r
" \n"\r
" ldr r2, pxCurrentTCBConst \n" /* Read the location of pxCurrentTCB i.e. &( pxCurrentTCB ). */\r
" ldr r1, [r2] \n" /* Read pxCurrentTCB. */\r
"xRNRConst: .word 0xe000ed98 \n"\r
"xRBARConst: .word 0xe000ed9c \n"\r
#endif /* configENABLE_MPU */\r
+ :: "i"( configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
);\r
}\r
/*-----------------------------------------------------------*/\r