Subversion Repositories shark

Rev

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

Rev Author Line No. Line
1085 pj 1
//****************************initfile.c*******************************
2
#define PI
3
 
4
#include "kernel/kern.h"
5
#include "modules/edf.h"
6
#include "modules/cbs.h"
7
#include "modules/rr.h"
8
 
9
#ifndef PI
10
#include "modules/rrsoft.h"
11
#endif
12
 
13
#include "modules/dummy.h"
14
 
15
#include "modules/sem.h"
16
#include "modules/hartport.h"
17
#include "modules/cabs.h"
18
#include "modules/pi.h"
19
#include "modules/pc.h"
20
#include "modules/srp.h"
21
#include "modules/npp.h"
22
#include "modules/nop.h"
23
#include <drivers/keyb.h>
24
 
25
//#include "ll/i386/x-dos.h"
26
 
27
 
28
/*+ sysyem tick in us +*/
29
#define TICK 0
30
 
31
/*+ RR tick in us +*/
32
//#define RRTICK 10000
33
#define RRTICK 2000
34
 
35
 
36
void getCars(void);
37
void getRoad(void);
38
void getSem(void);
39
void getSprites(void);
40
void getFaces(void);
41
void tl_pos();
42
 
43
TIME __kernel_register_levels__(void *arg)
44
{
45
  struct multiboot_info *mb = (struct multiboot_info *)arg;
46
 
47
 
48
  EDF_register_level(EDF_ENABLE_ALL);
49
  CBS_register_level(CBS_ENABLE_ALL, 0);
50
 
51
//  RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_HARD|RRSOFT_ONLY_SOFT);
52
// RRSOFT_register_level(RRTICK, RR_MAIN_NO, mb, RRSOFT_ONLY_SOFT); //cbs
53
 
54
  RR_register_level(RRTICK, RR_MAIN_YES, mb);
55
  dummy_register_level();
56
 
57
 
58
  SEM_register_module();
59
 
60
  CABS_register_module();
61
 
62
  PI_register_module();
63
  NOP_register_module();
64
 
65
  getFaces();
66
  getCars();
67
  getRoad();
68
  getSem();
69
  getSprites();
70
  tl_pos();
71
  return TICK;
72
}
73
 
74
TASK __init__(void *arg)
75
{
76
  struct multiboot_info *mb = (struct multiboot_info *)arg;
77
 
78
  HARTPORT_init();
79
 
80
  KEYB_init(NULL);
81
 
82
  __call_main__(mb);
83
 
84
  return (void *)0;
85
}
86
 
87
 
88
#ifdef PI
89
void app_mutex_init(mutex_t *m)
90
{
91
  PI_mutexattr_t attr;
92
 
93
  PI_mutexattr_default(attr);
94
 
95
  mutex_init(m, &attr);
96
}
97
#else
98
void app_mutex_init(mutex_t *m)
99
{
100
  NOP_mutexattr_t attr;
101
 
102
  NOP_mutexattr_default(attr);
103
 
104
  mutex_init(m, &attr);
105
}
106
#endif