mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-05-28 16:09:03 -04:00
Continue work on the SH2A port.
This commit is contained in:
parent
04c48138a8
commit
9b27b75715
48
Source/portable/Renesas/SH2A_FPU/ISR_Support.inc
Normal file
48
Source/portable/Renesas/SH2A_FPU/ISR_Support.inc
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
.macro portSAVE_CONTEXT
|
||||||
|
|
||||||
|
; Save r0 to r14 and pr.
|
||||||
|
movml.l r15, @-r15
|
||||||
|
|
||||||
|
; Save mac1, mach and gbr
|
||||||
|
sts.l macl, @-r15
|
||||||
|
sts.l mach, @-r15
|
||||||
|
stc.l gbr, @-r15
|
||||||
|
|
||||||
|
; Get the address of pxCurrentTCB
|
||||||
|
mov.l #_pxCurrentTCB, r0
|
||||||
|
|
||||||
|
; Get the address of pxTopOfStack from the TCB.
|
||||||
|
mov.l @r0, r0
|
||||||
|
|
||||||
|
; Save the stack pointer in pxTopOfStack.
|
||||||
|
mov.l r15, @r0
|
||||||
|
|
||||||
|
.endm
|
||||||
|
|
||||||
|
;-----------------------------------------------------------
|
||||||
|
|
||||||
|
.macro portRESTORE_CONTEXT
|
||||||
|
|
||||||
|
; Get the address of the pxCurrentTCB variable.
|
||||||
|
mov.l #_pxCurrentTCB, r0
|
||||||
|
|
||||||
|
; Get the address of the task stack from pxCurrentTCB.
|
||||||
|
mov.l @r0, r0
|
||||||
|
|
||||||
|
; Get the task stack itself into the stack pointer.
|
||||||
|
mov.l @r0, r15
|
||||||
|
|
||||||
|
; Restore system registers.
|
||||||
|
ldc.l @r15+, gbr
|
||||||
|
lds.l @r15+, mach
|
||||||
|
lds.l @r15+, macl
|
||||||
|
|
||||||
|
; Restore r0 to r14 and PR
|
||||||
|
movml.l @r15+, r15
|
||||||
|
|
||||||
|
; Pop the SR and PC to jump to the start of the task.
|
||||||
|
rte
|
||||||
|
nop
|
||||||
|
|
||||||
|
.endm
|
||||||
|
;-----------------------------------------------------------
|
|
@ -241,7 +241,7 @@ long lInterruptMask;
|
||||||
trapa( portYIELD_TRAP_NO );
|
trapa( portYIELD_TRAP_NO );
|
||||||
|
|
||||||
/* Restore the interrupt mask to whatever it was previously (when the
|
/* Restore the interrupt mask to whatever it was previously (when the
|
||||||
function was entered. */
|
function was entered). */
|
||||||
set_imask( ( int ) lInterruptMask );
|
set_imask( ( int ) lInterruptMask );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -290,8 +290,3 @@ extern void * volatile pxCurrentTCB;
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,54 +65,7 @@
|
||||||
|
|
||||||
.section P
|
.section P
|
||||||
|
|
||||||
.macro portSAVE_CONTEXT
|
.INCLUDE "ISR_Support.inc"
|
||||||
|
|
||||||
; Save r0 to r14 and pr.
|
|
||||||
movml.l r15, @-r15
|
|
||||||
|
|
||||||
; Save mac1, mach and gbr
|
|
||||||
sts.l macl, @-r15
|
|
||||||
sts.l mach, @-r15
|
|
||||||
stc.l gbr, @-r15
|
|
||||||
|
|
||||||
; Get the address of pxCurrentTCB
|
|
||||||
mov.l #_pxCurrentTCB, r0
|
|
||||||
|
|
||||||
; Get the address of pxTopOfStack from the TCB.
|
|
||||||
mov.l @r0, r0
|
|
||||||
|
|
||||||
; Save the stack pointer in pxTopOfStack.
|
|
||||||
mov.l r15, @r0
|
|
||||||
|
|
||||||
.endm
|
|
||||||
|
|
||||||
;-----------------------------------------------------------
|
|
||||||
|
|
||||||
.macro portRESTORE_CONTEXT
|
|
||||||
|
|
||||||
; Get the address of the pxCurrentTCB variable.
|
|
||||||
mov.l #_pxCurrentTCB, r0
|
|
||||||
|
|
||||||
; Get the address of the task stack from pxCurrentTCB.
|
|
||||||
mov.l @r0, r0
|
|
||||||
|
|
||||||
; Get the task stack itself into the stack pointer.
|
|
||||||
mov.l @r0, r15
|
|
||||||
|
|
||||||
; Restore system registers.
|
|
||||||
ldc.l @r15+, gbr
|
|
||||||
lds.l @r15+, mach
|
|
||||||
lds.l @r15+, macl
|
|
||||||
|
|
||||||
; Restore r0 to r14 and PR
|
|
||||||
movml.l @r15+, r15
|
|
||||||
|
|
||||||
; Pop the SR and PC to jump to the start of the task.
|
|
||||||
rte
|
|
||||||
nop
|
|
||||||
|
|
||||||
.endm
|
|
||||||
;-----------------------------------------------------------
|
|
||||||
|
|
||||||
_vPortStartFirstTask:
|
_vPortStartFirstTask:
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,9 @@ portSTACK_TYPE and portBASE_TYPE. */
|
||||||
void vPortYield( void );
|
void vPortYield( void );
|
||||||
#define portYIELD() vPortYield()
|
#define portYIELD() vPortYield()
|
||||||
|
|
||||||
|
extern void vTaskSwitchContext( void );
|
||||||
|
#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) vTaskSwitchContext()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function tells the kernel that the task referenced by xTask is going to
|
* This function tells the kernel that the task referenced by xTask is going to
|
||||||
* use the floating point registers and therefore requires the floating point
|
* use the floating point registers and therefore requires the floating point
|
||||||
|
|
Loading…
Reference in a new issue