Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1320 giacomo 1
#include <kernel/kern.h>
2
#include <tracer.h>
3
#include <stdlib.h>
4
 
5
TASK hard_task(void *arg)
6
{
7
 
8
  static int count = 0;
9
  int i;
10
 
11
  while(1) {
12
 
13
    count++;
14
    printf_xy(1,1,WHITE,"Exec %6d",count);
15
 
16
    if (count == 200) while(1);
17
 
18
    for (i=0;i<100000;i++);
19
 
20
    task_endcycle();
21
 
22
  }
23
 
24
  return 0;
25
 
26
}
27
 
28
int main() {
29
 
30
  HARD_TASK_MODEL ht;
31
  PID p;
32
  void *delta;
33
 
34
  delta = malloc(10000000);
35
  tracer_initialize(1000000);
36
 
37
  tracer_enable();
38
 
39
  hard_task_default_model(ht);
40
  hard_task_def_mit(ht,100000);
41
  hard_task_def_wcet(ht,10000);
42
 
43
  p = task_create("Test",hard_task,&ht,NULL);
44
  if (p == NIL) {
45
    cprintf("Error Creating Task\n");
46
    sys_end();
47
  }
48
 
49
  task_activate(p);
50
 
51
  while(1);
52
 
53
  return 0;
54
 
55
}