]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Fixes for task switching when swapping in the same task again. Continuing with the...
authormahi <devnull@localhost>
Tue, 2 Mar 2010 18:44:02 +0000 (19:44 +0100)
committermahi <devnull@localhost>
Tue, 2 Mar 2010 18:44:02 +0000 (19:44 +0100)
18 files changed:
arch/arm/arm_cm3/drivers/Mcu.c
arch/arm/arm_cm3/kernel/arch.c
arch/hc1x/hcs12d/kernel/arch.c
arch/ppc/mpc55xx/drivers/Mcu.c
arch/ppc/mpc55xx/kernel/arch.c
arch/ppc/mpc55xx/kernel/arch_krn.sx
arch/ppc/mpc55xx/scripts/linkscript_gcc.ldf
boards/et_stm32_stamp/config/Mcu_Cfg.c
boards/mpc551xsim/config/Mcu_Cfg.c
boards/mpc5554sim/config/Mcu_Cfg.c
boards/mpc5567qrtech/config/Mcu_Cfg.c
boards/mpc563xsim/config/Mcu_Cfg.c
include/Mcu.h
system/kernel/include/arch.h
system/kernel/init.c
system/kernel/task.c
system/kernel/testsystem/test_01_task.c
system/kernel/testsystem/test_master.c

