mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 10:42:33 -05:00 
			
		
		
		
	Revert formatting on CCS port files (#881)
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									76be28cdc6
								
							
						
					
					
						commit
						a8a17dc4b5
					
				
					 9 changed files with 383 additions and 389 deletions
				
			
		| 
						 | 
				
			
			@ -58,7 +58,7 @@ uint32_t ulCriticalNesting = 9999;
 | 
			
		|||
#define portTHUMB_MODE_BIT      ( ( StackType_t ) 0x20 )
 | 
			
		||||
 | 
			
		||||
/* The number of words on the stack frame between the saved Top Of Stack and
 | 
			
		||||
 * R0 (in which the parameters are passed. */
 | 
			
		||||
R0 (in which the parameters are passed. */
 | 
			
		||||
#define portSPACE_BETWEEN_TOS_AND_PARAMETERS    ( 12 )
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
| 
						 | 
				
			
			@ -69,7 +69,7 @@ extern void vPortStartFirstTask( void );
 | 
			
		|||
/*-----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Saved as part of the task context.  Set to pdFALSE if the task does not
 | 
			
		||||
 * require an FPU context. */
 | 
			
		||||
require an FPU context. */
 | 
			
		||||
uint32_t ulTaskHasFPUContext = 0;
 | 
			
		||||
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
| 
						 | 
				
			
			@ -78,9 +78,7 @@ uint32_t ulTaskHasFPUContext = 0;
 | 
			
		|||
/*
 | 
			
		||||
 * See header file for description.
 | 
			
		||||
 */
 | 
			
		||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
			
		||||
                                     TaskFunction_t pxCode,
 | 
			
		||||
                                     void * pvParameters )
 | 
			
		||||
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 | 
			
		||||
{
 | 
			
		||||
StackType_t *pxOriginalTOS;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -94,11 +92,11 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
			
		|||
    #endif
 | 
			
		||||
 | 
			
		||||
    /* Setup the initial stack of the task.  The stack is set exactly as
 | 
			
		||||
     * expected by the portRESTORE_CONTEXT() macro. */
 | 
			
		||||
    expected by the portRESTORE_CONTEXT() macro. */
 | 
			
		||||
 | 
			
		||||
    /* First on the stack is the return address - which is the start of the as
 | 
			
		||||
     * the task has not executed yet.  The offset is added to make the return
 | 
			
		||||
     * address appear as it would within an IRQ ISR. */
 | 
			
		||||
    the task has not executed yet.  The offset is added to make the return
 | 
			
		||||
    address appear as it would within an IRQ ISR. */
 | 
			
		||||
    *pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
 | 
			
		||||
    pxTopOfStack--;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -134,11 +132,11 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
			
		|||
        *pxTopOfStack = ( StackType_t ) 0x01010101; /* R1 */
 | 
			
		||||
        pxTopOfStack--;
 | 
			
		||||
    }
 | 
			
		||||
    #else /* ifdef portPRELOAD_TASK_REGISTERS */
 | 
			
		||||
    #else
 | 
			
		||||
    {
 | 
			
		||||
        pxTopOfStack -= portSPACE_BETWEEN_TOS_AND_PARAMETERS;
 | 
			
		||||
    }
 | 
			
		||||
    #endif /* ifdef portPRELOAD_TASK_REGISTERS */
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    /* Function parameters are passed in R0. */
 | 
			
		||||
    *pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
 | 
			
		||||
| 
						 | 
				
			
			@ -158,8 +156,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
			
		|||
        pxTopOfStack--;
 | 
			
		||||
 | 
			
		||||
        /* The last thing on the stack is the tasks ulUsingFPU value, which by
 | 
			
		||||
         * default is set to indicate that the stack frame does not include FPU
 | 
			
		||||
         * registers. */
 | 
			
		||||
        default is set to indicate that the stack frame does not include FPU
 | 
			
		||||
        registers. */
 | 
			
		||||
        *pxTopOfStack = pdFALSE;
 | 
			
		||||
    }
 | 
			
		||||
    #endif
 | 
			
		||||
