1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
6 * This source code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by the
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * -------------------------------- Arctic Core ------------------------------*/
26 * Created on: 2009-jan-16
\r
33 #include <sys/queue.h>
\r
39 #define os_alloc(_x) malloc(_x)
\r
41 pcb_t * os_alloc_new_pcb( void ) {
\r
42 void *h = os_alloc(sizeof(pcb_t));
\r
43 memset(h,0,sizeof(pcb_t));
\r
49 typedef void (*Os_IsrEntryType)(void);
\r
52 typedef Os_IsrInfo_s {
\r
53 Os_IsrEntryType entry;
\r
60 extern TaskType os_add_task( pcb_t *pcb );
\r
62 static uint8 stackTop = 0x42;
\r
64 TaskType Os_CreateIsr( void (*entry)(void ), uint8_t prio, const char *name )
\r
66 pcb_t *pcb = os_alloc_new_pcb();
\r
67 strncpy(pcb->name,name,TASK_NAME_SIZE);
\r
70 pcb->proc_type = PROC_ISR2;
\r
71 pcb->state = ST_SUSPENDED;
\r
73 pcb->stack.top = &stackTop;
\r
75 return os_add_task(pcb);
\r