]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Fix to GetTaskID
authortojo <tobias.johansson@arccore.com>
Fri, 3 Dec 2010 15:13:03 +0000 (16:13 +0100)
committertojo <tobias.johansson@arccore.com>
Fri, 3 Dec 2010 15:13:03 +0000 (16:13 +0100)
system/kernel/task.c

index 56244cf11f5865b58eb4add7e278fed440c788e6..6a76e6af2c55be38cb1168a3f1153de00310d74c 100644 (file)
@@ -527,18 +527,14 @@ StatusType GetTaskID( TaskRefType TaskID ) {
        StatusType rv = E_OK;\r
        *TaskID = INVALID_TASK;\r
 \r
-\r
-       if( os_sys.curr_pcb->state & ST_RUNNING ) {\r
-               *TaskID = os_sys.curr_pcb->pid;\r
-       } else {\r
-               /* We have no running task, check level */\r
-\r
-               /* Call level is not from the OSEK specification but from the\r
-                * test specification.\r
-                * We cannot call ErrorHook here since the errorhook should be able to call this function.\r
-                * See 12-1 footnote 13 in OSEK OS specification. */\r
-               if( os_sys.int_nest_cnt != 0 ) {\r
-                       rv =  E_OS_CALLEVEL;\r
+       /* Test specification say return CALLEVEL if in ISR\r
+        * but impl. spec says otherwise */\r
+       if( os_sys.int_nest_cnt == 0 ) {\r
+               if( os_sys.curr_pcb->state & ST_RUNNING ) {\r
+                       *TaskID = os_sys.curr_pcb->pid;\r
+               } else {\r
+                       /* This is not a real error since this could\r
+                        * be the case when called from ErrorHook */
                }\r
        }\r
 \r