]> rtime.felk.cvut.cz Git - arc.git/blobdiff - system/kernel/include/sys.h
Isr almost done
[arc.git] / system / kernel / include / sys.h
index 9b72c5ccdbe0e0affbe144b6e8974df49fba0d5c..65a24db9b629320b4357b42e6ecf1ddd8083cb1b 100644 (file)
@@ -25,24 +25,29 @@ typedef enum  {
        OP_TERMINATE_TASK = 8,\r
        OP_SCHEDULE = 16,\r
        OP_CHAIN_TASK = 32,\r
-       OP_RELEASE_RESOURCE = 64,\r
+       OP_RELEASE_RESOURCE = 64\r
        OP_SLEEP = 128,\r
+\r
 } OpType ;\r
 \r
-typedef struct sys_s {\r
+/*\r
+ * Global system structure\r
+ */\r
+typedef struct Os_Sys {\r
 //     OsApplicationType *curr_application;\r
        /* Current running task*/\r
-       OsPcbType *curr_pcb;\r
+       OsTaskVarType *currTaskPtr;\r
+\r
        /* List of all tasks */\r
-       OsPcbType *pcb_list;\r
+       OsTaskVarType *pcb_list;\r
 \r
-       OsPcbType *chainedPcbPtr;\r
+       OsTaskVarType *chainedPcbPtr;\r
        /* Interrupt nested count */\r
-       uint32 int_nest_cnt;\r
+       uint32 intNestCnt;\r
        /* The current operation */\r
        uint8_t op;\r
        /* Ptr to the interrupt stack */\r
-       void *int_stack;\r
+       void *intStack;\r
        // The os tick\r
        TickType tick;\r
        // 1-The scheduler is locked (by GetResource() or something else)\r
@@ -59,35 +64,42 @@ typedef struct sys_s {
        /* Current Application mode */\r
        AppModeType appMode;\r
 \r
-//     uint32_t flags;\r
+#if    (OS_USE_APPLICATIONS == STD_ON)\r
+       ApplicationStateType currApplState;\r
+       ApplicationType currApplId;\r
+#endif\r
 \r
        uint32_t task_cnt;\r
 \r
+       uint32_t isrCnt;\r
 #if defined(USE_KERNEL_EXTRA)\r
-       /* List of PCB's to be put in ready list when timeout */\r
+\r
+/* List of PCB's to be put in ready list when timeout */\r
        TAILQ_HEAD(,OsPcb) timerHead;           // TASK\r
 #endif\r
 \r
        /* List of all pcb's,\r
         * Only needed for non-static configuration of the kernel\r
         */\r
-       TAILQ_HEAD(,OsPcb) pcb_head;\r
+//     TAILQ_HEAD(,OsTaskVar) pcb_head;\r
        /* Ready queue */\r
-       TAILQ_HEAD(,OsPcb) ready_head;\r
+       TAILQ_HEAD(,OsTaskVar) ready_head;\r
+\r
+//     TAILQ_HEAD(,OsIsrVar) isrHead;\r
 \r
        /* Occording to OSEK 8.3 RES_SCHEDULER is accessible to all tasks */\r
        OsResourceType resScheduler;\r
-} sys_t;\r
+} Os_SysType;\r
 \r
-extern sys_t os_sys;\r
+extern Os_SysType Os_Sys;\r
 \r
-static inline OsPcbType *Os_TaskGetCurrent(  void ) {\r
-       return os_sys.curr_pcb;\r
+static inline OsTaskVarType *Os_TaskGetCurrent(  void ) {\r
+       return Os_Sys.currTaskPtr;\r
 }\r
 \r
 #if 0\r
 static uint32_t OSErrorGetServiceId( void ) {\r
-       return os_sys.serviceId;\r
+       return Os_Sys.serviceId;\r
 }\r
 #endif\r
 \r