]> git.saurik.com Git - apple/xnu.git/blob - osfmk/sys/types.h
6919899fc02fbaef16d3db16eb9464fc67e57b02
[apple/xnu.git] / osfmk / sys / types.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * @OSF_COPYRIGHT@
27 */
28 /*
29 * HISTORY
30 *
31 * Revision 1.1.1.1 1998/09/22 21:05:48 wsanchez
32 * Import of Mac OS X kernel (~semeria)
33 *
34 * Revision 1.1.1.1 1998/03/07 02:25:59 wsanchez
35 * Import of OSF Mach kernel (~mburg)
36 *
37 * Revision 1.1.10.3 1996/01/09 19:23:12 devrcs
38 * Change time_t typedef from "unsigned int" to "int" to
39 * match the server and what it has historically been.
40 * Added more shorthand definitions for unsigned typedefs.
41 * Made conditional on ASSEMBLER not being defined.
42 * [1995/12/01 20:39:08 jfraser]
43 *
44 * Merged '64-bit safe' changes from DEC alpha port.
45 * [1995/11/21 18:10:35 jfraser]
46 *
47 * Revision 1.1.10.2 1995/01/06 19:57:26 devrcs
48 * mk6 CR668 - 1.3b26 merge
49 * add shorthand defs for unsigned typedefs
50 * OSF alpha pal merge
51 * paranoid bit masking, 64bit cleanup, add NBBY
52 * [1994/10/14 03:43:58 dwm]
53 *
54 * Revision 1.1.10.1 1994/09/23 03:13:36 ezf
55 * change marker to not FREE
56 * [1994/09/22 21:59:04 ezf]
57 *
58 * Revision 1.1.3.2 1993/06/03 00:18:19 jeffc
59 * Added to OSF/1 R1.3 from NMK15.0.
60 * [1993/06/02 21:31:08 jeffc]
61 *
62 * Revision 1.1 1992/09/30 02:37:03 robert
63 * Initial revision
64 *
65 * $EndLog$
66 */
67 /* CMU_HIST */
68 /*
69 * Revision 2.6 91/05/14 17:40:39 mrt
70 * Correcting copyright
71 *
72 * Revision 2.5 91/02/05 17:57:07 mrt
73 * Changed to new Mach copyright
74 * [91/02/01 17:49:41 mrt]
75 *
76 * Revision 2.4 90/08/27 22:13:03 dbg
77 * Created.
78 * [90/07/16 dbg]
79 *
80 */
81 /* CMU_ENDHIST */
82 /*
83 * Mach Operating System
84 * Copyright (c) 1991,1990 Carnegie Mellon University
85 * All Rights Reserved.
86 *
87 * Permission to use, copy, modify and distribute this software and its
88 * documentation is hereby granted, provided that both the copyright
89 * notice and this permission notice appear in all copies of the
90 * software, derivative works or modified versions, and any portions
91 * thereof, and that both notices appear in supporting documentation.
92 *
93 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
94 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
95 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
96 *
97 * Carnegie Mellon requests users of this software to return to
98 *
99 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
100 * School of Computer Science
101 * Carnegie Mellon University
102 * Pittsburgh PA 15213-3890
103 *
104 * any improvements or extensions that they make and grant Carnegie Mellon rights
105 * to redistribute these changes.
106 */
107 /*
108 */
109 #ifndef _SYS_TYPES_H_
110 #define _SYS_TYPES_H_
111
112 #ifndef ASSEMBLER
113
114 /*
115 * Common type definitions that lots of old files seem to want.
116 */
117
118 typedef unsigned char u_char; /* unsigned char */
119 typedef unsigned short u_short; /* unsigned short */
120 typedef unsigned int u_int; /* unsigned int */
121 typedef unsigned long u_long; /* unsigned long */
122
123 typedef struct _quad_ {
124 unsigned int val[2]; /* 2 32-bit values make... */
125 } quad; /* an 8-byte item */
126
127 typedef char * caddr_t; /* address of a (signed) char */
128
129 typedef int time_t; /* a signed 32 */
130 typedef unsigned int daddr_t; /* an unsigned 32 */
131 typedef unsigned int off_t; /* another unsigned 32 */
132
133 typedef unsigned short dev_t; /* another unsigned short */
134 #define NODEV ((dev_t)-1) /* and a null value for it */
135
136 #define major(i) (((i) >> 8) & 0xFF)
137 #define minor(i) ((i) & 0xFF)
138 #define makedev(i,j) ((((i) & 0xFF) << 8) | ((j) & 0xFF))
139
140 #define NBBY 8
141
142 #ifndef NULL
143 #define NULL ((void *) 0) /* the null pointer */
144 #endif
145
146 /*
147 * Shorthand type definitions for unsigned storage classes
148 */
149 typedef unsigned char uchar_t;
150 typedef unsigned short ushort_t;
151 typedef unsigned int uint_t;
152 typedef unsigned long ulong_t;
153 typedef volatile unsigned char vuchar_t;
154 typedef volatile unsigned short vushort_t;
155 typedef volatile unsigned int vuint_t;
156 typedef volatile unsigned long vulong_t;
157
158 /*
159 * Shorthand type definitions for unsigned storage classes
160 */
161 typedef uchar_t uchar;
162 typedef ushort_t ushort;
163 typedef uint_t uint;
164 typedef ulong_t ulong;
165
166 #endif /* !ASSEMBLER */
167
168 #endif /* _SYS_TYPES_H_ */