po_hi_types.h 2.97 KB
Newer Older
1
2
3
4
5
/*
 * 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.
 *
yoogx's avatar
yoogx committed
6
 * For more informations, please visit http://taste.tuxfamily.org/wiki
7
 *
yoogx's avatar
yoogx committed
8
 * Copyright (C) 2007-2009 Telecom ParisTech, 2010-2014 ESA & ISAE.
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
 */

#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
34
#error This configuration is not supported, PolyORB-HI/C requires a C compiler supporting the "bool" type.
35
36
37
38
39
40
41
42
43
#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;
44
#ifndef COMPCERT
45
  typedef int64_t    __po_hi_int64_t;
46
#endif
47
48
49
  typedef uint8_t    __po_hi_uint8_t;
  typedef uint16_t   __po_hi_uint16_t;
  typedef uint32_t   __po_hi_uint32_t;
50
#ifndef COMPCERT
51
  typedef uint64_t   __po_hi_uint64_t;
52
#endif
53
54
55
56
57
58
#else

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

59
#error This configuration is not supported, PolyORB-HI/C requires a C compiler with support for the stdint.h header file.
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

  #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

86
87
typedef unsigned char            __po_hi_byte_t;

88
89
90
91
92
93
94
95
96
97
98
99
100
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,
101
102
   __PO_HI_OUT_EVENT_INTRA_PROCESS           = 22,
   __PO_HI_INVALID_PORT_KIND                 = 50
103
104
}__po_hi_port_kind_t;

105
106
107
void __po_hi_copy_array (void* dst, void* src, __po_hi_uint16_t size);

#endif /* __PO_HI_TYPES_H_ */