Subversion Repositories shark

Rev

Rev 950 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1063 tullio 1
 
2
/*
3
 * This program is free software; you can redistribute it and/or modify
4
 * it under the terms of the GNU General Public License as published by
5
 * the Free Software Foundation; either version 2 of the License, or
6
 * (at your option) any later version.
7
 *
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 * GNU General Public License for more details.
12
 *
13
 * You should have received a copy of the GNU General Public License
14
 * along with this program; if not, write to the Free Software
15
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
 *
17
 */
18
 
947 trimarchi 19
// Header file that allows a general testing code to be used for calling
20
// the FSF primitives in both platforms: MaRTE_OS and SHARK
21
 
22
#ifndef _FSF_OS_COMPATIBILITY_H_
23
#define _FSF_OS_COMPATIBILITY_H_
24
#define SHARK_FSF
25
/////////////////////////////SHARK SECTION /////////////////////////////
26
#ifdef SHARK_FSF
27
 
28
#define  INITIALIZATION_CODE   \
29
{                              \
30
  fsf_init();                  \
31
  calibrate_cycle();           \
950 trimarchi 32
  init_network();              \
947 trimarchi 33
}
34
 
950 trimarchi 35
#define fsf_printf udp_print
947 trimarchi 36
#define printf cprintf
37
/*
38
double
39
t2d(struct timespec time)
40
{
41
          return time.tv_nsec*0.000000001 + (double)time.tv_sec;
42
}
43
*/
44
#define t2d( ts ) ((ts).tv_nsec*0.000000001 + (double)((ts).tv_sec))
45
 
46
#define ERROR(nn, ss) { if(errno==0) errno=nn ; kern_printf(ss); exit(nn);}
47
 
48
#define STANDARD_CONSOLE_INIT { }
49
#define SERIAL_CONSOLE_INIT { }
50
#endif /* SHARK_FSF */
51
//////////////////////////END OF SHARK SECTION /////////////////////////
52
 
53
 
54
/////////////////////////////MARTE SECTION /////////////////////////////
55
#ifdef MARTE_FSF
56
 
57
#include <misc/serial_console.h>
58
#include <misc/load.h>
59
 
60
//#include <debug_marte.h>
61
#include "fsf_contract.h"
62
#include "fsf_types.h"
63
 
64
 
65
#define  INITIALIZATION_CODE \
66
{                                                                         \
67
        SERIAL_CONSOLE_INIT; /*marte1.26i+                              */\
68
        /*init_serial_communication_with_gdb(SERIAL_PORT_1);            */\
69
        /*printf("max_prio = %d\n", sched_get_priority_max(SCHED_FIFO));*/\
70
        /*printf("min_prio = %d\n", sched_get_priority_min(SCHED_FIFO));*/\
71
                                                                          \
72
        adjust();                                                         \
73
        /*set_break_point_here;                                         */\
74
}
75
 
76
#define ERROR(nn, ss) {if(errno==0) errno=(nn); perror(ss); exit (nn);}
77
 
78
int
79
fsf_priority_map (unsigned long plevel)
80
{
81
        return plevel;
82
}
83
 
84
#endif /* MARTE_FSF */
85
//////////////////////////END OF MARTE SECTION /////////////////////////
86
 
87
#endif /* _FSF_OS_COMPATIBILITY_H_ */