software.h
4.42 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/************************************************************************
WHAT: SOFTWARE TYPEDEFS
SCCS: @(#)software.h 1.2 21 Sep 1994
PTLS: $Id: software.h,v 1.1.1.1 2002/05/02 03:29:13 blythe Exp $
ENGR: Project Reality - Evan Y. Wang
(C): 1994 Silicon Graphics, Inc.
************************************************************************/
#ifndef _software_h_
#define _software_h_
/****************************************************************
UNSIGNED SIGNAL TYPEDEFS.
****************************************************************/
typedef unsigned char u1;
typedef unsigned char u2;
typedef unsigned char u3;
typedef unsigned char u4;
typedef unsigned char u5;
typedef unsigned char u6;
typedef unsigned char u7;
typedef unsigned char u8;
typedef unsigned short int u9;
typedef unsigned short int u10;
typedef unsigned short int u11;
typedef unsigned short int u12;
typedef unsigned short int u13;
typedef unsigned short int u14;
typedef unsigned short int u15;
typedef unsigned short int u16;
typedef unsigned long u17;
typedef unsigned long u18;
typedef unsigned long u19;
typedef unsigned long u20;
typedef unsigned long u21;
typedef unsigned long u22;
typedef unsigned long u23;
typedef unsigned long u24;
typedef unsigned long u25;
typedef unsigned long u26;
typedef unsigned long u27;
typedef unsigned long u28;
typedef unsigned long u29;
typedef unsigned long u30;
typedef unsigned long u31;
typedef unsigned long u32;
typedef unsigned long long u64;
/****************************************************************
SIGNED SIGNAL TYPEDEFS.
****************************************************************/
typedef char s1;
typedef char s2;
typedef char s3;
typedef char s4;
typedef char s5;
typedef char s6;
typedef char s7;
typedef char s8;
typedef short int s9;
typedef short int s10;
typedef short int s11;
typedef short int s12;
typedef short int s13;
typedef short int s14;
typedef short int s15;
typedef short int s16;
typedef long s17;
typedef long s18;
typedef long s19;
typedef long s20;
typedef long s21;
typedef long s22;
typedef long s23;
typedef long s24;
typedef long s25;
typedef long s26;
typedef long s27;
typedef long s28;
typedef long s29;
typedef long s30;
typedef long s31;
typedef long s32;
/****************************************************************
FUNCTION ARRAY TYPEDEF.
****************************************************************/
typedef u1 (*PBF)(); /* pointer to boolean function */
typedef int (*PIF)(); /* pointer to integer function */
typedef u32 (*PUF)(); /* pointer to u32 function */
typedef void (*PVF)(); /* pointer to void function */
/****************************************************************
UNION DATA TYPEDEF AND OPERATORS.
Note: This typedef is setup for big endian and 32-bit words.
****************************************************************/
typedef union {
u32 w; /* word */
struct { /* union within word */
union { /* high half-word */
u16 hw;
struct {
u8 hb; /* high byte of high half-word */
u8 lb; /* low byte of high half-word */
} u;
} h;
union { /* low half-word */
u16 hw;
struct {
u8 hb; /* high byte of low half-word */
u8 lb; /* low byte of low half-word */
} u;
} l;
} u;
} UD32;
#define UD32B0(ud) ((ud).u.h.u.hb)
#define UD32B1(ud) ((ud).u.h.u.lb)
#define UD32B2(ud) ((ud).u.l.u.hb)
#define UD32B3(ud) ((ud).u.l.u.lb)
#define UD32H0(ud) ((ud).u.h.hw)
#define UD32H1(ud) ((ud).u.l.hw)
#define UD32WD(ud) ((ud).w)
typedef union {
u64 dw; /* 64-bit double word */
struct {
UD32 h;
UD32 l;
} u;
} UD64;
#define UD64B0(ud) ((ud).u.h.u.h.u.hb)
#define UD64B1(ud) ((ud).u.h.u.h.u.lb)
#define UD64B2(ud) ((ud).u.h.u.l.u.hb)
#define UD64B3(ud) ((ud).u.h.u.l.u.lb)
#define UD64B4(ud) ((ud).u.l.u.l.u.lb)
#define UD64B5(ud) ((ud).u.l.u.h.u.hb)
#define UD64B6(ud) ((ud).u.l.u.h.u.lb)
#define UD64B7(ud) ((ud).u.l.u.l.u.hb)
#define UD64H0(ud) ((ud).u.h.u.h.hw)
#define UD64H1(ud) ((ud).u.h.u.l.hw)
#define UD64H2(ud) ((ud).u.l.u.h.hw)
#define UD64H3(ud) ((ud).u.l.u.l.hw)
#define UD64W0(ud) ((ud).u.h.w)
#define UD64W1(ud) ((ud).u.l.w)
#define UD64DW(ud) ((ud).dw)
/****************************************************************
MISCELLANEOUS STYLISTIC DEFINES.
****************************************************************/
#define PRIVATE static
#define PUBLIC
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif