summaryrefslogtreecommitdiffstats
path: root/cpukit/itron/include/itronsys/types.h
blob: 365b576a74d09b691068943837f387e282a2a422 (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
119
120
121
122
123
124
125
126
/**
 * @file itronsys/types.h
 */

/*
 *  COPYRIGHT (c) 1989-1999.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 *  $Id$
 */

#ifndef _ITRONSYS_TYPES_H
#define _ITRONSYS_TYPES_H

#include <rtems/score/object.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 int8_t        B;       /* signed 8-bit integer */
typedef int16_t       H;       /* signed 16-bit integer */
typedef int32_t       W;       /* signed 32-bit integer */
typedef uint8_t      UB;      /* unsigned 8-bit integer */
typedef uint16_t     UH;      /* unsigned 16-bit integer */
typedef uint32_t     UW;      /* unsigned 32-bit integer */

typedef uint32_t     VW;      /* unpredictable data type (32-bit size) */
typedef uint16_t     VH;      /* unpredictable data type (16-bit size) */
typedef uint8_t      VB;      /* unpredictable data type (8-bit size) */

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

typedef void (*FP)(void);     /* 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 int32_t     INT;   /* Signed integer (bit width of processor) */
typedef uint32_t   UINT;   /* Unsigned integer (bit width of processor) */
typedef bool       BOOL;   /* Boolean value.  TRUE (1) or FALSE (0). */
typedef int16_t     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 int       BOOL_ID;/* Boolean value or ID number */

typedef int       HNO;     /* Handler number */
typedef int       RNO;     /* Rendezvous number */
typedef int       NODE;    /* Node Number.  Usually a signed integer. */
typedef int       ATR;     /* Object or handler attribute. */
                           /*   An unsigned integer. */
typedef int           ER;  /* Error code.  A signed integer. */
typedef unsigned int  PRI; /* Task priority.  A signed integer. */
typedef int32_t       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 */