]> git.sur5r.net Git - freertos/commitdiff
Basic demo up and running.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 8 Aug 2008 12:50:22 +0000 (12:50 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 8 Aug 2008 12:50:22 +0000 (12:50 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@437 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/GCC/ColdFire_V2/port.c
Source/portable/GCC/ColdFire_V2/portasm.S
Source/portable/GCC/ColdFire_V2/portmacro.h

index 315562165c0c856476525da7bb2788d933aa1ce2..409d8be2626cfdbfdf926b6fc5caa40fbf1b30bb 100644 (file)
@@ -125,17 +125,12 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE * pxTopOfStack, pdTASK_COD
 \r
 portBASE_TYPE xPortStartScheduler( void )\r
 {\r
+extern void vPortStartFirstTask( void );\r
+\r
        ulCriticalNesting = 0UL;\r
 \r
        vApplicationSetupInterrupts();\r
-\r
-       asm volatile(\r
-                                       "move.l         pxCurrentTCB, %sp                               \n\t"\\r
-                                       "move.l         (%sp), %sp                                              \n\t"\\r
-                                       "movem.l        (%sp), %d0-%fp                                  \n\t"\\r
-                                       "lea.l          %sp@(60), %sp                                   \n\t"\\r
-                                       "rte                                                                                "\r
-                               );\r
+       vPortStartFirstTask();\r
 \r
        return pdFALSE;\r
 }\r
@@ -173,6 +168,13 @@ void vPortClearInterruptMaskFromISR( unsigned portBASE_TYPE uxSavedInterruptMask
 {\r
 }\r
 \r
+void vPortClearYield( void )\r
+{\r
+       /* -32 as we are using the high word of the 64bit mask. */\r
+       MCF_INTC0_INTFRCH &= ~( 1UL << ( configYIELD_INTERRUPT_VECTOR - 32UL ) );\r
+}\r
+\r
+\r
 \r
 \r
 \r
index aee34d3c8b3041540e14fdc5aea28c261ca60d82..84be3b7298b8073783526c5ed86581f8e89a691a 100644 (file)
@@ -9,9 +9,31 @@
  */\r
 \r
     .global ulPortSetIPL\r
+    .global __cs3_isr_interrupt_127\r
+    .global __cs3_isr_interrupt_119\r
+    .global vPortStartFirstTask\r
 \r
     .text\r
 \r
+.macro portSAVE_CONTEXT\r
+\r
+       lea.l           (-60, %sp), %sp\r
+       movem.l         %d0-%fp, (%sp)\r
+       move.l          pxCurrentTCB, %a0\r
+       move.l          %sp, (%a0)\r
+\r
+       .endm\r
+\r
+.macro portRESTORE_CONTEXT\r
+\r
+       move.l          pxCurrentTCB, %sp\r
+       move.l          (%sp), %sp\r
+       movem.l         (%sp), %d0-%fp\r
+       lea.l           %sp@(60), %sp\r
+       rte\r
+\r
+       .endm\r
+\r
 /********************************************************************/\r
 /*\r
  * This routines changes the IPL to the value passed into the routine.\r
@@ -47,6 +69,20 @@ ulPortSetIPL:
     rts\r
 \r
 /********************************************************************/\r
+\r
+/* Yield interrupt. */\r
+__cs3_isr_interrupt_127:\r
+       portSAVE_CONTEXT\r
+       jsr vPortClearYield\r
+       jsr vTaskSwitchContext\r
+       portRESTORE_CONTEXT\r
+\r
+/********************************************************************/\r
+\r
+\r
+vPortStartFirstTask:\r
+       portRESTORE_CONTEXT\r
+\r
     .end\r
 \r
 \r
index 3cd00193d44a975e0960c306b8163ce47cf46a37..248d8bdd011d48b71d87e9385036358740f1526a 100644 (file)
@@ -106,7 +106,8 @@ extern void vPortClearInterruptMaskFromISR( unsigned portBASE_TYPE );
 \r
 /* Task utilities. */\r
 \r
-#define portYIELD()\r
+#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. */\r
+\r
 \r
 \r
 #define portNOP()      asm volatile (  "nop" )\r