]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/include/task.h
Add event_groups.c and associated functions in other core files.
[freertos] / FreeRTOS / Source / include / task.h
index ba7b32d7b765451069d91ad528b087ad084922c3..d7330a974e306cd3c91779e649b96b4879e8d3a3 100644 (file)
@@ -1378,15 +1378,26 @@ portBASE_TYPE xTaskIncrementTick( void ) PRIVILEGED_FUNCTION;
  * there be no higher priority tasks waiting on the same event) or\r
  * the delay period expires.\r
  *\r
+ * The 'unordered' version replaces the event list item value with the \r
+ * xItemValue value, and inserts the list item at the end of the list.\r
+ *\r
+ * The 'ordered' version uses the existing event list item value (which is the\r
+ * owning tasks priority) to insert the list item into the event list is task\r
+ * priority order.\r
+ *\r
  * @param pxEventList The list containing tasks that are blocked waiting\r
  * for the event to occur.\r
  *\r
+ * @param xItemValue The item value to use for the event list item when the\r
+ * event list is not ordered by task priority.\r
+ *\r
  * @param xTicksToWait The maximum amount of time that the task should wait\r
  * for the event to occur.  This is specified in kernel ticks,the constant\r
  * portTICK_RATE_MS can be used to convert kernel ticks into a real time\r
  * period.\r
  */\r
 void vTaskPlaceOnEventList( xList * const pxEventList, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
+void vTaskPlaceOnUnorderedEventList( xList * pxEventList, portTickType xItemValue, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE.  IT IS AN\r
@@ -1412,13 +1423,23 @@ void vTaskPlaceOnEventListRestricted( xList * const pxEventList, portTickType xT
  * Removes a task from both the specified event list and the list of blocked\r
  * tasks, and places it on a ready queue.\r
  *\r
- * xTaskRemoveFromEventList () will be called if either an event occurs to\r
- * unblock a task, or the block timeout period expires.\r
+ * xTaskRemoveFromEventList()/xTaskRemoveFromUnorderedEventList() will be called \r
+ * if either an event occurs to unblock a task, or the block timeout period \r
+ * expires.\r
+ *\r
+ * xTaskRemoveFromEventList() is used when the event list is in task priority\r
+ * order.  It removes the list item from the head of the event list as that will\r
+ * have the highest priority owning task of all the tasks on the event list.\r
+ * xTaskRemoveFromUnorderedEventList() is used when the event list is not\r
+ * ordered and the event list items hold something other than the owning tasks\r
+ * priority.  In this case the event list item value is updated to the value\r
+ * passed in the xItemValue parameter.\r
  *\r
  * @return pdTRUE if the task being removed has a higher priority than the task\r
  * making the call, otherwise pdFALSE.\r
  */\r
 signed portBASE_TYPE xTaskRemoveFromEventList( const xList * const pxEventList ) PRIVILEGED_FUNCTION;\r
+signed portBASE_TYPE xTaskRemoveFromUnorderedEventList( xListItem * pxEventListItem, portTickType xItemValue ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE.  IT IS ONLY\r
@@ -1430,6 +1451,12 @@ signed portBASE_TYPE xTaskRemoveFromEventList( const xList * const pxEventList )
  */\r
 void vTaskSwitchContext( void ) PRIVILEGED_FUNCTION;\r
 \r
+/*\r
+ * THESE FUNCTIONS MUST NOT BE USED FROM APPLICATION CODE.  THEY ARE USED BY\r
+ * THE EVENT BITS MODULE.\r
+ */\r
+portTickType uxTaskResetEventItemValue( void ) PRIVILEGED_FUNCTION;\r
+\r
 /*\r
  * Return the handle of the calling task.\r
  */\r
@@ -1479,13 +1506,13 @@ signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed ch
 /*\r
  * Get the uxTCBNumber assigned to the task referenced by the xTask parameter.\r
  */\r
-unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask );\r
+unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Set the uxTCBNumber of the task referenced by the xTask parameter to\r
  * ucHandle.\r
  */\r
-void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );\r
+void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * If tickless mode is being used, or a low power mode is implemented, then\r
@@ -1494,7 +1521,7 @@ void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );
  * to date with the actual execution time by being skipped forward by the by\r
  * a time equal to the idle period.\r
  */\r
-void vTaskStepTick( portTickType xTicksToJump );\r
+void vTaskStepTick( portTickType xTicksToJump ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port\r
@@ -1509,7 +1536,7 @@ void vTaskStepTick( portTickType xTicksToJump );
  * critical section between the timer being stopped and the sleep mode being\r
  * entered to ensure it is ok to proceed into the sleep mode.\r
  */\r
-eSleepModeStatus eTaskConfirmSleepModeStatus( void );\r
+eSleepModeStatus eTaskConfirmSleepModeStatus( void ) PRIVILEGED_FUNCTION;\r
 \r
 #ifdef __cplusplus\r
 }\r