RM48 port layer without FPU saving completed.

This commit is contained in:
Richard Barry
2012-10-11 13:41:07 +00:00
parent 1112439c58
commit fe2163ede4
8 changed files with 219 additions and 849 deletions
@@ -1,159 +0,0 @@
;-------------------------------------------------
;
.def vRegTestTask1
.ref usRegTest1Counter
.text
.arm
;
vRegTestTask1:
; Fill each general purpose register with a known value.
mov r0, #0xFF
mov r1, #0x11
mov r2, #0x22
mov r3, #0x33
mov r4, #0x44
mov r5, #0x55
mov r6, #0x66
mov r7, #0x77
mov r8, #0x88
mov r9, #0x99
mov r10, #0xAA
mov r11, #0xBB
mov r12, #0xCC
mov r14, #0xEE
regTestLoop1:
; Force yeild
swi #0
; Test each general purpose register to check that it still contains the
; expected known value, jumping to vRegTest1Error if any register contains
; an unexpected value.
cmp r0, #0xFF
bne regTestError1
cmp r1, #0x11
bne regTestError1
cmp r2, #0x22
bne regTestError1
cmp r3, #0x33
bne regTestError1
cmp r4, #0x44
bne regTestError1
cmp r5, #0x55
bne regTestError1
cmp r6, #0x66
bne regTestError1
cmp r7, #0x77
bne regTestError1
cmp r8, #0x88
bne regTestError1
cmp r9, #0x99
bne regTestError1
cmp r10, #0xAA
bne regTestError1
cmp r11, #0xBB
bne regTestError1
cmp r12, #0xCC
bne regTestError1
cmp r14, #0xEE
bne regTestError1
; This task is still running without jumping to vRegTest1Error, so increment
; the loop counter so the check task knows the task is running error free.
stmfd sp!, { r0-r1 }
ldr r0, count1
ldr r1, [r0]
add r1, r1, #1
str r1, [r0]
ldmfd sp!, { r0-r1 }
; Loop again, performing the same tests.
b regTestLoop1
count1 .word usRegTest1Counter
regTestError1:
b regTestError1
;-------------------------------------------------
;
.def vRegTestTask2
.ref usRegTest2Counter
.text
.arm
;
vRegTestTask2:
; Fill each general purpose register with a known value.
mov r0, #0xFF000000
mov r1, #0x11000000
mov r2, #0x22000000
mov r3, #0x33000000
mov r4, #0x44000000
mov r5, #0x55000000
mov r6, #0x66000000
mov r7, #0x77000000
mov r8, #0x88000000
mov r9, #0x99000000
mov r10, #0xAA000000
mov r11, #0xBB000000
mov r12, #0xCC000000
mov r14, #0xEE000000
regTestLoop2:
; Force yeild
swi #0
; Test each general purpose register to check that it still contains the
; expected known value, jumping to vRegTest1Error if any register contains
; an unexpected value.
cmp r0, #0xFF000000
bne regTestError2
cmp r1, #0x11000000
bne regTestError2
cmp r2, #0x22000000
bne regTestError2
cmp r3, #0x33000000
bne regTestError2
cmp r4, #0x44000000
bne regTestError2
cmp r5, #0x55000000
bne regTestError2
cmp r6, #0x66000000
bne regTestError2
cmp r7, #0x77000000
bne regTestError2
cmp r8, #0x88000000
bne regTestError2
cmp r9, #0x99000000
bne regTestError2
cmp r10, #0xAA000000
bne regTestError2
cmp r11, #0xBB000000
bne regTestError2
cmp r12, #0xCC000000
bne regTestError2
cmp r14, #0xEE000000
bne regTestError2
; This task is still running without jumping to vRegTest1Error, so increment
; the loop counter so the check task knows the task is running error free.
stmfd sp!, { r0-r1 }
ldr r0, count2
ldr r1, [r0]
add r1, r1, #1
str r1, [r0]
ldmfd sp!, { r0-r1 }
; Loop again, performing the same tests.
b regTestLoop2
count2 .word usRegTest2Counter
regTestError2:
b regTestError2
;-------------------------------------------------
File diff suppressed because it is too large Load Diff
@@ -185,8 +185,8 @@ xTimerHandle xTimer = NULL;
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
/* Create the register test tasks, as described at the top of this file. */
xTaskCreate(vRegTestTask1, ( const signed char * ) "Reg1...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate(vRegTestTask2, ( const signed char * ) "Reg2...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vRegTestTask1, ( const signed char * ) "Reg1...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vRegTestTask2, ( const signed char * ) "Reg2...", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
/* Create the software timer that performs the 'check' functionality,
as described at the top of this file. */
File diff suppressed because it is too large Load Diff
@@ -144,10 +144,10 @@ vPortYeildWithinAPI
;-------------------------------------------------------------------------------
; Preemptive Tick
.def vPreemptiveTick
.def vPortPreemptiveTick
.ref vTaskIncrementTick
vPreemptiveTick
vPortPreemptiveTick
portSAVE_CONTEXT
; clear interrupt flag
movw r0, #0xFC88
@@ -64,55 +64,20 @@
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
#ifndef __OS_PORTMACRO_H__
#define __OS_PORTMACRO_H__
#ifndef __PORTMACRO_H__
#define __PORTMACRO_H__
/*-----------------------------------------------------------
* Port specific definitions.
*
* The settings in this file configure FreeRTOS correctly for the
* given hardware and compiler.
*
* These settings should not be altered.
*-----------------------------------------------------------
*/
/*----------------------------------------------------------------------------*/
/* RTI Register Frame Definition */
struct rti
{
unsigned GCTRL;
unsigned TBCTRL;
unsigned CAPCTRL;
unsigned COMPCTRL;
struct
{
unsigned FRCx;
unsigned UCx;
unsigned CPUCx;
unsigned : 32;
unsigned CAFRCx;
unsigned CAUCx;
unsigned : 32;
unsigned : 32;
} CNT[2U];
struct
{
unsigned COMPx;
unsigned UDCPx;
} CMP[4U];
unsigned TBLCOMP;
unsigned TBHCOMP;
unsigned : 32;
unsigned : 32;
unsigned SETINT;
unsigned CLEARINT;
unsigned INTFLAG;
unsigned : 32;
unsigned DWDCTRL;
unsigned DWDPRLD;
unsigned WDSTATUS;
unsigned WDKEY;
unsigned WDCNTR;
};
#define RTI ((volatile struct rti *)0xFFFFFC00U)
/*----------------------------------------------------------------------------*/
/* Type Definitions */
/* Type definitions. */
#define portCHAR char
#define portFLOAT float
#define portDOUBLE double
@@ -130,48 +95,29 @@ struct rti
#endif
/*----------------------------------------------------------------------------*/
/* Architecture Definitions */
/* Architecture specifics. */
#define portSTACK_GROWTH (-1)
#define portTICK_RATE_MS ((portTickType) 1000 / configTICK_RATE_HZ)
#define portBYTE_ALIGNMENT 8
/*----------------------------------------------------------------------------*/
/* External Functions */
/* Critical section handling. */
extern void vPortEnterCritical(void);
extern void vPortExitCritical(void);
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
#define portDISABLE_INTERRUPTS() asm( " CPSID I" )
#define portENABLE_INTERRUPTS() asm( " CPSIE I" )
/*----------------------------------------------------------------------------*/
/* Functions Macros */
#define portYIELD() _call_swi(0)
#define portYIELD_WITHIN_API() { *(volatile unsigned *)0xFFFFFFB0 = 0x7500; *(volatile unsigned *)0xFFFFFFB0; }
#define portYIELD_FROM_ISR() { *(volatile unsigned *)0xFFFFFFB0 = 0x7500; *(volatile unsigned *)0xFFFFFFB0; }
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
#define portDISABLE_INTERRUPTS() asm(" CPSID I")
#define portENABLE_INTERRUPTS() asm(" CPSIE I")
/* Scheduler utilities. */
#define portYIELD() _call_swi( 0 )
#define portSYS_SSIR1_REG ( * ( ( volatile unsigned long * ) 0xFFFFFFB0 ) )
#define portSYS_SSIR1_SSKEY ( 0x7500UL )
#define portYIELD_WITHIN_API() { portSYS_SSIR1_REG = portSYS_SSIR1_SSKEY; ( void ) portSYS_SSIR1_REG; }
#define portYIELD_FROM_ISR() { portSYS_SSIR1_REG = portSYS_SSIR1_SSKEY; ( void ) portSYS_SSIR1_REG; }
/* Task function macros as described on the FreeRTOS.org WEB site. */
#define portTASK_FUNCTION(vFunction, pvParameters) void vFunction(void *pvParameters)
#define portTASK_FUNCTION_PROTO(vFunction, pvParameters) void vFunction(void *pvParameters)
#if (configGENERATE_RUN_TIME_STATS == 1)
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() \
{ \
RTI->GCTRL = 0x00000000U; \
RTI->TBCTRL = 0x00000000U; \
RTI->COMPCTRL = 0x00000000U; \
RTI->CNT[1U].UCx = 0x00000000U; \
RTI->CNT[1U].FRCx = 0x00000000U; \
RTI->CNT[1U].CPUCx = (configCPU_CLOCK_HZ / 2 / configTICK_RATE_HZ) / 16; \
RTI->CMP[1U].UDCPx = (configCPU_CLOCK_HZ / 2 / configTICK_RATE_HZ) / 16; \
RTI->GCTRL = 0x00000002U; \
}
#define portGET_RUN_TIME_COUNTER_VALUE() (RTI->CNT[1].FRCx)
#endif
#endif /* __PORTMACRO_H__ */
#endif
/*----------------------------------------------------------------------------*/
@@ -54,7 +54,7 @@ static const t_isrFuncPTR s_vim_init[] =
phantomInterrupt,
phantomInterrupt,
phantomInterrupt,
vPreemptiveTick, /* RTI */
vPortPreemptiveTick, /* RTI */
phantomInterrupt,
phantomInterrupt,
phantomInterrupt,
@@ -43,8 +43,8 @@ typedef void (*t_isrFuncPTR)();
extern void phantomInterrupt(void);
extern void esmHighLevelInterrupt(void);
extern void vPreemptiveTick(void);
extern void vNonPreemptiveTick(void);
extern void vPortPreemptiveTick(void);
extern void vPortNonPreemptiveTick(void);
extern void vPortYeildWithinAPI(void);