po_hi_types.h 3.5 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
 *
8
 * Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 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
typedef __po_hi_int32_t          __po_hi_port_id_t;

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

107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
typedef enum
{
  __po_hi_initial,
  __po_hi_initial_complete,
  __po_hi_initial_complete_final,
  __po_hi_initial_final,
  __po_hi_complete,
  __po_hi_complete_final,
  __po_hi_final,
  __po_hi_execution
} __po_hi_state_kind_t;

typedef struct
{
 
  __po_hi_int32_t nb_transitions;
  
  __po_hi_int32_t* nb_dispatch_triggers_of_each_transition;
  
  __po_hi_int32_t* dispatch_triggers_of_all_transitions;
  
  __po_hi_int32_t nb_of_all_dispatch_events;

} __po_hi_ba_automata_state_t;

132
void __po_hi_copy_array (void* dst, void* src, __po_hi_uint32_t size);
133
134

#endif /* __PO_HI_TYPES_H_ */