ThirdParty/bsp/freertos10_xilinx/src/Source/portable/GCC/ARM_CA53/port.c
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
{
	/* Setup the initial stack of the task.  The stack is set exactly as
	expected by the portRESTORE_CONTEXT() macro. */

	/* First all the general purpose registers. */
	pxTopOfStack--;
	*pxTopOfStack = 0x0101010101010101ULL;	/* R1 */
	pxTopOfStack--;
	*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0303030303030303ULL;	/* R3 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0202020202020202ULL;	/* R2 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0505050505050505ULL;	/* R5 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0404040404040404ULL;	/* R4 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0707070707070707ULL;	/* R7 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0606060606060606ULL;	/* R6 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0909090909090909ULL;	/* R9 */
	pxTopOfStack--;
	*pxTopOfStack = 0x0808080808080808ULL;	/* R8 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1111111111111111ULL;	/* R11 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1010101010101010ULL;	/* R10 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1313131313131313ULL;	/* R13 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1212121212121212ULL;	/* R12 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1515151515151515ULL;	/* R15 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1414141414141414ULL;	/* R14 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1717171717171717ULL;	/* R17 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1616161616161616ULL;	/* R16 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1919191919191919ULL;	/* R19 */
	pxTopOfStack--;
	*pxTopOfStack = 0x1818181818181818ULL;	/* R18 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2121212121212121ULL;	/* R21 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2020202020202020ULL;	/* R20 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2323232323232323ULL;	/* R23 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2222222222222222ULL;	/* R22 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2525252525252525ULL;	/* R25 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2424242424242424ULL;	/* R24 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2727272727272727ULL;	/* R27 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2626262626262626ULL;	/* R26 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2929292929292929ULL;	/* R29 */
	pxTopOfStack--;
	*pxTopOfStack = 0x2828282828282828ULL;	/* R28 */
	pxTopOfStack--;
	*pxTopOfStack = ( StackType_t ) 0x00;	/* XZR - has no effect, used so there are an even number of registers. */
	pxTopOfStack--;
	*pxTopOfStack = ( StackType_t ) portTASK_RETURN_ADDRESS;	/* R30 - procedure call link register. */
	pxTopOfStack--;

	*pxTopOfStack = portINITIAL_PSTATE;
	pxTopOfStack--;

	*pxTopOfStack = ( StackType_t ) pxCode; /* Exception return address. */
	pxTopOfStack--;
	#if( configUSE_TASK_FPU_SUPPORT == 1 )
	{
	/* The task will start with a critical nesting count of 0 as interrupts are
		enabled. */
	*pxTopOfStack = portNO_CRITICAL_NESTING;
	/* The task will start without a floating point context.  A task that uses
	the floating point hardware must call vPortTaskUsesFPU() before executing
	any floating point instructions. */
	 pxTopOfStack--;
	*pxTopOfStack = portNO_FLOATING_POINT_CONTEXT;
	}
	#elif( configUSE_TASK_FPU_SUPPORT == 2 )
	{
		/* The task will start with a floating point context.  Leave enough
		 * space for the registers - and ensure they are initialised to 0. */
		pxTopOfStack -= (portFPU_REGISTER_DOUBLE_WORDS-1);
		memset( pxTopOfStack, 0x00, portFPU_REGISTER_DOUBLE_WORDS * sizeof( StackType_t ) );

		/* The task will start with a critical nesting count of 0 as interrupts are
			enabled. */
		pxTopOfStack--;
		*pxTopOfStack = portNO_CRITICAL_NESTING;
		pxTopOfStack--;
		*pxTopOfStack = pdTRUE;
		ullPortTaskHasFPUContext = pdTRUE;
	}
	#else
	{
		#error Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 1, 2, or left undefined.
	}
	#endif

	return pxTopOfStack;
}
/*
 * See header file for description.
 */