index 35105872982fb61c0b0bb00841db6cc4364ed033..8ef789763434af4e1cb0c4546a2567c5859eae56 100644 (file)
@@ -275,7 +275,7 @@ Std_ReturnType Mcu_InitClock(const Mcu_ClockType ClockSetting)
 \r
 #if defined(USE_DEBUG)\r
   {\r
-    uint32    extal = Mcu_Global.config->McuClockSettingConfig[Mcu_Global.clockSetting].McuClockReferencePoint;\r
+    uint32    extal = Mcu_Global.config->McuClockSettingConfig[Mcu_Global.clockSetting].McuClockReferencePointFrequency;\r
     uint32    f_sys;\r
 \r
     f_sys = CALC_SYSTEM_CLOCK( extal,\r
@@ -424,7 +424,7 @@ uint32_t McuE_GetSystemClock(void)
   // TODO: This of course wrong....\r
   uint32_t f_sys = 72000000UL;\r
 #if 0\r
-  uint32  extal = Mcu_Global.config->McuClockSettingConfig[Mcu_Global.clockSetting].McuClockReferencePoint;\r
+  uint32  extal = Mcu_Global.config->McuClockSettingConfig[Mcu_Global.clockSetting].McuClockReferencePointFrequency;\r
 \r
   f_sys =  CALC_SYSTEM_CLOCK(extal,emfd,eprediv,erfd);\r
 #endif\r
index fd8a8e3448805b07b5540fe8042e4f353ba55904..141027fd728c6ebc432bb646f85718fac46623bc 100644 (file)
@@ -38,7 +38,7 @@
  * we call a task for the first time.\r
  */\r
 \r
-void os_arch_first_call( void )\r
+void Os_ArchFirstCall( void )\r
 {\r
        // TODO: make switch here... for now just call func.
        Irq_Enable();\r
@@ -55,7 +55,7 @@ unsigned int Os_ArchGetScSize( void ) {
 }\r
 
 \r
-void os_arch_setup_context( OsPcbType *pcb ) {\r
+void Os_ArchSetupContext( OsPcbType *pcb ) {\r
        // TODO: Add lots of things here, see ppc55xx\r
        uint32_t *context = (uint32_t *)pcb->stack.curr;\r
        context[C_CONTEXT_OFFS/4] = SC_PATTERN;\r
@@ -67,9 +67,9 @@ void os_arch_setup_context( OsPcbType *pcb ) {
                context[VGPR_LR_OFF/4] = (uint32_t)Os_TaskStartBasic;\r
        }
        os_arch_stack_set_endmark(pcb);\r
-// os_arch_setup_context_asm(pcb->stack.curr,NULL);\r
+// Os_ArchSetupContext_asm(pcb->stack.curr,NULL);\r
 }\r
 \r
-void os_arch_init( void ) {\r
+void Os_ArchInit( void ) {\r
        // nothing to do here, yet :)\r
 }\r
index 21c6a99d7c890cbcce7aec1c508f4ae06c7f5e34..aa41d7de658390dcc86bc0d0086a697c749d69a1 100644 (file)
@@ -1,29 +1,29 @@
-/* -------------------------------- Arctic Core ------------------------------
- * Arctic Core - the open source AUTOSAR platform http://arccore.com
- *
- * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
- *
- * This source code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by the
- * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- * -------------------------------- Arctic Core ------------------------------*/
-
-#include "internal.h"
-#include "context.h"
+/* -------------------------------- Arctic Core ------------------------------\r
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
+ *\r
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
+ *\r
+ * This source code is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License version 2 as published by the\r
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
+ * for more details.\r
+ * -------------------------------- Arctic Core ------------------------------*/\r
+\r
+#include "internal.h"\r
+#include "context.h"\r
 \r
 /**\r
  * Function make sure that we switch to supervisor mode(rfi) before\r
  * we call a task for the first time.\r
  */\r
 \r
-void os_arch_first_call( void )\r
+void Os_ArchFirstCall( void )\r
 {\r
-       // TODO: make switch here... for now just call func.
+       // TODO: make switch here... for now just call func.\r
        Irq_Enable();\r
        os_sys.curr_pcb->entry();\r
 }\r
@@ -36,9 +36,9 @@ void *Os_ArchGetStackPtr( void ) {
 unsigned int Os_ArchGetScSize( void ) {\r
        return SC_SIZE;\r
 }\r
-
 \r
-void os_arch_setup_context( OsPcbType *pcb ) {\r
+\r
+void Os_ArchSetupContext( OsPcbType *pcb ) {\r
        // TODO: Add lots of things here, see ppc55xx\r
        uint32_t *context = (uint32_t *)pcb->stack.curr;\r
        context[C_CONTEXT_OFF/4] = SC_PATTERN;\r
@@ -48,30 +48,30 @@ void os_arch_setup_context( OsPcbType *pcb ) {
                context[VGPR_LR_OFF/4] = (uint32_t)Os_TaskStartExtended;\r
        } else if( pcb->proc_type == PROC_BASIC ) {\r
                context[VGPR_LR_OFF/4] = (uint32_t)Os_TaskStartBasic;\r
-       }
+       }\r
        Os_StackSetEndmark(pcb);\r
-// os_arch_setup_context_asm(pcb->stack.curr,NULL);\r
+// Os_ArchSetupContext_asm(pcb->stack.curr,NULL);\r
+}\r
+\r
+/**\r
+ *\r
+ * @param pcbPtr\r
+ */\r
+\r
+void OsArch_SetTaskEntry(OsPcbType *pcbPtr ) {\r
+       uint32_t *context = (uint32_t *)pcbPtr->stack.curr;\r
+\r
+       context[C_CONTEXT_OFF/4] = SC_PATTERN;\r
+\r
+       /* Set LR to start function */\r
+       if( pcbPtr->proc_type == PROC_EXTENDED ) {\r
+               context[C_LR_OFF/4] = (uint32_t)Os_TaskStartExtended;\r
+       } else if( pcbPtr->proc_type == PROC_BASIC ) {\r
+               context[C_LR_OFF/4] = (uint32_t)Os_TaskStartBasic;\r
+       }\r
 }\r
-
-/**
- *
- * @param pcbPtr
- */
-
-void OsArch_SetTaskEntry(OsPcbType *pcbPtr ) {
-       uint32_t *context = (uint32_t *)pcbPtr->stack.curr;
-
-       context[C_CONTEXT_OFF/4] = SC_PATTERN;
-
-       /* Set LR to start function */
-       if( pcbPtr->proc_type == PROC_EXTENDED ) {
-               context[C_LR_OFF/4] = (uint32_t)Os_TaskStartExtended;
-       } else if( pcbPtr->proc_type == PROC_BASIC ) {
-               context[C_LR_OFF/4] = (uint32_t)Os_TaskStartBasic;
-       }
-}
-
 \r
-void os_arch_init( void ) {\r
+\r
+void Os_ArchInit( void ) {\r
        // nothing to do here, yet :)\r
 }\r
index 258b239429cf88adc91bca6d474e21cf802cc42c..fefb85cc6040e90a6e78d4ca6b692cc6ae28a68e 100644 (file)
@@ -347,7 +347,7 @@ Std_ReturnType Mcu_InitClock(const Mcu_ClockType ClockSetting)
 \r
 #if defined(USE_DEBUG)\r
   {\r
-    uint32    extal = Mcu_Global.config->McuClockSettingConfig[Mcu_Global.clockSetting].McuClockReferencePoint;\r
+    uint32    extal = Mcu_Global.config->McuClockSettingConfig[Mcu_Global.clockSetting].McuClockReferencePointFrequency;\r
     uint32    f_sys;\r
 \r
     f_sys = CALC_SYSTEM_CLOCK( extal,\r
index d8ef2b6ff112e2002f301e3e35079b18bd804b64..528128ad6ae35724900c33d7d989a056a7e95899 100644 (file)
@@ -24,7 +24,7 @@
  * Function make sure that we switch to supervisor mode(rfi) before\r
  * we call a task for the first time.\r
  */\r
-void os_arch_first_call( void )\r
+void Os_ArchFirstCall( void )\r
 {\r
 #if USE_MM_USER_MODE\r
 \r
@@ -92,19 +92,8 @@ void os_arch_stack_to_small(OsPcbType *pcb ,uint32_t size_min) {
  *\r
  */\r
 \r
-void os_arch_setup_context( OsPcbType *pcb ) {\r
+void Os_ArchSetupContext( OsPcbType *pcb ) {\r
        uint32_t msr;\r
-       // Note! stack.curr already points to where to save the context\r
-\r
-       // Check that the stack size is enough\r
-       #define STACK_SIZE_MIN  (SC_SIZE + 16*2 )
-
-#if 0\r
-       if( pcb->stack.size < (STACK_SIZE_MIN) ) {\r
-               os_arch_stack_to_small(pcb, STACK_SIZE_MIN);\r
-       }\r
-#endif
-
 \r
        msr = MSR_EE;\r
 \r
@@ -158,7 +147,7 @@ void os_arch_print_context( char *str, OsPcbType *pcb ) {
 }\r
 \r
 \r
-void os_arch_init( void ) {\r
+void Os_ArchInit( void ) {\r
 #if defined(CFG_SPE)\r
        uint32_t msr = get_msr();\r
        msr |= MSR_SPE;\r
index 7a1be86117d512fb3318b0413529f01b4a94a9de..f3058d2fb1b0c5b48cb4c323aef37655a039a0a1 100644 (file)
@@ -71,8 +71,14 @@ dummy_int:
 .global Os_ArchSwapContextToW\r
 .global Os_ArchSwapContextTo\r
 .global Os_ArchSwapContext\r
+.global Os_ArchSetSpAndCall\r
 .section .text\r
 \r
+Os_ArchSetSpAndCall:\r
+               mr r1,r3\r
+               mtlr r4\r
+               blr\r
+\r
 Os_ArchSwapContextToW:\r
                mr              r1,r5\r
                b               Os_ArchSwapContextTo\r
index 0e37084c24ee8e8657c9ed81fab8507313725f0d..34b899e453139d0bb21159a511f0ee5e40c130c6 100644 (file)
@@ -25,7 +25,11 @@ SECTIONS
 \r
     .text :\r
        {\r
-       *(.text .text.* .init .fini* .eini* .gnu.linkonce* .gnu.warning)\r
+       *(.text .text.* .init .fini* .eini* .gnu.linkonce* .gnu.warning);\r
+       PROVIDE( btask_sup_matrix = .);\r
+       SORT(*)(.test_btask);\r
+       PROVIDE( etask_sup_matrix = .);\r
+       SORT(*)(.test_etask);\r
        } > flash\r
 \r
        .fls_rom : {\r
index a3e6e3cd31f772af320f6cc9b6b3cda19a2949a1..8971bc3c35862327ecaab548f74acd1f695b1aa6 100644 (file)
@@ -35,13 +35,13 @@ Mcu_RamSectorSettingConfigType Mcu_RamSectorSettingConfigData[] = {
 Mcu_ClockSettingConfigType Mcu_ClockSettingConfigData[] =\r
 {\r
   {\r
-    .McuClockReferencePoint = 8000000UL,\r
+    .McuClockReferencePointFrequency = 8000000UL,\r
     .Pll1 = 1,\r
     .Pll2    = 104,\r
     .Pll3    = 5,\r
   },\r
   {\r
-    .McuClockReferencePoint = 16000000UL,\r
+    .McuClockReferencePointFrequency = 16000000UL,\r
     .Pll1 = 3,\r
     .Pll2    = 83,\r
     .Pll3    = 5,\r
index 274fd6c161198948fa216ce3f02593584120ab32..8eca88923561cdad70abba9d565657fae37bee1f 100644 (file)
@@ -41,13 +41,13 @@ Mcu_RamSectorSettingConfigType Mcu_RamSectorSettingConfigData[] = {
 Mcu_ClockSettingConfigType Mcu_ClockSettingConfigData[] =\r
 {\r
   {\r
-    .McuClockReferencePoint = 8000000UL,\r
+    .McuClockReferencePointFrequency = 8000000UL,\r
     .Pll1 = 1,\r
     .Pll2    = 104,\r
     .Pll3    = 5,\r
   },\r
   {\r
-    .McuClockReferencePoint = 16000000UL,\r
+    .McuClockReferencePointFrequency = 16000000UL,\r
     .Pll1 = 3,\r
     .Pll2   = 83,\r
     .Pll3    = 5,\r
index f9e522a507f24a3da6da7d45ef6761f4e50fb248..bc46337f1db21059708cfa3da856e6a48069516f 100644 (file)
@@ -41,13 +41,13 @@ Mcu_RamSectorSettingConfigType Mcu_RamSectorSettingConfigData[] = {
 Mcu_ClockSettingConfigType Mcu_ClockSettingConfigData[] =\r
 {\r
   {\r
-    .McuClockReferencePoint = 8000000UL,\r
+    .McuClockReferencePointFrequency = 8000000UL,\r
     .Pll1 = 1,\r
     .Pll2    = 104,\r
     .Pll3    = 5,\r
   },\r
   {\r
-    .McuClockReferencePoint = 16000000UL,\r
+    .McuClockReferencePointFrequency = 16000000UL,\r
     .Pll1 = 3,\r
     .Pll2    = 83,\r
     .Pll3    = 5,\r
index a5e12b52c5783ae1b9799d8a417e0b558e93156c..c8271f8063faaf8b3347d1111c531bac35466d41 100644 (file)
@@ -41,7 +41,7 @@ Mcu_RamSectorSettingConfigType Mcu_RamSectorSettingConfigData[] = {
 Mcu_ClockSettingConfigType Mcu_ClockSettingConfigData[] =\r
 {\r
   {\r
-    .McuClockReferencePoint = 16000000UL,\r
+    .McuClockReferencePointFrequency = 16000000UL,\r
     .Pll1 = 2,\r
     .Pll2    = 11,\r
     .Pll3    = 0,\r
index 2d8019f10c7c3b73dd11ae861ed48c0b574c7b8a..987050b5ca26be17d3cbd1020af780a26f82f7f7 100644 (file)
@@ -41,13 +41,13 @@ Mcu_RamSectorSettingConfigType Mcu_RamSectorSettingConfigData[] = {
 Mcu_ClockSettingConfigType Mcu_ClockSettingConfigData[] =\r
 {\r
   {\r
-    .McuClockReferencePoint = 8000000UL,\r
+    .McuClockReferencePointFrequency = 8000000UL,\r
     .Pll1 = 1,\r
     .Pll2    = 104,\r
     .Pll3    = 5,\r
   },\r
   {\r
-    .McuClockReferencePoint = 40000000UL,\r
+    .McuClockReferencePointFrequency = 40000000UL,\r
     .Pll1 = 3,\r
     .Pll2    = 83,\r
     .Pll3    = 5,\r
index 6513daa4640f5bb043a97db9ca3b768257fb2e2a..6bfb88f3f4fca9f15e7cdf7b113b1bc502a6d515 100644 (file)
 
 #ifndef MCU_H_\r
 #define MCU_H_\r
-
-#define MCU_SW_MAJOR_VERSION   2
-#define MCU_SW_MINOR_VERSION   0
-#define MCU_SW_PATCH_VERSION   0
 \r
 #include "Cpu.h"\r
 #include "irq_types.h"
@@ -171,8 +167,8 @@ void Mcu_PerformReset( void );
 void Mcu_SetMode( const Mcu_ModeType McuMode );\r
 \r
 #if ( MCU_VERSION_INFO_API == STD_ON )\r
-#define MCU_SW_MAJOR_VERSION           1\r
-#define MCU_SW_MINOR_VERSION                   0\r
+#define MCU_SW_MAJOR_VERSION           2\r
+#define MCU_SW_MINOR_VERSION           0\r
 #define MCU_SW_PATCH_VERSION           0\r
 #define MCU_AR_MAJOR_VERSION           2\r
 #define MCU_AR_MINOR_VERSION           2\r
index a859302de59950a69e484e2a1d9dd0131889767e..3f8d1e3952a352f0b57bacf6179ecf6b67ac314a 100644 (file)
@@ -26,7 +26,7 @@
 #define STACK_PATTERN  0x42
 
 
-
+#if 0
 /**
  * Swap context with a context. The difference between this
  * function and Os_ArchSwapContext is that the later use
  * @param context Ptr to context
  * @return
  */
+
 void Os_ArchSwapContextToW(void *old,void *new, void *context );
+#endif
+
+
+/**
+ * Set the stack pointer to sp and call function f.
+ *
+ * @param sp    Pointer to the stack
+ * @param f     Pointer to the function to call.
+ *
+ */
+void Os_ArchSetSpAndCall(void *sp, void (*f)(void) );
 \r
 /**\r
  * Swap context.\r
@@ -67,7 +79,7 @@ void Os_ArchSwapContextTo(void *old,void *new);
  *\r
  * @param pcb Ptr to pcb
  */\r
-void os_arch_setup_context( OsPcbType *pcb );\r
+void Os_ArchSetupContext( OsPcbType *pcb );\r
 \r
 /**\r
  * Get current stack pointer\r
@@ -82,7 +94,7 @@ void *Os_ArchGetStackPtr( void );
  * - interrupt controller\r
  * - timers\r
  */\r
-void os_arch_init( void );\r
+void Os_ArchInit( void );\r
 \r
 /**\r
  * Function that is used when task entry is called for the\r
@@ -92,7 +104,7 @@ void os_arch_init( void );
  * When user mode is supported a switch to user mode must be done\r
  * in some way. A trap maybe?\r
  */\r
-void os_arch_first_call( void );\r
+void Os_ArchFirstCall( void );\r
 \r
 \r
 /**\r
index 27571d16d93a2366a208260742867b16dad2fb6e..8e070e30ee5c19051b2300567d33f33ee4e07f90 100644 (file)
@@ -165,7 +165,7 @@ void InitOS( void ) {
        /* Clear sys */
        memset(&os_sys,0,sizeof(sys_t));
 
-       os_arch_init();
+       Os_ArchInit();
 
        // Assign pcb list and init ready queue
        os_sys.pcb_list = pcb_list;
index 19eda42752a42938329c1fea61badb0d2c4f69d4..8ec8f822612a00f91e17075a110aa24372af4d6e 100644 (file)
@@ -41,7 +41,7 @@ void Os_TaskStartExtended( void ) {
        Os_ResourceGetInternal();
        Os_TaskMakeRunning(pcb);
 
-       os_arch_first_call();
+       Os_ArchFirstCall();
 
        /** @req OS070 */
        Os_ResourceCheckAndRelease(pcb);
@@ -52,6 +52,8 @@ void Os_TaskStartExtended( void ) {
                Os_IrqClearAll();
        }
 
+#warning Dont I have to check this at terminate task also?
+
        /** @req OS069 */
        ERRORHOOK(E_OS_MISSINGEND);
 
@@ -72,7 +74,7 @@ void Os_TaskStartBasic( void ) {
        pcb = Os_TaskGetCurrent();
        Os_ResourceGetInternal();
        Os_TaskMakeRunning(pcb);
-       os_arch_first_call();
+       Os_ArchFirstCall();
 
        /** @req OS070 */
        Os_ResourceCheckAndRelease(pcb);
@@ -158,7 +160,7 @@ void Os_ContextInit( OsPcbType *pcb ) {
        Os_StackFill(pcb);
        OsArch_SetTaskEntry(pcb);
 
-       os_arch_setup_context(pcb);
+       Os_ArchSetupContext(pcb);
 }
 
 /**
@@ -167,9 +169,6 @@ void Os_ContextInit( OsPcbType *pcb ) {
  */
 void Os_ContextReInit( OsPcbType *pcbPtr ) {
        Os_StackSetup(pcbPtr);
-       OsArch_SetTaskEntry(pcbPtr);
-       // TODO: This really need to be done
-       os_arch_setup_context(pcbPtr);
 }
 
 /**
@@ -302,7 +301,7 @@ void Os_Dispatch( _Bool force ) {
        pcbPtr = Os_TaskGetTop();
        currPcbPtr = Os_TaskGetCurrent();
        /* Swap if we found any process or are forced (multiple activations)*/
-       if( pcbPtr != currPcbPtr || force ) {
+       if( pcbPtr != currPcbPtr ) {
                /* Add us to the ready list */
                if( currPcbPtr->state & ST_RUNNING ) {
                        Os_TaskRunningToReady(currPcbPtr);
@@ -349,10 +348,16 @@ void Os_Dispatch( _Bool force ) {
                 * 3. Normal swap -> Os_ArchSwapContext()
                 */
 
+#if 0
                /* Force is ONLY used from TerminateTask() */
                if( force ) {
-                       Os_ArchSwapContextToW(currPcbPtr ,pcbPtr, pcbPtr->stack.curr );
+                       Os_StackSetup(pcbPtr);
+                       OsArch_SetTaskEntry(pcbPtr);
+                       // TODO: This really need to be done
+                       Os_ArchSetupContext(pcbPtr);
+                       // Os_ArchSetSpAndCall(pcbPtr->stack.curr,Os_TaskStartBasic);
                }
+#endif
 
                Os_ArchSwapContext(currPcbPtr,pcbPtr);
 
@@ -364,10 +369,14 @@ void Os_Dispatch( _Bool force ) {
                PRETASKHOOK();
 
        } else {
+               Os_StackSetup(pcbPtr);
+               Os_ArchSetSpAndCall(pcbPtr->stack.curr,Os_TaskStartBasic);
+#if 0
                /* We haven't removed ourselves from the ready list? */
                assert(currPcbPtr->state != ST_WAITING);
                /* We have terminated and found us in the ready list? */
                assert(currPcbPtr->state != ST_SUSPENDED);
+#endif
        }
 }
 
@@ -505,6 +514,10 @@ StatusType ActivateTask( TaskType TaskID ) {
                         * state into ready state all its events are cleared.*/
                        pcb->ev_set = 0;
                        pcb->ev_wait = 0;
+               } else {
+                       Os_StackSetup(pcb);
+                       OsArch_SetTaskEntry(pcb);
+                       Os_ArchSetupContext(pcb);
                }
                Os_TaskMakeReady(pcb);
        } else {
@@ -530,7 +543,7 @@ StatusType ActivateTask( TaskType TaskID ) {
 
        /* Preempt only if higher prio than us */\r
        if(     (pcb->scheduling == FULL) &&
-               (os_sys.int_nest_cnt == 0) )
+               (os_sys.int_nest_cnt == 0) && (pcb->prio > Os_TaskGetCurrent()->prio) )
        {\r
                Os_Dispatch(0);\r
        }\r
@@ -584,7 +597,7 @@ StatusType TerminateTask( void ) {
        Irq_Save(flags);
 
        --curr_pcb->activations;
-       assert(curr_pcb->activations>=0);
+//     assert(curr_pcb->activations>=0);
 
        /*@req OSEK TerminateTask
         * In case of tasks with multiple activation requests,
@@ -596,15 +609,9 @@ StatusType TerminateTask( void ) {
        } else {
                /* We need to add ourselves to the ready list again,
                 * with a startup context. */
-
-
        }
-       /* We're manipulating the current stack here.
-        * Os_ArchSwapContext(old,new) saves on current stack.
-        * 1. We add an argument to Os_ArchSwapContext() to set the stack.
-        * 2. We could call ActivateTask here...
-        */
-       Os_ContextReInit(curr_pcb);
+
+//     Os_ContextReInit(curr_pcb);
 
        /* Force the dispatcher to find something, even if its us */
        Os_Dispatch(1);
index 68b107eae2fd738624cb5ed266219765c07acb38..6875335b528229ebf5f57466d067fbd1ea31702b 100644 (file)
@@ -201,3 +201,6 @@ void btask_sup_h_01(void) {
        }\r
 }\r
 \r
+__attribute__ ((section (".test_btask"))) const test_func_t btask_sup_matrix_01[3] = { btask_sup_l_01, btask_sup_m_01, btask_sup_h_01 };\r
+__attribute__ ((section (".test_etask"))) const test_func_t etask_sup_matrix_01[3] = { etask_sup_l_01, NULL, NULL };\r
+\r
index 247596f02980ddf338a4a1a7648c8a0872edd1ea..780f6542d89d1c5db4b91c48bd50b9dd6724be7c 100644 (file)
@@ -76,7 +76,8 @@ void etask_master( void ) {
        while(1);\r
 \r
 }\r
-\r
+
+#if 0\r
 test_func_t etask_sup_matrix[][3] = {\r
 /* 01*/        { etask_sup_l_01, NULL, NULL },
 #if 0\r
@@ -88,15 +89,21 @@ test_func_t etask_sup_matrix[][3] = {
 \r
 #define TEST_BASIC(nr) \\r
        { btest_sup_l_##nr , btest_sup_m_##nr , btest_sup_h_## nr }\r
+
 \r
 test_func_t btask_sup_matrix[][3] = {\r
-/* 01*/        { NULL, NULL, NULL},
+// /* 01*/     { NULL, NULL, NULL},
+               TEST_BASIC(01),
 #if 0\r
                TEST_BASIC(02),\r
 \r
 #endif\r
 }; // __attribute__ ((section(".data_app_2")));\r
-\r
+
+#else
+extern test_func_t etask_sup_matrix[][3];
+extern test_func_t btask_sup_matrix[][3];\r
+#endif
 \r
 //--------------------------------------------------------------------\r
 //--------------------------------------------------------------------\r