]> git.sur5r.net Git - freertos/blobdiff - Source/portable/Renesas/RX600/port.c
Continue work on RX600 port - work in progress.
[freertos] / Source / portable / Renesas / RX600 / port.c
index e41221f618c74a0736edaf83aea8c44c9370d840..2998d30cdf0e71ed5bc327bec271647bf9a00607 100644 (file)
@@ -62,6 +62,9 @@
 /* Library includes. */\r
 #include "string.h"\r
 \r
+/* Hardware specifics. */\r
+#include "iodefine.h"\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 /* Tasks should start with interrupts enabled, therefore PSW is set with U,I,PM \r
@@ -72,8 +75,8 @@ flags set and IPL clear. */
  PM = 0 Supervisor mode.\r
  IPL = 0 All interrupt priorities enabled.\r
 */\r
-#define portINITIAL_PSW      ( ( portSTACK_TYPE ) 0x00030000 )\r
-#define portINITIAL_FPSW     ( ( portSTACK_TYPE ) 0x00000100 )\r
+#define portINITIAL_PSW     ( ( portSTACK_TYPE ) 0x00030000 )\r
+#define portINITIAL_FPSW    ( ( portSTACK_TYPE ) 0x00000100 )\r
 \r
 \r
 /*-----------------------------------------------------------*/\r
@@ -96,8 +99,6 @@ static void prvStartFirstTask( void );
 \r
 extern void *pxCurrentTCB;\r
 \r
-unsigned char ucIPLToRestore = 0;\r
-\r
 /*-----------------------------------------------------------*/\r
 \r
 /* \r
@@ -165,6 +166,15 @@ extern void vApplicationSetupTimerInterrupt( void );
                use.  A demo application is provided to show a suitable example. */\r
                vApplicationSetupTimerInterrupt();\r
 \r
+               /* Enable the software interrupt. */            \r
+               _IEN( _ICU_SWINT ) = 1;\r
+               \r
+               /* Ensure the software interrupt is clear. */\r
+               _IR( _ICU_SWINT ) = 0;\r
+               \r
+               /* Ensure the software interrupt is set to the kernel priority. */\r
+               _IPR( _ICU_SWINT ) = configKERNEL_INTERRUPT_PRIORITY;\r
+       \r
                /* Start the first task. */\r
                prvStartFirstTask();\r
        }\r
@@ -180,48 +190,29 @@ void vPortEndScheduler( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortYield( void )\r
-{\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-#pragma interrupt (vTickISR(vect=configTICK_VECTOR,enable))\r
+#pragma interrupt ( vTickISR( vect = _VECT( configTICK_VECTOR ), enable ) )\r
 void vTickISR( void )\r
 {\r
-       /* Restore previous IPL on exit. */\r
-       //set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
+static volatile unsigned long ul = 0;\r
+\r
+       ul++;\r
        \r
        /* Clear the interrupt. */\r
-       vTaskIncrementTick();\r
+//     vTaskIncrementTick();\r
        \r
        #if( configUSE_PREEMPTION == 1 )\r
-               taskYIELD();\r
+//             taskYIELD();\r
        #endif\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortSetInterruptMask( void )\r
+#pragma interrupt ( vSoftwareInterruptISR( vect = _VECT( _ICU_SWINT ), enable ) )\r
+void vSoftwareInterruptISR( void )\r
 {\r
-unsigned char ucPreviousIPL;\r
+static volatile unsigned long ul = 0;\r
 \r
-       /* Store the current IPL to ensure it is restored correctly later if it is\r
-       not currently 0.  This is a stack variable, so there should not be a race\r
-       condition even if there is an interrupt or context switch before the new\r
-       IPL value gets set. */\r
-       ucPreviousIPL = get_ipl();\r
-       \r
-       /* Set the mask up to the max syscall priority. */\r
-       set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
-       \r
-       /* Now the mask is set there will not be a context switch, so the previous\r
-       and current IPL values can be compared.  This ensures against the IPL being\r
-       set back to zero too early when critical sections nest. */\r
-       if( ucPreviousIPL < configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
-       {\r
-               ucIPLToRestore = ucPreviousIPL;\r
-       }\r
+       ul++;\r
 }\r
-/*-----------------------------------------------------------*/\r
 \r
 #pragma inline_asm prvStartFirstTask\r
 static void prvStartFirstTask( void )\r
@@ -250,3 +241,5 @@ static void prvStartFirstTask( void )
     NOP\r
     NOP\r
 }\r
+\r
+\r