]> git.saurik.com Git - apple/xnu.git/blob - osfmk/libsa/types.h
xnu-792.12.6.tar.gz
[apple/xnu.git] / osfmk / libsa / types.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
5 *
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@
29 */
30 /*
31 * @OSF_COPYRIGHT@
32 */
33 /*
34 * HISTORY
35 *
36 * Revision 1.1.1.1 1998/09/22 21:05:51 wsanchez
37 * Import of Mac OS X kernel (~semeria)
38 *
39 * Revision 1.1.1.1 1998/03/07 02:25:35 wsanchez
40 * Import of OSF Mach kernel (~mburg)
41 *
42 * Revision 1.1.2.1 1996/09/17 16:56:21 bruel
43 * created from standalone mach servers.
44 * [96/09/17 bruel]
45 *
46 * $EndLog$
47 */
48
49 #ifndef _MACH_TYPES_H_
50 #define _MACH_TYPES_H_
51
52 #include "machine/types.h"
53
54 #ifndef _SIZE_T
55 #define _SIZE_T
56 typedef unsigned long size_t;
57 #endif /* _SIZE_T */
58
59 /*
60 * Common type definitions that lots of old files seem to want.
61 */
62
63 typedef unsigned char u_char; /* unsigned char */
64 typedef unsigned short u_short; /* unsigned short */
65 typedef unsigned int u_int; /* unsigned int */
66 typedef unsigned long u_long; /* unsigned long */
67
68 typedef struct _quad_ {
69 unsigned int val[2]; /* 2 32-bit values make... */
70 } quad; /* an 8-byte item */
71
72 typedef char * caddr_t; /* address of a (signed) char */
73
74 typedef int time_t; /* a signed 32 */
75 typedef unsigned int daddr_t; /* an unsigned 32 */
76 #if 0 /* off_t should be 64-bit ! */
77 typedef unsigned int off_t; /* another unsigned 32 */
78 #endif
79
80
81 #define major(i) (((i) >> 8) & 0xFF)
82 #define minor(i) ((i) & 0xFF)
83 #define makedev(i,j) ((((i) & 0xFF) << 8) | ((j) & 0xFF))
84
85 #ifndef NULL
86 #define NULL ((void *) 0) /* the null pointer */
87 #endif
88
89 /*
90 * Shorthand type definitions for unsigned storage classes
91 */
92 typedef unsigned char uchar_t;
93 typedef unsigned short ushort_t;
94 typedef unsigned int uint_t;
95 typedef unsigned long ulong_t;
96 typedef volatile unsigned char vuchar_t;
97 typedef volatile unsigned short vushort_t;
98 typedef volatile unsigned int vuint_t;
99 typedef volatile unsigned long vulong_t;
100 #endif /* _MACH_TYPES_H_ */