#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks\r
#define vTaskList MPU_vTaskList\r
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats\r
- #define vTaskStartTrace MPU_vTaskStartTrace\r
- #define ulTaskEndTrace MPU_ulTaskEndTrace\r
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag\r
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag\r
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook\r
*/\r
void vTaskGetRunTimeStats( signed char *pcWriteBuffer ) PRIVILEGED_FUNCTION;\r
\r
-/**\r
- * task. h\r
- * <PRE>void vTaskStartTrace( char * pcBuffer, unsigned portBASE_TYPE uxBufferSize );</PRE>\r
- *\r
- * Starts a real time kernel activity trace. The trace logs the identity of\r
- * which task is running when.\r
- *\r
- * The trace file is stored in binary format. A separate DOS utility called\r
- * convtrce.exe is used to convert this into a tab delimited text file which\r
- * can be viewed and plotted in a spread sheet.\r
- *\r
- * @param pcBuffer The buffer into which the trace will be written.\r
- *\r
- * @param ulBufferSize The size of pcBuffer in bytes. The trace will continue\r
- * until either the buffer in full, or ulTaskEndTrace () is called.\r
- *\r
- * \page vTaskStartTrace vTaskStartTrace\r
- * \ingroup TaskUtils\r
- */\r
-void vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize ) PRIVILEGED_FUNCTION;\r
-\r
-/**\r
- * task. h\r
- * <PRE>unsigned long ulTaskEndTrace( void );</PRE>\r
- *\r
- * Stops a kernel activity trace. See vTaskStartTrace ().\r
- *\r
- * @return The number of bytes that have been written into the trace buffer.\r
- *\r
- * \page usTaskEndTrace usTaskEndTrace\r
- * \ingroup TaskUtils\r
- */\r
-unsigned long ulTaskEndTrace( void ) PRIVILEGED_FUNCTION;\r
-\r
/**\r
* task.h\r
* <PRE>unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask );</PRE>\r
#define configKERNEL_INTERRUPT_PRIORITY 255\r
#endif\r
\r
-#if configMAX_SYSCALL_INTERRUPT_PRIORITY == 0\r
- #error configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html\r
-#endif\r
-\r
/* Constants required to manipulate the NVIC. */\r
#define portNVIC_SYSTICK_CTRL ( ( volatile unsigned long *) 0xe000e010 )\r
#define portNVIC_SYSTICK_LOAD ( ( volatile unsigned long *) 0xe000e014 )\r
*/\r
portBASE_TYPE xPortStartScheduler( void )\r
{\r
+ /* configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. \r
+ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */\r
+ configASSERT( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
+\r
/* Make PendSV, CallSV and SysTick the same priroity as the kernel. */\r
*(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;\r
*(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest information, \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest information,\r
license and contact details.\r
- \r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
#include "task.h"\r
#include "queue.h"\r
\r
-#if configMAX_SYSCALL_INTERRUPT_PRIORITY == 0\r
- #error configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html\r
-#endif\r
-\r
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
\r
/* Constants required to access and manipulate the NVIC. */\r
unsigned portBASE_TYPE MPU_uxTaskGetNumberOfTasks( void );\r
void MPU_vTaskList( signed char *pcWriteBuffer );\r
void MPU_vTaskGetRunTimeStats( signed char *pcWriteBuffer );\r
-void MPU_vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize );\r
-unsigned long MPU_ulTaskEndTrace( void );\r
void MPU_vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxTagValue );\r
pdTASK_HOOK_CODE MPU_xTaskGetApplicationTaskTag( xTaskHandle xTask );\r
portBASE_TYPE MPU_xTaskCallApplicationTaskHook( xTaskHandle xTask, void *pvParameter );\r
#else\r
" mrs r0, psp \n"\r
#endif\r
- " b prvSVCHandler \n"\r
- :::"r0"\r
+ " b %0 \n"\r
+ ::"i"(prvSVCHandler):"r0"\r
);\r
-\r
- /* This will never get executed, but is required to prevent prvSVCHandler\r
- being removed by the optimiser. */\r
- prvSVCHandler( NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
*/\r
portBASE_TYPE xPortStartScheduler( void )\r
{\r
- /* Make PendSV and SysTick the same priroity as the kernel. */\r
+ /* configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See\r
+ http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */\r
+ configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) );\r
+\r
+ /* Make PendSV and SysTick the same priority as the kernel. */\r
*(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;\r
*(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;\r
\r
#endif\r
/*-----------------------------------------------------------*/\r
\r
-#if ( configUSE_TRACE_FACILITY == 1 )\r
- void MPU_vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize )\r
- {\r
- portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
-\r
- vTaskStartTrace( pcBuffer, ulBufferSize );\r
- portRESET_PRIVILEGE( xRunningPrivileged );\r
- }\r
-#endif\r
-/*-----------------------------------------------------------*/\r
-\r
-#if ( configUSE_TRACE_FACILITY == 1 )\r
- unsigned long MPU_ulTaskEndTrace( void )\r
- {\r
- unsigned long ulReturn;\r
- portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
-\r
- ulReturn = ulTaskEndTrace();\r
- portRESET_PRIVILEGE( xRunningPrivileged );\r
- return ulReturn;\r
- }\r
-#endif\r
-/*-----------------------------------------------------------*/\r
-\r
#if ( configUSE_APPLICATION_TASK_TAG == 1 )\r
void MPU_vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxTagValue )\r
{\r
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
\r
vQueueDelete( xQueue );\r
- \r
+\r
portRESET_PRIVILEGE( xRunningPrivileged );\r
}\r
/*-----------------------------------------------------------*/\r
#error This port can only be used when the project options are configured to enable hardware floating point support.\r
#endif\r
\r
-#if configMAX_SYSCALL_INTERRUPT_PRIORITY == 0\r
- #error configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html\r
-#endif\r
-\r
/* Constants required to manipulate the NVIC. */\r
#define portNVIC_SYSTICK_CTRL ( ( volatile unsigned long * ) 0xe000e010 )\r
#define portNVIC_SYSTICK_LOAD ( ( volatile unsigned long * ) 0xe000e014 )\r
*/\r
portBASE_TYPE xPortStartScheduler( void )\r
{\r
+ /* configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. \r
+ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */\r
+ configASSERT( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
+\r
/* Make PendSV and SysTick the lowest priority interrupts. */\r
*(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;\r
*(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;\r
\r
/*-----------------------------------------------------------*/\r
\r
-void prvReadGp( unsigned long *ulValue )\r
-{ \r
- asm( "stw gp, (r4) " );\r
-};\r
+static void prvReadGp( unsigned long *ulValue )\r
+{\r
+ asm( "stw gp, (%0)" :: "r"(ulValue) );\r
+}\r
/*-----------------------------------------------------------*/\r
\r
/* \r
compiler does not fully support inline assembler we have to make a call.*/\r
vPortStart();\r
\r
-\r
/* Should not get here! */\r
return pdTRUE;\r
}\r
heap_4.c for alternative implementations, and the memory management pages of \r
http://www.FreeRTOS.org for more information. */\r
( void ) pv;\r
+ \r
+ /* Force an assert as it is invalid to call this function. */\r
+ configASSERT( pv == NULL );\r
}\r
/*-----------------------------------------------------------*/\r
\r
#include "FreeRTOS.h"\r
#include "task.h"\r
\r
-#if configMAX_SYSCALL_INTERRUPT_PRIORITY == 0\r
- #error configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html\r
-#endif\r
-\r
/* Constants required to manipulate the NVIC. */\r
#define portNVIC_SYSTICK_CTRL ( ( volatile unsigned long * ) 0xe000e010 )\r
#define portNVIC_SYSTICK_LOAD ( ( volatile unsigned long * ) 0xe000e014 )\r
*/\r
portBASE_TYPE xPortStartScheduler( void )\r
{\r
+ /* configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0.\r
+ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */\r
+ configASSERT( ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) );\r
+\r
/* Make PendSV and SysTick the lowest priority interrupts. */\r
*(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;\r
*(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;\r
tskTCB * pxNewTCB;\r
\r
configASSERT( pxTaskCode );\r
- configASSERT( ( uxPriority < configMAX_PRIORITIES ) );\r
+ configASSERT( ( ( uxPriority & ( ~portPRIVILEGE_BIT ) ) < configMAX_PRIORITIES ) );\r
\r
/* Allocate the memory required by the TCB and stack for the new task,\r
checking that the allocation was successful. */\r