| 
						 | 
				
			
			@ -210,7 +208,7 @@ BaseType_t xPortStartScheduler( void )
 | 
			
		|||
    ulCriticalNesting = 0;
 | 
			
		||||
 | 
			
		||||
    /* Start the first task.  This is done from portASM.asm as ARM mode must be
 | 
			
		||||
     * used. */
 | 
			
		||||
    used. */
 | 
			
		||||
    vPortStartFirstTask();
 | 
			
		||||
 | 
			
		||||
    /* Should not get here! */
 | 
			
		||||
| 
						 | 
				
			
			@ -224,7 +222,7 @@ BaseType_t xPortStartScheduler( void )
 | 
			
		|||
void vPortEndScheduler(void)
 | 
			
		||||
{
 | 
			
		||||
    /* Not implemented in ports where there is nothing to return to.
 | 
			
		||||
     * Artificially force an assert. */
 | 
			
		||||
    Artificially force an assert. */
 | 
			
		||||
    configASSERT( ulCriticalNesting == 1000UL );
 | 
			
		||||
}
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
| 
						 | 
				
			
			@ -239,11 +237,11 @@ void vPortEndScheduler( void )
 | 
			
		|||
        portRTI_INTFLAG_REG = 0x00000001;
 | 
			
		||||
 | 
			
		||||
        /* Increment the tick count - this may make a delaying task ready
 | 
			
		||||
         * to run - but a context switch is not performed. */
 | 
			
		||||
        to run - but a context switch is not performed. */
 | 
			
		||||
        xTaskIncrementTick();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#else /* if configUSE_PREEMPTION == 0 */
 | 
			
		||||
 #else
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     **************************************************************************
 | 
			
		||||
| 
						 | 
				
			
			@ -254,7 +252,7 @@ void vPortEndScheduler( void )
 | 
			
		|||
     */
 | 
			
		||||
    void vPortPreemptiveTick( void );
 | 
			
		||||
 | 
			
		||||
#endif /* if configUSE_PREEMPTION == 0 */
 | 
			
		||||
