po_hi_types.h 2.76 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
 * This is a part of PolyORB-HI-C distribution, a minimal
 * middleware written for generated code from AADL models.
 * You should use it with the Ocarina toolsuite.
 *
 * For more informations, please visit http://ocarina.enst.fr
 *
 * Copyright (C) 2007-2009, GET-Telecom Paris.
 */

#ifndef __PO_HI_TYPES_H_
#define __PO_HI_TYPES_H_

#include"po_hi_config.h"

#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif

#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#endif

#define __PO_HI_UNUSED_NODE -1

/*
 * Types are configured according to the ones available
 * on the target host.
 */


#ifdef HAVE_STDBOOL_H
typedef bool __po_hi_bool_t;
#else
#error This configuration is not supported
#endif

typedef float  __po_hi_float32_t;
typedef double __po_hi_float64_t;

#ifdef HAVE_STDINT_H
  typedef int8_t     __po_hi_int8_t;
  typedef int16_t    __po_hi_int16_t;
  typedef int32_t    __po_hi_int32_t;
  typedef int64_t    __po_hi_int64_t;
  typedef uint8_t    __po_hi_uint8_t;
  typedef uint16_t   __po_hi_uint16_t;
  typedef uint32_t   __po_hi_uint32_t;
  typedef uint64_t   __po_hi_uint64_t;
#else

/*
 * Most modern compilers have stdint.h header file.
 */

#error This configuration is not supported

  #if SIZEOF_INT == 4
  typedef int                    __po_hi_int32_t;
  #elif SIZEOF_LONG_INT == 4
  typedef long int               __po_hi_int32_t;
  #elif SIZEOF_SHORT_INT == 4
  typedef short int              __po_hi_int32_t;
  #endif

  #if SIZEOF_INT == 2
  typedef int                    __po_hi_int16_t;
  typedef unsigned int           __po_hi_uint16_t;
  #elif SIZEOF_SHORT_INT == 2
  typedef short int              __po_hi_int16_t;
  typedef unsigned short int     __po_hi_uint16_t;
  #elif SIZEOF_LONG_INT == 2
  typedef long int               __po_hi_int16_t;
  typedef unsigned long int      __po_hi_uint16_t;
  #endif

  #if SIZEOF_CHAR == 1
    typedef char                 __po_hi_int8_t;
    typedef unsigned char        __po_hi_uint8_t;
  #endif
#endif

83
84
typedef unsigned char            __po_hi_byte_t;

85
86
87
88
89
90
91
92
93
94
95
96
97
98

typedef enum
{
   __PO_HI_IN_DATA_INTER_PROCESS             = 0,
   __PO_HI_OUT_DATA_INTER_PROCESS            = 2,
   __PO_HI_IN_DATA_INTRA_PROCESS             = 4,
   __PO_HI_OUT_DATA_INTRA_PROCESS            = 6,
   __PO_HI_IN_EVENT_DATA_INTER_PROCESS       = 8,
   __PO_HI_OUT_EVENT_DATA_INTER_PROCESS      = 10,
   __PO_HI_IN_EVENT_DATA_INTRA_PROCESS       = 12,
   __PO_HI_OUT_EVENT_DATA_INTRA_PROCESS      = 14,
   __PO_HI_IN_EVENT_INTER_PROCESS            = 16,
   __PO_HI_OUT_EVENT_INTER_PROCESS           = 18,
   __PO_HI_IN_EVENT_INTRA_PROCESS            = 20,
99
100
   __PO_HI_OUT_EVENT_INTRA_PROCESS           = 22,
   __PO_HI_INVALID_PORT_KIND                 = 50
101
102
}__po_hi_port_kind_t;

103
104
105
void __po_hi_copy_array (void* dst, void* src, __po_hi_uint16_t size);

#endif /* __PO_HI_TYPES_H_ */