]> rtime.felk.cvut.cz Git - arc.git/blob - system/kernel/include/sys.h
Pass on all test cases in 'Alarms' and 'Error handling,...'
[arc.git] / system / kernel / include / sys.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 #ifndef SYS_H_\r
17 #define SYS_H_\r
18 \r
19 struct os_conf_global_hook_s;\r
20 \r
21 typedef struct sys_s {\r
22 //      OsApplicationType *curr_application;\r
23         /* Current running task*/\r
24         OsPcbType *curr_pcb;\r
25         /* List of all tasks */\r
26         OsPcbType *pcb_list;\r
27         /* Interrupt nested count */\r
28         uint32 int_nest_cnt;\r
29         /* Ptr to the interrupt stack */\r
30         void *int_stack;\r
31         // The os tick\r
32         TickType tick;\r
33         // 1-The scheduler is locked (by GetResource() or something else)\r
34         int scheduler_lock;\r
35         /* Hooks */\r
36         struct OsHooks *hooks;\r
37 \r
38         // parameters for functions, used by OSErrorXXX()\r
39         uint32_t param1;\r
40         uint32_t param2;\r
41         uint32_t param3;\r
42         uint32_t serviceId;\r
43 \r
44         /* Current Application mode */\r
45         AppModeType appMode;\r
46 \r
47         uint32_t task_cnt;\r
48         /* List of all pcb's,\r
49          * Only needed for non-static configuration of the kernel\r
50          */\r
51         TAILQ_HEAD(,OsPcb) pcb_head;\r
52         /* Ready queue */\r
53         TAILQ_HEAD(,OsPcb) ready_head;\r
54 } sys_t;\r
55 \r
56 extern sys_t os_sys;\r
57 \r
58 static inline OsPcbType *Os_TaskGetCurrent(  void ) {\r
59         return os_sys.curr_pcb;\r
60 }\r
61 \r
62 #if 0\r
63 static uint32_t OSErrorGetServiceId( void ) {\r
64         return os_sys.serviceId;\r
65 }\r
66 #endif\r
67 \r
68 \r
69 #endif /*SYS_H_*/\r