Subversion Repositories shark

Rev

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

// Header file that allows a general testing code to be used for calling
// the FSF primitives in both platforms: MaRTE_OS and SHARK

#ifndef _FSF_OS_COMPATIBILITY_H_
#define _FSF_OS_COMPATIBILITY_H_
#define SHARK_FSF
/////////////////////////////SHARK SECTION /////////////////////////////
#ifdef SHARK_FSF

#define  INITIALIZATION_CODE   \
{                              \
  fsf_init();                  \
  calibrate_cycle();           \
  init_network();              \
}


#define fsf_printf udp_print
#define printf cprintf
/*
double
t2d(struct timespec time)
{
          return time.tv_nsec*0.000000001 + (double)time.tv_sec;
}
*/

#define t2d( ts ) ((ts).tv_nsec*0.000000001 + (double)((ts).tv_sec))

#define ERROR(nn, ss) { if(errno==0) errno=nn ; kern_printf(ss); exit(nn);}

#define STANDARD_CONSOLE_INIT { }
#define SERIAL_CONSOLE_INIT { }
#endif /* SHARK_FSF */
//////////////////////////END OF SHARK SECTION /////////////////////////


/////////////////////////////MARTE SECTION /////////////////////////////
#ifdef MARTE_FSF

#include <misc/serial_console.h>
#include <misc/load.h>

//#include <debug_marte.h>
#include "fsf_contract.h"
#include "fsf_types.h"


#define  INITIALIZATION_CODE \
{                                                                         \
        SERIAL_CONSOLE_INIT; /*marte1.26i+                              */\
        /*init_serial_communication_with_gdb(SERIAL_PORT_1);            */\
        /*printf("max_prio = %d\n", sched_get_priority_max(SCHED_FIFO));*/\
        /*printf("min_prio = %d\n", sched_get_priority_min(SCHED_FIFO));*/\
                                                                          \
        adjust();                                                         \
        /*set_break_point_here;                                         */\
}


#define ERROR(nn, ss) {if(errno==0) errno=(nn); perror(ss); exit (nn);}

int
fsf_priority_map (unsigned long plevel)
{
        return plevel;
}

#endif /* MARTE_FSF */
//////////////////////////END OF MARTE SECTION /////////////////////////

#endif /* _FSF_OS_COMPATIBILITY_H_ */