mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 13:31:58 -04:00
Basic demo up and running.
This commit is contained in:
parent
5ff84b9869
commit
181889d6b1
|
@ -125,17 +125,12 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack, pdTASK_COD
|
||||||
|
|
||||||
portBASE_TYPE xPortStartScheduler( void )
|
portBASE_TYPE xPortStartScheduler( void )
|
||||||
{
|
{
|
||||||
|
extern void vPortStartFirstTask( void );
|
||||||
|
|
||||||
ulCriticalNesting = 0UL;
|
ulCriticalNesting = 0UL;
|
||||||
|
|
||||||
vApplicationSetupInterrupts();
|
vApplicationSetupInterrupts();
|
||||||
|
vPortStartFirstTask();
|
||||||
asm volatile(
|
|
||||||
"move.l pxCurrentTCB, %sp \n\t"\
|
|
||||||
"move.l (%sp), %sp \n\t"\
|
|
||||||
"movem.l (%sp), %d0-%fp \n\t"\
|
|
||||||
"lea.l %sp@(60), %sp \n\t"\
|
|
||||||
"rte "
|
|
||||||
);
|
|
||||||
|
|
||||||
return pdFALSE;
|
return pdFALSE;
|
||||||
}
|
}
|
||||||
|
@ -173,6 +168,13 @@ void vPortClearInterruptMaskFromISR( unsigned portBASE_TYPE uxSavedInterruptMask
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vPortClearYield( void )
|
||||||
|
{
|
||||||
|
/* -32 as we are using the high word of the 64bit mask. */
|
||||||
|
MCF_INTC0_INTFRCH &= ~( 1UL << ( configYIELD_INTERRUPT_VECTOR - 32UL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,31 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.global ulPortSetIPL
|
.global ulPortSetIPL
|
||||||
|
.global __cs3_isr_interrupt_127
|
||||||
|
.global __cs3_isr_interrupt_119
|
||||||
|
.global vPortStartFirstTask
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
|
.macro portSAVE_CONTEXT
|
||||||
|
|
||||||
|
lea.l (-60, %sp), %sp
|
||||||
|
movem.l %d0-%fp, (%sp)
|
||||||
|
move.l pxCurrentTCB, %a0
|
||||||
|
move.l %sp, (%a0)
|
||||||
|
|
||||||
|
.endm
|
||||||
|
|
||||||
|
.macro portRESTORE_CONTEXT
|
||||||
|
|
||||||
|
move.l pxCurrentTCB, %sp
|
||||||
|
move.l (%sp), %sp
|
||||||
|
movem.l (%sp), %d0-%fp
|
||||||
|
lea.l %sp@(60), %sp
|
||||||
|
rte
|
||||||
|
|
||||||
|
.endm
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
/*
|
/*
|
||||||
* This routines changes the IPL to the value passed into the routine.
|
* This routines changes the IPL to the value passed into the routine.
|
||||||
|
@ -47,6 +69,20 @@ ulPortSetIPL:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
|
||||||
|
/* Yield interrupt. */
|
||||||
|
__cs3_isr_interrupt_127:
|
||||||
|
portSAVE_CONTEXT
|
||||||
|
jsr vPortClearYield
|
||||||
|
jsr vTaskSwitchContext
|
||||||
|
portRESTORE_CONTEXT
|
||||||
|
|
||||||
|
/********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
vPortStartFirstTask:
|
||||||
|
portRESTORE_CONTEXT
|
||||||
|
|
||||||
.end
|
.end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,8 @@ extern void vPortClearInterruptMaskFromISR( unsigned portBASE_TYPE );
|
||||||
|
|
||||||
/* Task utilities. */
|
/* Task utilities. */
|
||||||
|
|
||||||
#define portYIELD()
|
#define portYIELD() MCF_INTC0_INTFRCH |= ( 1UL << ( configYIELD_INTERRUPT_VECTOR - 32UL ) ); portNOP(); portNOP(); portNOP(); /* -32 as we are using the high word of the 64bit mask. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define portNOP() asm volatile ( "nop" )
|
#define portNOP() asm volatile ( "nop" )
|
||||||
|
|
Loading…
Reference in a new issue