Subversion Repositories shark

Rev

Rev 1120 | Rev 1393 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1120 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
 ------------
1377 giacomo 21
 CVS :        $Id: iaster7.c,v 1.2 2004-04-17 11:36:13 giacomo Exp $
1120 pj 22
 
23
 File:        $File$
1377 giacomo 24
 Revision:    $Revision: 1.2 $
25
 Last update: $Date: 2004-04-17 11:36:13 $
1120 pj 26
 ------------
27
 
28
 System initialization file
29
 
30
 The tick is set to TICK ms.
31
 
32
 This file contains the 2 functions needed to initialize the system.
33
 
34
 These functions register a set of scheduling modules, in a fixed or
35
 dynamic priority way...
36
 
37
 It can accept these task models:
38
 
39
 HARD_TASK_MODEL (wcet+mit) at level 0
40
 SOFT_TASK_MODEL (periodicity=APERIODIC) at level 1
41
 NRT_TASK_MODEL  at level 2
42
 SOFT_TASK_MODEL (periodicity=APERIODIC, wcet (only if TBS) ) at level 3,4
43
 
44
**/
45
 
46
/*
47
 * Copyright (C) 2000 Paolo Gai
48
 *
49
 * This program is free software; you can redistribute it and/or modify
50
 * it under the terms of the GNU General Public License as published by
51
 * the Free Software Foundation; either version 2 of the License, or
52
 * (at your option) any later version.
53
 *
54
 * This program is distributed in the hope that it will be useful,
55
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
56
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
57
 * GNU General Public License for more details.
58
 *
59
 * You should have received a copy of the GNU General Public License
60
 * along with this program; if not, write to the Free Software
61
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
62
 *
63
 */
64
 
65
 
66
 
67
#include "kernel/kern.h"
1377 giacomo 68
#include "modules/intdrive.h"
1120 pj 69
#include "modules/edf.h"
70
#include "modules/tbs.h"
71
 
72
#include "modules/rm.h"
73
#include "modules/rr.h"
74
#include "modules/ps.h"
75
 
76
#include "modules/dummy.h"
77
 
78
#include "modules/sem.h"
79
#include "modules/hartport.h"
80
 
81
/*+ sysyem tick in us +*/
1377 giacomo 82
#define TICK      0
1120 pj 83
 
1377 giacomo 84
#define RRTICK    10000
1120 pj 85
 
1377 giacomo 86
/*+ Interrupt Server +*/
87
#define INTDRIVE_Q 1000
88
#define INTDRIVE_T 10000
89
#define INTDRIVE_FLAG 0
1120 pj 90
 
91
TIME __kernel_register_levels__(void *arg)
92
{
93
  struct multiboot_info *mb = (struct multiboot_info *)arg;
94
 
1377 giacomo 95
  INTDRIVE_register_level(INTDRIVE_Q,INTDRIVE_T,INTDRIVE_FLAG);
1120 pj 96
  RM_register_level(RM_ENABLE_ALL);
1377 giacomo 97
  PS_register_level(PS_ENABLE_ALL_RM,1,1000,100000);
1120 pj 98
  RR_register_level(RRTICK, RR_MAIN_YES, mb);
1377 giacomo 99
  PS_register_level(4,1,10000,100000);
100
  PS_register_level(4,1,30000,100000);
1120 pj 101
 
102
  dummy_register_level();
103
 
104
  SEM_register_module();
105
 
106
  return TICK;
107
}
108
 
109
TASK __init__(void *arg)
110
{
111
  struct multiboot_info *mb = (struct multiboot_info *)arg;
112
 
113
  HARTPORT_init();
114
 
115
  __call_main__(mb);
116
 
117
  return (void *)0;
118
}
119