Rev 1379 | Rev 1381 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1158 | pj | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Paolo Gai <pj@gandalf.sssup.it> |
||
10 | * (see the web pages for full authors list) |
||
11 | * |
||
12 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
13 | * |
||
14 | * http://www.sssup.it |
||
15 | * http://retis.sssup.it |
||
16 | * http://shark.sssup.it |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | ------------ |
||
1380 | giacomo | 21 | CVS : $Id: ern.c,v 1.3 2004-04-18 09:45:27 giacomo Exp $ |
1158 | pj | 22 | |
23 | File: $File$ |
||
1380 | giacomo | 24 | Revision: $Revision: 1.3 $ |
25 | Last update: $Date: 2004-04-18 09:45:27 $ |
||
1158 | pj | 26 | ------------ |
27 | **/ |
||
28 | |||
29 | /* |
||
30 | * Copyright (C) 2003 Paolo Gai |
||
31 | * |
||
32 | * This program is free software; you can redistribute it and/or modify |
||
33 | * it under the terms of the GNU General Public License as published by |
||
34 | * the Free Software Foundation; either version 2 of the License, or |
||
35 | * (at your option) any later version. |
||
36 | * |
||
37 | * This program is distributed in the hope that it will be useful, |
||
38 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
39 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
40 | * GNU General Public License for more details. |
||
41 | * |
||
42 | * You should have received a copy of the GNU General Public License |
||
43 | * along with this program; if not, write to the Free Software |
||
44 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
45 | * |
||
46 | */ |
||
47 | |||
48 | #include "kernel/kern.h" |
||
1379 | giacomo | 49 | #include "modules/intdrive.h" |
1158 | pj | 50 | #include "modules/edf.h" |
51 | #include "modules/rr.h" |
||
52 | #include "modules/rrsoft.h" |
||
53 | #include "modules/dummy.h" |
||
54 | |||
55 | #include "modules/sem.h" |
||
56 | #include "modules/hartport.h" |
||
57 | #include "modules/cabs.h" |
||
58 | |||
1380 | giacomo | 59 | #include "modules/nop.h" |
60 | |||
1158 | pj | 61 | /*+ sysyem tick in us +*/ |
62 | #define TICK 0 |
||
63 | |||
64 | /*+ RR tick in us +*/ |
||
65 | #define RRTICK 2000 |
||
66 | |||
1379 | giacomo | 67 | /*+ Interrupt Server +*/ |
68 | #define INTDRIVE_Q 1000 |
||
69 | #define INTDRIVE_T 10000 |
||
70 | #define INTDRIVE_FLAG 0 |
||
71 | |||
1158 | pj | 72 | TIME __kernel_register_levels__(void *arg) |
73 | { |
||
74 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
75 | |||
1379 | giacomo | 76 | INTDRIVE_register_level(INTDRIVE_Q,INTDRIVE_T,INTDRIVE_FLAG); |
1158 | pj | 77 | EDF_register_level(EDF_ENABLE_ALL); |
78 | RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD|RRSOFT_ONLY_SOFT); |
||
79 | RR_register_level(RRTICK, RR_MAIN_YES, mb); |
||
80 | dummy_register_level(); |
||
81 | |||
82 | SEM_register_module(); |
||
83 | |||
84 | CABS_register_module(); |
||
85 | |||
1380 | giacomo | 86 | NOP_register_module(); |
87 | |||
1158 | pj | 88 | return TICK; |
89 | } |
||
90 | |||
91 | TASK __init__(void *arg) |
||
92 | { |
||
93 | struct multiboot_info *mb = (struct multiboot_info *)arg; |
||
94 | |||
95 | HARTPORT_init(); |
||
96 | |||
97 | __call_main__(mb); |
||
98 | |||
99 | return (void *)0; |
||
100 | } |
||
1380 | giacomo | 101 | |
102 | void app_mutex_init(mutex_t *m) |
||
103 | { |
||
104 | NOP_mutexattr_t attr; |
||
105 | |||
106 | NOP_mutexattr_default(attr); |
||
107 | |||
108 | mutex_init(m, &attr); |
||
109 | } |
||
110 |