#endif
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -266,9 +264,9 @@ void vPortEnterCritical( void )
 | 
			
		|||
    /* Disable interrupts as per portDISABLE_INTERRUPTS(); */
 | 
			
		||||
    portDISABLE_INTERRUPTS();
 | 
			
		||||
 | 
			
		||||
    /* Now that interrupts are disabled, ulCriticalNesting can be accessed
 | 
			
		||||
     * directly.  Increment ulCriticalNesting to keep a count of how many times
 | 
			
		||||
     * portENTER_CRITICAL() has been called. */
 | 
			
		||||
    /* Now interrupts are disabled ulCriticalNesting can be accessed
 | 
			
		||||
    directly.  Increment ulCriticalNesting to keep a count of how many times
 | 
			
		||||
    portENTER_CRITICAL() has been called. */
 | 
			
		||||
    ulCriticalNesting++;
 | 
			
		||||
}
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
| 
						 | 
				
			
			@ -285,7 +283,7 @@ void vPortExitCritical( void )
 | 
			
		|||
        ulCriticalNesting--;
 | 
			
		||||
 | 
			
		||||
        /* If the nesting level has reached zero then interrupts should be
 | 
			
		||||
         * re-enabled. */
 | 
			
		||||
        re-enabled. */
 | 
			
		||||
        if( ulCriticalNesting == 0 )
 | 
			
		||||
        {
 | 
			
		||||
            /* Enable interrupts as per portENABLE_INTERRUPTS(). */
 | 
			
		||||
| 
						 | 
				
			
			@ -302,7 +300,7 @@ void vPortExitCritical( void )
 | 
			
		|||
    extern void vPortInitialiseFPSCR( void );
 | 
			
		||||
 | 
			
		||||
        /* A task is registering the fact that it needs an FPU context.  Set the
 | 
			
		||||
         * FPU flag (saved as part of the task context. */
 | 
			
		||||
        FPU flag (saved as part of the task context. */
 | 
			
		||||
        ulTaskHasFPUContext = pdTRUE;
 | 
			
		||||
 | 
			
		||||
        /* Initialise the floating point status register. */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,7 +60,7 @@ typedef unsigned long    UBaseType_t;
 | 
			
		|||
    #define portMAX_DELAY (TickType_t) 0xFFFFFFFFF
 | 
			
		||||
 | 
			
		||||
    /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
 | 
			
		||||
 * not need to be guarded with a critical section. */
 | 
			
		||||
    not need to be guarded with a critical section. */
 | 
			
		||||
    #define portTICK_TYPE_IS_ATOMIC 1
 | 
			
		||||
#else
 | 
			
		||||
    #error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,34 +1,32 @@
 | 
			
		|||
;/*
 | 
			
		||||
   * ; * FreeRTOS Kernel <DEVELOPMENT BRANCH>
 | 
			
		||||
   * ; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
 | 
			
		||||
   * ; *
 | 
			
		||||
   * ; * SPDX-License-Identifier: MIT
 | 
			
		||||
   * ; *
 | 
			
		||||
   * ; * Permission is hereby granted, free of charge, to any person obtaining a copy of
 | 
			
		||||
   * ; * this software and associated documentation files (the "Software"), to deal in
 | 
			
		||||
   * ; * the Software without restriction, including without limitation the rights to
 | 
			
		||||
   * ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 | 
			
		||||
   * ; * the Software, and to permit persons to whom the Software is furnished to do so,
 | 
			
		||||
   * ; * subject to the following conditions:
 | 
			
		||||
   * ; *
 | 
			
		||||
   * ; * The above copyright notice and this permission notice shall be included in all
 | 
			
		||||
   * ; * copies or substantial portions of the Software.
 | 
			
		||||
   * ; *
 | 
			
		||||
   * ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
   * ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 | 
			
		||||
   * ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 | 
			
		||||
   * ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 | 
			
		||||
   * ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 | 
			
		||||
   * ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 | 
			
		||||
   * ; *
 | 
			
		||||
   * ; * https://www.FreeRTOS.org
 | 
			
		||||
   * ; * https://github.com/FreeRTOS
 | 
			
		||||
   * ; *
 | 
			
		||||
   * ; */
 | 
			
		||||
; * FreeRTOS Kernel <DEVELOPMENT BRANCH>
 | 
			
		||||
; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
 | 
			
		||||
; *
 | 
			
		||||
; * SPDX-License-Identifier: MIT
 | 
			
		||||
; *
 | 
			
		||||
; * Permission is hereby granted, free of charge, to any person obtaining a copy of
 | 
			
		||||
; * this software and associated documentation files (the "Software"), to deal in
 | 
			
		||||
; * the Software without restriction, including without limitation the rights to
 | 
			
		||||
; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 | 
			
		||||
; * the Software, and to permit persons to whom the Software is furnished to do so,
 | 
			
		||||
; * subject to the following conditions:
 | 
			
		||||
; *
 | 
			
		||||
; * The above copyright notice and this permission notice shall be included in all
 | 
			
		||||
; * copies or substantial portions of the Software.
 | 
			
		||||
; *
 | 
			
		||||
; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 | 
			
		||||
; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 | 
			
		||||
; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 | 
			
		||||
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 | 
			
		||||
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 | 
			
		||||
; *
 | 
			
		||||
; * https://www.FreeRTOS.org
 | 
			
		||||
; * https://github.com/FreeRTOS
 | 
			
		||||
; *
 | 
			
		||||
; */
 | 
			
		||||
 | 
			
		||||
.
 | 
			
		||||
 | 
			
		||||
   if $DEFINED( __LARGE_DATA_MODEL__ )
 | 
			
		||||
    .if $DEFINED( __LARGE_DATA_MODEL__ )
 | 
			
		||||
        .define "pushm.a", pushm_x
 | 
			
		||||
        .define "popm.a", popm_x
 | 
			
		||||
        .define "push.a", push_x
 | 
			
		||||
| 
						 | 
				
			
			@ -42,9 +40,7 @@
 | 
			
		|||
        .define "mov.w", mov_x
 | 
			
		||||
    .endif
 | 
			
		||||
 | 
			
		||||
       .
 | 
			
		||||
 | 
			
		||||
       if $DEFINED( __LARGE_CODE_MODEL__ )
 | 
			
		||||
    .if $DEFINED( __LARGE_CODE_MODEL__ )
 | 
			
		||||
        .define "calla", call_x
 | 
			
		||||
        .define "reta", ret_x
 | 
			
		||||
    .else
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -35,24 +35,24 @@
 | 
			
		|||
 *----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
/* Constants required for hardware setup.  The tick ISR runs off the ACLK,
 | 
			
		||||
 * not the MCLK. */
 | 
			
		||||
not the MCLK. */
 | 
			
		||||
#define portACLK_FREQUENCY_HZ           ( ( TickType_t ) 32768 )
 | 
			
		||||
#define portINITIAL_CRITICAL_NESTING    ( ( uint16_t ) 10 )
 | 
			
		||||
#define portFLAGS_INT_ENABLED           ( ( StackType_t ) 0x08 )
 | 
			
		||||
 | 
			
		||||
/* We require the address of the pxCurrentTCB variable, but don't want to know
 | 
			
		||||
 * any details of its type. */
 | 
			
		||||
any details of its type. */
 | 
			
		||||
typedef void TCB_t;
 | 
			
		||||
extern volatile TCB_t * volatile pxCurrentTCB;
 | 
			
		||||
 | 
			
		||||
/* Each task maintains a count of the critical section nesting depth.  Each
 | 
			
		||||
 * time a critical section is entered the count is incremented.  Each time a
 | 
			
		||||
 * critical section is exited the count is decremented - with interrupts only
 | 
			
		||||
 * being re-enabled if the count is zero.
 | 
			
		||||
 *
 | 
			
		||||
 * usCriticalNesting will get set to zero when the scheduler starts, but must
 | 
			
		||||
 * not be initialised to zero as this will cause problems during the startup
 | 
			
		||||
 * sequence. */
 | 
			
		||||
time a critical section is entered the count is incremented.  Each time a
 | 
			
		||||
critical section is exited the count is decremented - with interrupts only
 | 
			
		||||
being re-enabled if the count is zero.
 | 
			
		||||
 | 
			
		||||
usCriticalNesting will get set to zero when the scheduler starts, but must
 | 
			
		||||
not be initialised to zero as this will cause problems during the startup
 | 
			
		||||
sequence. */
 | 
			
		||||
volatile uint16_t usCriticalNesting = portINITIAL_CRITICAL_NESTING;
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -70,27 +70,25 @@ void vPortSetupTimerInterrupt( void );
 | 
			
		|||
 *
 | 
			
		||||
 * See the header file portable.h.
 | 
			
		||||
 */
 | 
			
		||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
			
		||||
                                     TaskFunction_t pxCode,
 | 
			
		||||
                                     void * pvParameters )
 | 
			
		||||
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
 | 
			
		||||
{
 | 
			
		||||
uint16_t *pusTopOfStack;
 | 
			
		||||
uint32_t *pulTopOfStack, ulTemp;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     *  Place a few bytes of known values on the bottom of the stack.
 | 
			
		||||
     *  This is just useful for debugging and can be included if required.
 | 
			
		||||
     *
 | 
			
		||||
        Place a few bytes of known values on the bottom of the stack.
 | 
			
		||||
        This is just useful for debugging and can be included if required.
 | 
			
		||||
 | 
			
		||||
        *pxTopOfStack = ( StackType_t ) 0x1111;
 | 
			
		||||
     *  pxTopOfStack--;
 | 
			
		||||
        pxTopOfStack--;
 | 
			
		||||
        *pxTopOfStack = ( StackType_t ) 0x2222;
 | 
			
		||||
     *  pxTopOfStack--;
 | 
			
		||||
        pxTopOfStack--;
 | 
			
		||||
        *pxTopOfStack = ( StackType_t ) 0x3333;
 | 
			
		||||
     *  pxTopOfStack--;
 | 
			
		||||
        pxTopOfStack--;
 | 
			
		||||
    */
 | 
			
		||||
 | 
			
		||||
    /* Data types are need either 16 bits or 32 bits depending on the data
 | 
			
		||||
     * and code model used. */
 | 
			
		||||
    and code model used. */
 | 
			
		||||
    if( sizeof( pxCode ) == sizeof( uint16_t ) )
 | 
			
		||||
    {
 | 
			
		||||
        pusTopOfStack = ( uint16_t * ) pxTopOfStack;
 | 
			
		||||
| 
						 | 
				
			
			@ -139,19 +137,19 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
			
		|||
        pxTopOfStack--;
 | 
			
		||||
        *pxTopOfStack = ( StackType_t ) 0x4444;
 | 
			
		||||
        pxTopOfStack--;
 | 
			
		||||
    #else /* ifdef PRELOAD_REGISTER_VALUES */
 | 
			
		||||
    #else
 | 
			
		||||
        pxTopOfStack -= 3;
 | 
			
		||||
        *pxTopOfStack = ( StackType_t ) pvParameters;
 | 
			
		||||
        pxTopOfStack -= 9;
 | 
			
		||||
    #endif /* ifdef PRELOAD_REGISTER_VALUES */
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    /* A variable is used to keep track of the critical section nesting.
 | 
			
		||||
     * This variable has to be stored as part of the task context and is
 | 
			
		||||
     * initially set to zero. */
 | 
			
		||||
    This variable has to be stored as part of the task context and is
 | 
			
		||||
    initially set to zero. */
 | 
			
		||||
    *pxTopOfStack = ( StackType_t ) portNO_CRITICAL_SECTION_NESTING;
 | 
			
		||||
 | 
			
		||||
    /* Return a pointer to the top of the stack we have generated so this can
 | 
			
		||||
     * be stored in the task control block for the task. */
 | 
			
		||||
    be stored in the task control block for the task. */
 | 
			
		||||
    return pxTopOfStack;
 | 
			
		||||
}
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
| 
						 | 
				
			
			@ -159,7 +157,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
 | 
			
		|||
void vPortEndScheduler( void )
 | 
			
		||||
{
 | 
			
		||||
    /* It is unlikely that the MSP430 port will get stopped.  If required simply
 | 
			
		||||
     * disable the tick interrupt here. */
 | 
			
		||||
    disable the tick interrupt here. */
 | 
			
		||||
}
 | 
			
		||||
/*-----------------------------------------------------------*/
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -186,3 +184,5 @@ interrupt void vTickISREntry( void )
 | 
			
		|||
        vPortCooperativeTickISR();
 | 
			
		||||
    #endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -139,7 +139,7 @@ extern void vTaskSwitchContext( void );
 | 
			
		|||
void vApplicationSetupTimerInterrupt( void );
 | 
			
		||||
 | 
			
		||||
/* sizeof( int ) != sizeof( long ) so a full printf() library is required if
 | 
			
		||||
 * run time stats information is to be displayed. */
 | 
			
		||||
run time stats information is to be displayed. */
 | 
			
		||||
#define portLU_PRINTF_SPECIFIER_REQUIRED
 | 
			
		||||
 | 
			
		||||
#endif /* PORTMACRO_H */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue