Subversion Repositories shark

Rev

Rev 1379 | Go to most recent revision | Details | 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
 ------------
21
 CVS :        $Id: rrp.c,v 1.1 2003-05-01 19:43:17 pj Exp $
22
 
23
 File:        $File$
24
 Revision:    $Revision: 1.1 $
25
 Last update: $Date: 2003-05-01 19:43:17 $
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"
49
#include "modules/edf.h"
50
#include "modules/rr.h"
51
#include "modules/rrsoft.h"
52
#include "modules/dummy.h"
53
 
54
#include "modules/sem.h"
55
#include "modules/hartport.h"
56
#include "modules/cabs.h"
57
#include "modules/pi.h"
58
 
59
#include "drivers/keyb.h"
60
 
61
 
62
/*+ sysyem tick in us +*/
63
#define TICK 0
64
 
65
/*+ RR tick in us +*/
66
//#define RRTICK 10000
67
#define RRTICK 2000
68
 
69
TIME __kernel_register_levels__(void *arg)
70
{
71
  struct multiboot_info *mb = (struct multiboot_info *)arg;
72
 
73
  RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD);
74
  RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT);
75
 
76
  RR_register_level(RRTICK, RR_MAIN_YES, mb);
77
  dummy_register_level();
78
 
79
 
80
  SEM_register_module();
81
  CABS_register_module();
82
  PI_register_module();
83
 
84
  return TICK;
85
}
86
 
87
TASK __init__(void *arg)
88
{
89
  struct multiboot_info *mb = (struct multiboot_info *)arg;
90
 
91
  HARTPORT_init();
92
 
93
  KEYB_init(NULL);
94
 
95
  __call_main__(mb);
96
 
97
  return (void *)0;
98
}
99
 
100
void app_mutex_init(mutex_t *m)
101
{
102
  PI_mutexattr_t attr;
103
 
104
  PI_mutexattr_default(attr);
105
 
106
  mutex_init(m, &attr);
107
}