Tidy up - spell check.

This commit is contained in:
Richard Barry 2008-02-13 10:39:07 +00:00
parent c3e153145b
commit 5a418b56fa
4 changed files with 95 additions and 114 deletions

View file

@ -56,8 +56,6 @@ extern volatile tskTCB * volatile pxCurrentTCB;
volatile unsigned portLONG ulCriticalNesting = 9999UL;
/*-----------------------------------------------------------*/
#pragma asm
#macro SaveContext
@ -104,7 +102,7 @@ volatile unsigned portLONG ulCriticalNesting = 9999UL;
ANDCCR #0xDF ;Switch to system stack
ST R0,@-R15 ;Store PC to system stack
ORCCR #0x20 ;Switch back to retreive the remaining context
ORCCR #0x20 ;Switch back to retrieve the remaining context
LDI #_ulCriticalNesting, R0 ;Get the address of the critical nesting counter
LD @R15+, R1 ;Get the saved critical nesting value
@ -146,14 +144,14 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
*pxTopOfStack = 0x33333333;
pxTopOfStack--;
/* This is a redundant push to the stack, it may be required if in some implentation of the compiler
the parameter to the task is passed on to the stack rather than in R4 register*/
/* 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. */
*pxTopOfStack = (portSTACK_TYPE)(pvParameters);
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x00000000; /* RP */
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x00007777; /* R7 */
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x00006666; /* R6 */
@ -161,10 +159,10 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
*pxTopOfStack = ( portSTACK_TYPE ) 0x00005555; /* R5 */
pxTopOfStack--;
/* In the current implemention of the compiler the first
parameter to the task(or function) is passed via R4 parameter
to the task, hennce the pvParameters pointer is copied in R4
regsiter. See compiler manual section 4.6.2 for more information.*/
/* 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. */
*pxTopOfStack = ( portSTACK_TYPE ) (pvParameters); /* R4 */
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x00003333; /* R3 */
@ -174,8 +172,7 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
*pxTopOfStack = ( portSTACK_TYPE ) 0x00001111; /* R1 */
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x00000001; /* R0 */
pxTopOfStack--;
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x0000EEEE; /* R14 */
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x0000DDDD; /* R13 */
@ -189,15 +186,14 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
*pxTopOfStack = ( portSTACK_TYPE ) 0x00009999; /* R9 */
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x00008888; /* R8 */
pxTopOfStack--;
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x11110000; /* MDH */
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x22220000; /* MDL */
pxTopOfStack--;
/* The task starts with its ulCriticalNesting variable set to 0, interrupts
being enabled. */
/* The task starts with its ulCriticalNesting variable set to 0,
interrupts being enabled. */
*pxTopOfStack = portNO_CRITICAL_NESTING;
pxTopOfStack--;
@ -218,18 +214,16 @@ portBASE_TYPE xPortStartScheduler( void )
prvSetupTimerInterrupt();
/* Restore the context of the first task that is going to run. */
#pragma asm
RestoreContext
#pragma endasm
#pragma asm
RestoreContext
#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. */
return pdTRUE;
return pdFAIL;
}
/*-----------------------------------------------------------*/
@ -240,26 +234,25 @@ void vPortEndScheduler( void )
}
/*-----------------------------------------------------------*/
/*
* Setup RLT0 to generate a tick interrupt.
*/
static void prvSetupTimerInterrupt( void )
{
/* The peripheral clock divided by 32 is used by the timer. */
const unsigned portSHORT usReloadValue = ( unsigned portSHORT ) ( ( ( configPER_CLOCK_HZ / configTICK_RATE_HZ ) / 32UL ) - 1UL );
TMCSR0_CNTE=0; /* Count Disable */
TMCSR0_CSL=0x2; /* CLKP/32 */
TMCSR0_MOD=0; /* Software trigger */
TMCSR0_RELD=1; /* Reload */
/* Setup RLT0 to generate a tick interrupt. */
TMCSR0_CNTE = 0; /* Count Disable */
TMCSR0_CSL = 0x2; /* CLKP/32 */
TMCSR0_MOD = 0; /* Software trigger */
TMCSR0_RELD = 1; /* Reload */
TMCSR0_UF=0; /* Clear underflow flag */
TMRLR0=usReloadValue;
TMCSR0_INTE=1; /* Interrupt Enable */
TMCSR0_CNTE=1; /* Count Enable */
TMCSR0_TRG=1; /* Trigger */
TMCSR0_UF = 0; /* Clear underflow flag */
TMRLR0 = usReloadValue;
TMCSR0_INTE = 1; /* Interrupt Enable */
TMCSR0_CNTE = 1; /* Count Enable */
TMCSR0_TRG = 1; /* Trigger */
PORTEN = 0x3; /* Port Enable */
PORTEN = 0x3; /* Port Enable */
}
/*-----------------------------------------------------------*/
@ -268,7 +261,7 @@ const unsigned portSHORT usReloadValue = ( unsigned portSHORT ) ( ( ( configPER_
/*
* Tick ISR for preemptive scheduler. The tick count is incremented
* after the context is saved. Then the context is switched if required,
* at last the context of the task which is to be resume is restored.
* and last the context of the task which is to be resumed is restored.
*/
#pragma asm
@ -277,9 +270,7 @@ const unsigned portSHORT usReloadValue = ( unsigned portSHORT ) ( ( ( configPER_
_ReloadTimer0_IRQHandler:
ANDCCR #0xEF ;Disable Interrupts
SaveContext ;Save context
ORCCR #0x10 ;Re-enable Interrupts
LDI #0xFFFB,R1
@ -287,13 +278,10 @@ const unsigned portSHORT usReloadValue = ( unsigned portSHORT ) ( ( ( configPER_
AND R1,@R0 ;Clear RLT0 interrupt flag
CALL32 _vTaskIncrementTick,R12 ;Increment Tick
CALL32 _vTaskSwitchContext,R12 ;Switch context if required
ANDCCR #0xEF ;Disable Interrupts
RestoreContext ;Restore context
ORCCR #0x10 ;Re-enable Interrupts
RETI
@ -316,20 +304,18 @@ const unsigned portSHORT usReloadValue = ( unsigned portSHORT ) ( ( ( configPER_
#endif
/*
* Manual context switch. We can use a __nosavereg attribute as the context
* would be saved by PortSAVE_CONTEXT(). The context is switched and then
* the context of the new task is restored saved.
*/
/*
* Manual context switch. We can use a __nosavereg attribute as the context
* would be saved by PortSAVE_CONTEXT(). The context is switched and then
* the context of the new task is restored saved.
*/
#pragma asm
.global _vPortYieldDelayed
_vPortYieldDelayed:
ANDCCR #0xEF ;Disable Interrupts
SaveContext ;Save context
ORCCR #0x10 ;Re-enable Interrupts
LDI #_dicr, R0
@ -338,36 +324,31 @@ const unsigned portSHORT usReloadValue = ( unsigned portSHORT ) ( ( ( configPER_
CALL32 _vTaskSwitchContext,R12 ;Switch context if required
ANDCCR #0xEF ;Disable Interrupts
RestoreContext ;Restore context
ORCCR #0x10 ;Re-enable Interrupts
RETI
#pragma endasm
/*-----------------------------------------------------------*/
/*
* Manual context switch. We can use a __nosavereg attribute as the context
* would be saved by PortSAVE_CONTEXT(). The context is switched and then
* the context of the new task is restored saved.
*/
/*
* Manual context switch. We can use a __nosavereg attribute as the context
* would be saved by PortSAVE_CONTEXT(). The context is switched and then
* the context of the new task is restored saved.
*/
#pragma asm
.global _vPortYield
_vPortYield:
SaveContext ;Save context
CALL32 _vTaskSwitchContext,R12 ;Switch context if required
RestoreContext ;Restore context
RETI
#pragma endasm
/*-----------------------------------------------------------*/
void vPortEnterCritical( void )

View file

@ -43,7 +43,10 @@
#ifndef PORTMACRO_H
#define PORTMACRO_H
/* Hardware specific includes. */
#include "mb91467d.h"
/* Standard includes. */
#include <stddef.h>
/*-----------------------------------------------------------
@ -65,9 +68,6 @@
#define portSTACK_TYPE unsigned portLONG
#define portBASE_TYPE long
/* This is required since SOFTUNE doesn't support inline directive as is. */
#define inline
#if( configUSE_16_BIT_TICKS == 1 )
typedef unsigned portSHORT portTickType;
#define portMAX_DELAY ( portTickType ) 0xffff
@ -94,7 +94,7 @@ void vPortExitCritical( void );
#define portNOP() __asm( " nop " );
/*-----------------------------------------------------------*/
/* portYIELD() uses SW interrupt */
/* portYIELD() uses a SW interrupt */
#define portYIELD() __asm( " INT #40H " );
/* portYIELD_FROM_ISR() uses delayed interrupt */
@ -107,5 +107,8 @@ void vPortExitCritical( void );
#define portMINIMAL_STACK_SIZE configMINIMAL_STACK_SIZE
/* Remove the inline statement from within the kernel code. */
#define inline
#endif /* PORTMACRO_H */