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