See header file for description.
See header file for description .
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
{
	pxTopOfStack--;
	*pxTopOfStack = 0x0101010101010101ULL;	
	pxTopOfStack--;
	*pxTopOfStack = ( StackType_t ) pvParameters; 
	pxTopOfStack--;
	*pxTopOfStack = 0x0303030303030303ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x0202020202020202ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x0505050505050505ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x0404040404040404ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x0707070707070707ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x0606060606060606ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x0909090909090909ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x0808080808080808ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1111111111111111ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1010101010101010ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1313131313131313ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1212121212121212ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1515151515151515ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1414141414141414ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1717171717171717ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1616161616161616ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1919191919191919ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x1818181818181818ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2121212121212121ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2020202020202020ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2323232323232323ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2222222222222222ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2525252525252525ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2424242424242424ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2727272727272727ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2626262626262626ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2929292929292929ULL;	
	pxTopOfStack--;
	*pxTopOfStack = 0x2828282828282828ULL;	
	pxTopOfStack--;
	*pxTopOfStack = ( StackType_t ) 0x00;	
	pxTopOfStack--;
	*pxTopOfStack = ( StackType_t ) portTASK_RETURN_ADDRESS;	
	pxTopOfStack--;
	*pxTopOfStack = portINITIAL_PSTATE;
	pxTopOfStack--;
	*pxTopOfStack = ( StackType_t ) pxCode; 
	pxTopOfStack--;
	#if( configUSE_TASK_FPU_SUPPORT == 1 )
	{
	*pxTopOfStack = portNO_CRITICAL_NESTING;
	 pxTopOfStack--;
	*pxTopOfStack = portNO_FLOATING_POINT_CONTEXT;
	}
	#elif( configUSE_TASK_FPU_SUPPORT == 2 )
	{
		pxTopOfStack -= (portFPU_REGISTER_DOUBLE_WORDS-1);
		memset( pxTopOfStack, 0x00, portFPU_REGISTER_DOUBLE_WORDS * sizeof( StackType_t ) );
		pxTopOfStack--;
		*pxTopOfStack = portNO_CRITICAL_NESTING;
		pxTopOfStack--;
		*pxTopOfStack = pdTRUE;
		ullPortTaskHasFPUContext = pdTRUE;
	}
	#else
	{
		#error Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 1, 2, or left undefined.
	}
	#endif
	return pxTopOfStack;
}
StackType_t * pxPortInitialiseStack ( StackType_t * pxTopOfStack , TaskFunction_t pxCode , void * pvParameters ) { pxTopOfStack -- ; * pxTopOfStack = 0x0101010101010101ULL ; pxTopOfStack -- ; * pxTopOfStack = ( StackType_t ) pvParameters ; pxTopOfStack -- ; * pxTopOfStack = 0x0303030303030303ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x0202020202020202ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x0505050505050505ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x0404040404040404ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x0707070707070707ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x0606060606060606ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x0909090909090909ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x0808080808080808ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1111111111111111ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1010101010101010ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1313131313131313ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1212121212121212ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1515151515151515ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1414141414141414ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1717171717171717ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1616161616161616ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1919191919191919ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x1818181818181818ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2121212121212121ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2020202020202020ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2323232323232323ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2222222222222222ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2525252525252525ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2424242424242424ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2727272727272727ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2626262626262626ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2929292929292929ULL ; pxTopOfStack -- ; * pxTopOfStack = 0x2828282828282828ULL ; pxTopOfStack -- ; * pxTopOfStack = ( StackType_t ) 0x00 ; pxTopOfStack -- ; * pxTopOfStack = ( StackType_t ) portTASK_RETURN_ADDRESS ; pxTopOfStack -- ; * pxTopOfStack = portINITIAL_PSTATE ; pxTopOfStack -- ; * pxTopOfStack = ( StackType_t ) pxCode ; pxTopOfStack -- ; #if ( configUSE_TASK_FPU_SUPPORT == 1 ) { * pxTopOfStack = portNO_CRITICAL_NESTING ; pxTopOfStack -- ; * pxTopOfStack = portNO_FLOATING_POINT_CONTEXT ; } #elif ( configUSE_TASK_FPU_SUPPORT == 2 ) { pxTopOfStack -= ( portFPU_REGISTER_DOUBLE_WORDS - 1 ) ; memset ( pxTopOfStack , 0x00 , portFPU_REGISTER_DOUBLE_WORDS * sizeof ( StackType_t ) ) ; pxTopOfStack -- ; * pxTopOfStack = portNO_CRITICAL_NESTING ; pxTopOfStack -- ; * pxTopOfStack = pdTRUE ; ullPortTaskHasFPUContext = pdTRUE ; } #else { #error  Invalid configUSE_TASK_FPU_SUPPORT setting - configUSE_TASK_FPU_SUPPORT must be set to 1, 2, or left undefined. } #endif return pxTopOfStack ; }
See header file for description.
See header file for description .
/* Setup the initial stack of the task.  The stack is set exactly as
	expected by the portRESTORE_CONTEXT() macro. */ /* First all the general purpose registers. */ /* R1 */ /* R0 */ /* R3 */ /* R2 */ /* R5 */ /* R4 */ /* R7 */ /* R6 */ /* R9 */ /* R8 */ /* R11 */ /* R10 */ /* R13 */ /* R12 */ /* R15 */ /* R14 */ /* R17 */ /* R16 */ /* R19 */ /* R18 */ /* R21 */ /* R20 */ /* R23 */ /* R22 */ /* R25 */ /* R24 */ /* R27 */ /* R26 */ /* R29 */ /* R28 */ /* XZR - has no effect, used so there are an even number of registers. */ /* R30 - procedure call link register. */ /* Exception return address. */ /* The task will start with a critical nesting count of 0 as interrupts are
		enabled. */ /* The task will start without a floating point context.  A task that uses
	the floating point hardware must call vPortTaskUsesFPU() before executing
	any floating point instructions. */ /* The task will start with a floating point context.  Leave enough
		 * space for the registers - and ensure they are initialised to 0. */ /* The task will start with a critical nesting count of 0 as interrupts are
			enabled. */