1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\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
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
14 * -------------------------------- Arctic Core ------------------------------*/
\r
19 struct os_conf_global_hook_s;
\r
24 OP_ACTIVATE_TASK = 4,
\r
25 OP_TERMINATE_TASK = 8,
\r
28 OP_RELEASE_RESOURCE = 64,
\r
32 typedef struct sys_s {
\r
33 // OsApplicationType *curr_application;
\r
34 /* Current running task*/
\r
35 OsPcbType *curr_pcb;
\r
36 /* List of all tasks */
\r
37 OsPcbType *pcb_list;
\r
39 OsPcbType *chainedPcbPtr;
\r
40 /* Interrupt nested count */
\r
41 uint32 int_nest_cnt;
\r
42 /* The current operation */
\r
44 /* Ptr to the interrupt stack */
\r
48 // 1-The scheduler is locked (by GetResource() or something else)
\r
49 // int scheduler_lock;
\r
51 struct OsHooks *hooks;
\r
53 // parameters for functions, used by OSErrorXXX()
\r
59 /* Current Application mode */
\r
60 AppModeType appMode;
\r
66 #if defined(USE_KERNEL_EXTRA)
\r
67 /* List of PCB's to be put in ready list when timeout */
\r
68 TAILQ_HEAD(,OsPcb) timerHead; // TASK
\r
71 /* List of all pcb's,
\r
72 * Only needed for non-static configuration of the kernel
\r
74 TAILQ_HEAD(,OsPcb) pcb_head;
\r
76 TAILQ_HEAD(,OsPcb) ready_head;
\r
78 /* Occording to OSEK 8.3 RES_SCHEDULER is accessible to all tasks */
\r
79 OsResourceType resScheduler;
\r
82 extern sys_t os_sys;
\r
84 static inline OsPcbType *Os_TaskGetCurrent( void ) {
\r
85 return os_sys.curr_pcb;
\r
89 static uint32_t OSErrorGetServiceId( void ) {
\r
90 return os_sys.serviceId;
\r