mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 11:09:01 +01:00 
			
		
		
		
	Enable xTaskGetCurrentTaskHandleForCore() for single core builds (#978)
Enable xTaskGetCurrentTaskHandleForCore() for single core builds --------- Co-authored-by: Paul Bartell <pbartell@amazon.com> Co-authored-by: Ching-Hsin Lee <chinglee@amazon.com>
This commit is contained in:
		
							parent
							
								
									1189198a5e
								
							
						
					
					
						commit
						1c35cb3bc9
					
				@ -3574,9 +3574,7 @@ TaskHandle_t xTaskGetCurrentTaskHandle( void ) PRIVILEGED_FUNCTION;
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Return the handle of the task running on specified core.
 | 
					 * Return the handle of the task running on specified core.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#if ( configNUMBER_OF_CORES > 1 )
 | 
					TaskHandle_t xTaskGetCurrentTaskHandleForCore( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
 | 
				
			||||||
    TaskHandle_t xTaskGetCurrentTaskHandleForCore( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Shortcut used by the queue implementation to prevent unnecessary call to
 | 
					 * Shortcut used by the queue implementation to prevent unnecessary call to
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										36
									
								
								tasks.c
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								tasks.c
									
									
									
									
									
								
							@ -6559,24 +6559,28 @@ static void prvResetNextTaskUnblockTime( void )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            return xReturn;
 | 
					            return xReturn;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        TaskHandle_t xTaskGetCurrentTaskHandleForCore( BaseType_t xCoreID )
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            TaskHandle_t xReturn = NULL;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            traceENTER_xTaskGetCurrentTaskHandleForCore( xCoreID );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if( taskVALID_CORE_ID( xCoreID ) != pdFALSE )
 | 
					 | 
				
			||||||
            {
 | 
					 | 
				
			||||||
                xReturn = pxCurrentTCBs[ xCoreID ];
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            traceRETURN_xTaskGetCurrentTaskHandleForCore( xReturn );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            return xReturn;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
 | 
					    #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    TaskHandle_t xTaskGetCurrentTaskHandleForCore( BaseType_t xCoreID )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        TaskHandle_t xReturn = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        traceENTER_xTaskGetCurrentTaskHandleForCore( xCoreID );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if( taskVALID_CORE_ID( xCoreID ) != pdFALSE )
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            #if ( configNUMBER_OF_CORES == 1 )
 | 
				
			||||||
 | 
					                xReturn = pxCurrentTCB;
 | 
				
			||||||
 | 
					            #else /* #if ( configNUMBER_OF_CORES == 1 ) */
 | 
				
			||||||
 | 
					                xReturn = pxCurrentTCBs[ xCoreID ];
 | 
				
			||||||
 | 
					            #endif /* #if ( configNUMBER_OF_CORES == 1 ) */
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        traceRETURN_xTaskGetCurrentTaskHandleForCore( xReturn );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return xReturn;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
 | 
					#endif /* ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
 | 
				
			||||||
/*-----------------------------------------------------------*/
 | 
					/*-----------------------------------------------------------*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user