summaryrefslogtreecommitdiffstats
path: root/c/src/exec/itron/include/itronsys/types.h
blob: 80cb31f3b8120ac25132d71ad3e02d32be10e5f6 (plain) (blame)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *  $Id$
 */

#ifndef __ITRON_TYPES_h_
#define __ITRON_TYPES_h_

#ifdef __cplusplus
extern "C" {
#endif

/* XXX some of these may need to be moved */
/* 
 *  XXX: These names are too short and conflict with numerous 
 *       off the shell programs including paranoia.
 */

typedef signed8      B;       /* signed 8-bit integer */
typedef signed16     H;       /* signed 16-bit integer */
typedef signed32     W;       /* signed 32-bit integer */
typedef unsigned8    UB;      /* unsigned 8-bit integer */
typedef unsigned16   UH;      /* unsigned 16-bit integer */
typedef unsigned32   UW;      /* unsigned 32-bit integer */

typedef unsigned32   VW;      /* unpredictable data type (32-bit size) */
typedef unsigned16   VH;      /* unpredictable data type (16-bit size) */
typedef unsigned8    VB;      /* unpredictable data type (8-bit size) */

typedef void        *VP;      /* pointer to an unpredictable data type */

typedef void (*FP)();         /* program start address */

/*
 *  6.4 Data Types
 *
 *  The difference between VB, VH and VW and B, H and W is that only the
 *  number of bits is known for the former, not the data type of the
 *  contents.  The latter clearly represent integers.
 */

/*
 *  Data Types Dependent on ITRON Specification 
 *
 *  In order to clarify the meanings of certain parameters, the
 *  following names are used for data types which appear frequently 
 *  and/or have special meanings.
 */

typedef signed32   INT;    /* Signed integer (bit width of processor) */
typedef unsigned32 UINT;   /* Unsigned integer (bit width of processor) */
typedef boolean    BOOL;   /* Boolean value.  TRUE (1) or FALSE (0). */
typedef signed16   FN;     /* Function code. Signed integer. Maximum 2 bytes. */
typedef int        ID;     /* Object ID number (???id) */
                           /*   Value range depends on the system.  Usually */
                           /*   a signed integer.  Certain ID values may */
                           /*   represent objects on other nodes when the */
                           /*   connection function is supported. */

typedef unsigned32 BOOL_ID;/* Boolean value or ID number */

typedef signed32 HNO;      /* Handler number */
typedef signed32 RNO;      /* Rendezvous number */
typedef signed32 NODE;     /* Node Number.  Usually a signed integer. */
typedef signed32 ATR;      /* Object or handler attribute. */
                           /*   An unsigned integer. */
typedef signed32 ER;       /* Error code.  A signed integer. */
typedef unsigned32 PRI;    /* Task priority.  A signed integer. */
typedef signed32 TMO;      /* Timeout value.  A signed integer. */
                           /*   TMO_POL = 0 indicates polling, */
                           /*   while TMO_FEVR = -1 indicates wait forever. */

/*
 *   6.6 Common Constants and Data Structure Packet Formats
 */

#define NADR   (-1)   /* invalid address or pointer value */

#ifndef TRUE
#define TRUE     1    /* true */
#endif

#ifndef FALSE
#define FALSE    0    /* false */
#endif

/*
 *  ATR tskatr, intatr, cycatr, almatr, svcatr, excatr:
 *
 *  TA_ASM indicates that the task or handler is directly started
 *         at the assembly language level.  The TA_ASM attribute has the
 *         opposite meaning of TA_HLNG.
 *
 *  NOTE: Really in <itronsys/task.h>
 */

#if 0
#define TA_ASM    0x00   /* program written in assembly language */
#define TA_HLNG   0x01   /* program written in high-level language */
#endif

/*
 *  TMO tmout:
 */

#define TMO_POL      0    /* polling */
#define TMO_FEVR   (-1)   /* wait forever */

#ifdef __cplusplus
}
#endif

#endif
/* end of include file */