mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Revert Portable/Softune Formatting (#886)
* Revert formatting on Softune ports * Fix spelling mistakes --------- 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
96cdeaa725
commit
92365c9784
|
@ -30,12 +30,11 @@
|
|||
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
|
||||
/* ELIGIBILITY FOR ANY PURPOSES. */
|
||||
/* (C) Fujitsu Microelectronics Europe GmbH */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
* __STD_LIB_sbrk.C
|
||||
* - Used by heap_3.c for memory allocation and deletion.
|
||||
*
|
||||
* /*---------------------------------------------------------------------------*/
|
||||
__STD_LIB_sbrk.C
|
||||
- Used by heap_3.c for memory allocation and deletion.
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "FreeRTOSConfig.h"
|
||||
#include <stdlib.h>
|
||||
|
@ -48,11 +47,9 @@ static _heep_t _heep[ ROUNDUP( configTOTAL_HEAP_SIZE ) / sizeof( _heep_t ) ];
|
|||
|
||||
extern char *sbrk(int size)
|
||||
{
|
||||
if( ( brk_siz + size > _heep_size ) || ( brk_siz + size < 0 ) )
|
||||
{
|
||||
return( ( char * ) -1 );
|
||||
}
|
||||
if (brk_siz + size > _heep_size || brk_siz + size < 0)
|
||||
|
||||
return((char*)-1);
|
||||
brk_siz += size;
|
||||
return( (char*)_heep + brk_siz - size);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* 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;
|
||||
|
||||
|
@ -106,12 +106,10 @@ static void prvSetupTimerInterrupt( 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 )
|
||||
{
|
||||
/* Place a few bytes of known values on the bottom of the stack.
|
||||
* This is just useful for debugging. */
|
||||
This is just useful for debugging. */
|
||||
|
||||
*pxTopOfStack = 0x11111111;
|
||||
pxTopOfStack--;
|
||||
|
@ -121,8 +119,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|||
pxTopOfStack--;
|
||||
|
||||
/* This is a redundant push to the stack, it may be required if
|
||||
* in some implementations of the compiler the parameter to the task
|
||||
* is passed on to the stack rather than in R4 register. */
|
||||
in some implementations of the compiler the parameter to the task
|
||||
is passed on to the stack rather than in R4 register. */
|
||||
*pxTopOfStack = (StackType_t)(pvParameters);
|
||||
pxTopOfStack--;
|
||||
|
||||
|
@ -136,9 +134,9 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|||
pxTopOfStack--;
|
||||
|
||||
/* In the current implementation of the compiler the first
|
||||
* parameter to the task (or function) is passed via R4 parameter
|
||||
* to the task, hence the pvParameters pointer is copied into the R4
|
||||
* register. See compiler manual section 4.6.2 for more information. */
|
||||
parameter to the task (or function) is passed via R4 parameter
|
||||
to the task, hence the pvParameters pointer is copied into the R4
|
||||
register. See compiler manual section 4.6.2 for more information. */
|
||||
*pxTopOfStack = ( StackType_t ) (pvParameters); /* R4 */
|
||||
pxTopOfStack--;
|
||||
*pxTopOfStack = ( StackType_t ) 0x00003333; /* R3 */
|
||||
|
@ -190,7 +188,7 @@ BaseType_t xPortStartScheduler( void )
|
|||
#pragma endasm
|
||||
|
||||
/* Simulate a function call end as generated by the compiler. We will now
|
||||
* jump to the start of the task the context of which we have just restored. */
|
||||
jump to the start of the task the context of which we have just restored. */
|
||||
__asm(" reti ");
|
||||
|
||||
/* Should not get here. */
|
||||
|
@ -201,7 +199,7 @@ BaseType_t xPortStartScheduler( void )
|
|||
void vPortEndScheduler( void )
|
||||
{
|
||||
/* Not implemented - unlikely to ever be required as there is nothing to
|
||||
* return to. */
|
||||
return to. */
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -259,7 +257,7 @@ static void prvSetupTimerInterrupt( void )
|
|||
|
||||
#pragma endasm
|
||||
|
||||
#else /* if configUSE_PREEMPTION == 1 */
|
||||
#else
|
||||
|
||||
/*
|
||||
* Tick ISR for the cooperative scheduler. All this does is increment the
|
||||
|
@ -273,7 +271,7 @@ static void prvSetupTimerInterrupt( void )
|
|||
xTaskIncrementTick();
|
||||
}
|
||||
|
||||
#endif /* if configUSE_PREEMPTION == 1 */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Manual context switch. We can use a __nosavereg attribute as the context
|
||||
|
|
|
@ -30,12 +30,11 @@
|
|||
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
|
||||
/* ELIGIBILITY FOR ANY PURPOSES. */
|
||||
/* (C) Fujitsu Microelectronics Europe GmbH */
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
* __STD_LIB_sbrk.C
|
||||
* - Used by heap_3.c for memory allocation and deletion.
|
||||
*
|
||||
* /*---------------------------------------------------------------------------*/
|
||||
__STD_LIB_sbrk.C
|
||||
- Used by heap_3.c for memory allocation and deletion.
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "FreeRTOSConfig.h"
|
||||
#include <stdlib.h>
|
||||
|
@ -48,11 +47,9 @@ static _heep_t _heep[ ROUNDUP( configTOTAL_HEAP_SIZE ) / sizeof( _heep_t ) ];
|
|||
|
||||
extern char *sbrk(int size)
|
||||
{
|
||||
if( ( brk_siz + size > _heep_size ) || ( brk_siz + size < 0 ) )
|
||||
{
|
||||
return( ( char * ) -1 );
|
||||
}
|
||||
if (brk_siz + size > _heep_size || brk_siz + size < 0)
|
||||
|
||||
return((char*)-1);
|
||||
brk_siz += size;
|
||||
return( (char*)_heep + brk_siz - size);
|
||||
}
|
||||
|
|
|
@ -108,8 +108,8 @@ extern volatile TCB_t * volatile pxCurrentTCB;
|
|||
* Macro to restore a task context from the task stack. This is
|
||||
* effectively the reverse of SAVE_CONTEXT(). First the stack pointer
|
||||
* value (USP for SMALL and MEDIUM memory model amd USB:USP for COMPACT
|
||||
* and LARGE memory model ) is loaded from the task control block. Next the
|
||||
* value of all the general purpose registers RW0-RW7 is retrieved.
|
||||
* and LARGE memory model ) is loaded from the task control block. Next
|
||||
* the value of all the general purpose registers RW0-RW7 is retrieved.
|
||||
* Finally it copies of the context ( AH:AL, DPR:ADB, DTB:PCB, PC and PS)
|
||||
* of the task to be executed upon RETI from user stack to system stack.
|
||||
*/
|
||||
|
@ -213,7 +213,7 @@ extern volatile TCB_t * volatile pxCurrentTCB;
|
|||
__asm(" OR CCR,#H'20 "); \
|
||||
__asm(" PUSHW A "); \
|
||||
}
|
||||
#endif /* if ( ( configMEMMODEL == portSMALL ) || ( configMEMMODEL == portMEDIUM ) ) */
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -261,12 +261,10 @@ _xGet_DTB_PCB_bank:
|
|||
*
|
||||
* 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 )
|
||||
{
|
||||
/* Place a few bytes of known values on the bottom of the stack.
|
||||
* This is just useful for debugging. */
|
||||
This is just useful for debugging. */
|
||||
*pxTopOfStack = 0x1111;
|
||||
pxTopOfStack--;
|
||||
*pxTopOfStack = 0x2222;
|
||||
|
@ -275,10 +273,10 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|||
pxTopOfStack--;
|
||||
|
||||
/* Once the task is called the task would push the pointer to the
|
||||
* parameter onto the stack. Hence here the pointer would be copied to the stack
|
||||
* first. When using the COMPACT or LARGE memory model the pointer would be 24
|
||||
* bits, and when using the SMALL or MEDIUM memory model the pointer would be 16
|
||||
* bits. */
|
||||
parameter onto the stack. Hence here the pointer would be copied to the stack
|
||||
first. When using the COMPACT or LARGE memory model the pointer would be 24
|
||||
bits, and when using the SMALL or MEDIUM memory model the pointer would be 16
|
||||
bits. */
|
||||
#if( ( configMEMMODEL == portCOMPACT ) || ( configMEMMODEL == portLARGE ) )
|
||||
{
|
||||
*pxTopOfStack = ( StackType_t ) ( ( uint32_t ) ( pvParameters ) >> 16 );
|
||||
|
@ -290,8 +288,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|||
pxTopOfStack--;
|
||||
|
||||
/* This is redundant push to the stack. This is required in order to introduce
|
||||
* an offset so that the task accesses a parameter correctly that is passed on to
|
||||
* the task stack. */
|
||||
an offset so that the task accesses a parameter correctly that is passed on to
|
||||
the task stack. */
|
||||
#if( ( configMEMMODEL == portMEDIUM ) || ( configMEMMODEL == portLARGE ) )
|
||||
{
|
||||
*pxTopOfStack = ( xGet_DTB_PCB_bank() & 0xff00 ) | ( ( ( int32_t ) ( pxCode ) >> 16 ) & 0xff );
|
||||
|
@ -300,7 +298,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|||
#endif
|
||||
|
||||
/* This is redundant push to the stack. This is required in order to introduce
|
||||
* an offset so the task correctly accesses the parameter passed on the task stack. */
|
||||
an offset so the task correctly accesses the parameter passed on the task stack. */
|
||||
*pxTopOfStack = ( StackType_t ) ( pxCode );
|
||||
pxTopOfStack--;
|
||||
|
||||
|
@ -321,7 +319,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
|||
#endif
|
||||
|
||||
/* DTB | PCB, in case of MEDIUM and LARGE memory models, PCB would be used
|
||||
* along with PC to indicate the start address of the function. */
|
||||
along with PC to indicate the start address of the function. */
|
||||
#if( ( configMEMMODEL == portMEDIUM ) || ( configMEMMODEL == portLARGE ) )
|
||||
{
|
||||
*pxTopOfStack = ( xGet_DTB_PCB_bank() & 0xff00 ) | ( ( ( int32_t ) ( pxCode ) >> 16 ) & 0xff );
|
||||
|
@ -384,7 +382,7 @@ BaseType_t xPortStartScheduler( void )
|
|||
portRESTORE_CONTEXT();
|
||||
|
||||
/* Simulate a function call end as generated by the compiler. We will now
|
||||
* jump to the start of the task the context of which we have just restored. */
|
||||
jump to the start of the task the context of which we have just restored. */
|
||||
__asm(" reti ");
|
||||
|
||||
|
||||
|
@ -396,7 +394,7 @@ BaseType_t xPortStartScheduler( void )
|
|||
void vPortEndScheduler( void )
|
||||
{
|
||||
/* Not implemented - unlikely to ever be required as there is nothing to
|
||||
* return to. */
|
||||
return to. */
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -429,7 +427,7 @@ void vPortEndScheduler( void )
|
|||
TMCSR0_UF = 0;
|
||||
|
||||
/* Increment the tick count then switch to the highest priority task
|
||||
* that is ready to run. */
|
||||
that is ready to run. */
|
||||
if( xTaskIncrementTick() != pdFALSE )
|
||||
{
|
||||
vTaskSwitchContext();
|
||||
|
@ -445,7 +443,7 @@ void vPortEndScheduler( void )
|
|||
__EI();
|
||||
}
|
||||
|
||||
#else /* if configUSE_PREEMPTION == 1 */
|
||||
#else
|
||||
|
||||
/*
|
||||
* Tick ISR for the cooperative scheduler. All this does is increment the
|
||||
|
@ -460,7 +458,7 @@ void vPortEndScheduler( void )
|
|||
xTaskIncrementTick();
|
||||
}
|
||||
|
||||
#endif /* if configUSE_PREEMPTION == 1 */
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <stddef.h>
|
||||
|
||||
/* Constants denoting the available memory models. These are used within
|
||||
* FreeRTOSConfig.h to set the configMEMMODEL value. */
|
||||
FreeRTOSConfig.h to set the configMEMMODEL value. */
|
||||
#define portSMALL 0
|
||||
#define portMEDIUM 1
|
||||
#define portCOMPACT 2
|
||||
|
|
Loading…
Reference in a new issue