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