mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
Synopsys ARC v1 port: run uncrustify to fix code style
Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
This commit is contained in:
parent
1f9ffc5abf
commit
c9cfead54d
4 changed files with 237 additions and 227 deletions
|
@ -30,13 +30,14 @@
|
||||||
* \brief exception processing for freertos
|
* \brief exception processing for freertos
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// #include "embARC.h"
|
/* #include "embARC.h" */
|
||||||
|
|
||||||
#include "arc_freertos_exceptions.h"
|
#include "arc_freertos_exceptions.h"
|
||||||
|
|
||||||
#ifdef __GNU__
|
#ifdef __GNU__
|
||||||
extern void gnu_printf_setup( void );
|
extern void gnu_printf_setup( void );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief freertos related cpu exception initialization, all the interrupts handled by freertos must be not
|
* \brief freertos related cpu exception initialization, all the interrupts handled by freertos must be not
|
||||||
* fast irqs. If fiq is needed, please install the default firq_exc_entry or your own fast irq entry into
|
* fast irqs. If fiq is needed, please install the default firq_exc_entry or your own fast irq entry into
|
||||||
|
@ -44,9 +45,7 @@ extern void gnu_printf_setup(void);
|
||||||
*/
|
*/
|
||||||
void freertos_exc_init( void )
|
void freertos_exc_init( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef __GNU__
|
#ifdef __GNU__
|
||||||
gnu_printf_setup();
|
gnu_printf_setup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
51
portable/ThirdParty/GCC/ARC_v1/port.c
vendored
51
portable/ThirdParty/GCC/ARC_v1/port.c
vendored
|
@ -41,6 +41,7 @@
|
||||||
|
|
||||||
volatile unsigned int ulCriticalNesting = 999UL;
|
volatile unsigned int ulCriticalNesting = 999UL;
|
||||||
volatile unsigned int context_switch_reqflg; /* task context switch request flag in exceptions and interrupts handling */
|
volatile unsigned int context_switch_reqflg; /* task context switch request flag in exceptions and interrupts handling */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var exc_nest_count
|
* \var exc_nest_count
|
||||||
* \brief the counter for exc/int processing, =0 no int/exc
|
* \brief the counter for exc/int processing, =0 no int/exc
|
||||||
|
@ -49,6 +50,7 @@ volatile unsigned int context_switch_reqflg; /* task context switch request flag
|
||||||
*/
|
*/
|
||||||
uint32_t exc_nest_count;
|
uint32_t exc_nest_count;
|
||||||
/* --------------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief kernel tick interrupt handler of freertos
|
* @brief kernel tick interrupt handler of freertos
|
||||||
*/
|
*/
|
||||||
|
@ -59,12 +61,14 @@ static void vKernelTick( void *ptr )
|
||||||
arc_timer_int_clear( BOARD_OS_TIMER_ID );
|
arc_timer_int_clear( BOARD_OS_TIMER_ID );
|
||||||
board_timer_update( configTICK_RATE_HZ );
|
board_timer_update( configTICK_RATE_HZ );
|
||||||
|
|
||||||
if (xTaskIncrementTick()) {
|
if( xTaskIncrementTick() )
|
||||||
|
{
|
||||||
portYIELD_FROM_ISR(); /* need to make task switch */
|
portYIELD_FROM_ISR(); /* need to make task switch */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief setup freertos kernel tick
|
* @brief setup freertos kernel tick
|
||||||
*/
|
*/
|
||||||
|
@ -91,17 +95,19 @@ static void prvSetupTimerInterrupt(void)
|
||||||
* It's not efficient but simple.
|
* It's not efficient but simple.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
|
TaskFunction_t pxCode,
|
||||||
|
void * pvParameters )
|
||||||
{
|
{
|
||||||
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
||||||
is not really required. */
|
* is not really required. */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* 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. */
|
||||||
|
|
||||||
/* When the task starts is will expect to find the function parameter in
|
/* When the task starts is will expect to find the function parameter in
|
||||||
R0. */
|
* R0. */
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
||||||
|
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
@ -117,6 +123,7 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief start the freertos scheduler, go to the first task
|
* @brief start the freertos scheduler, go to the first task
|
||||||
*
|
*
|
||||||
|
@ -134,16 +141,17 @@ BaseType_t xPortStartScheduler( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*/
|
*/
|
||||||
/* ----------------------------------------------------------------------------*/
|
/* ----------------------------------------------------------------------------*/
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief generate a task switch request in ISR
|
* @brief generate a task switch request in ISR
|
||||||
*/
|
*/
|
||||||
|
@ -158,6 +166,7 @@ void vPortYieldFromIsr(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*/
|
*/
|
||||||
|
@ -172,18 +181,19 @@ void vPortYield(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*/
|
*/
|
||||||
/* ----------------------------------------------------------------------------*/
|
/* ----------------------------------------------------------------------------*/
|
||||||
void vPortEndTask( void )
|
void vPortEndTask( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
#if ( INCLUDE_vTaskDelete == 1 )
|
#if ( INCLUDE_vTaskDelete == 1 )
|
||||||
vTaskDelete( NULL ); /* Delete task itself */
|
vTaskDelete( NULL ); /* Delete task itself */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while(1) { /* Yield to other task */
|
while( 1 ) /* Yield to other task */
|
||||||
|
{
|
||||||
vPortYield();
|
vPortYield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,13 +251,14 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to preve
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
||||||
|
|
||||||
/* Allocate a Newlib reent structure that is specific to this task.
|
/* Allocate a Newlib reent structure that is specific to this task.
|
||||||
Note Newlib support has been included by popular demand, but is not
|
* Note Newlib support has been included by popular demand, but is not
|
||||||
used by the FreeRTOS maintainers themselves. FreeRTOS is not
|
* used by the FreeRTOS maintainers themselves. FreeRTOS is not
|
||||||
responsible for resulting newlib operation. User must be familiar with
|
* responsible for resulting newlib operation. User must be familiar with
|
||||||
newlib and must provide system-wide implementations of the necessary
|
* newlib and must provide system-wide implementations of the necessary
|
||||||
stubs. Be warned that (at the time of writing) the current newlib design
|
* stubs. Be warned that (at the time of writing) the current newlib design
|
||||||
implements a system-wide malloc() that must be provided with locks. */
|
* implements a system-wide malloc() that must be provided with locks. */
|
||||||
struct _reent xNewLib_reent;
|
struct _reent xNewLib_reent;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -257,7 +268,7 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to preve
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* See the comments above the definition of
|
/* See the comments above the definition of
|
||||||
tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */
|
* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE. */
|
||||||
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) /*lint !e731 !e9029 Macro has been consolidated for readability reasons. */
|
||||||
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
|
uint8_t ucStaticallyAllocated; /*< Set to pdTRUE if the task is a statically allocated to ensure no attempt is made to free the memory. */
|
||||||
#endif
|
#endif
|
||||||
|
@ -269,16 +280,16 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to preve
|
||||||
#if ( configUSE_POSIX_ERRNO == 1 )
|
#if ( configUSE_POSIX_ERRNO == 1 )
|
||||||
int iTaskErrno;
|
int iTaskErrno;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} tskTCB;
|
} tskTCB;
|
||||||
|
|
||||||
|
|
||||||
void vPortSetStackCheck(TaskHandle_t old, TaskHandle_t new)
|
void vPortSetStackCheck( TaskHandle_t old,
|
||||||
|
TaskHandle_t new )
|
||||||
|
{
|
||||||
|
if( new != NULL )
|
||||||
{
|
{
|
||||||
|
|
||||||
if (new != NULL) {
|
|
||||||
arc_aux_write( AUX_USTACK_BASE, ( uint32_t ) ( new->pxEndOfStack ) );
|
arc_aux_write( AUX_USTACK_BASE, ( uint32_t ) ( new->pxEndOfStack ) );
|
||||||
arc_aux_write( AUX_USTACK_TOP, ( uint32_t ) ( new->pxStack ) );
|
arc_aux_write( AUX_USTACK_TOP, ( uint32_t ) ( new->pxStack ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* if ARC_FEATURE_STACK_CHECK */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue