]> git.saurik.com Git - apple/xnu.git/blob - osfmk/libsa/types.h
a1a733704e53fdc801a53628a1253268de361e61
[apple/xnu.git] / osfmk / libsa / types.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * @OSF_COPYRIGHT@
25 */
26 /*
27 * HISTORY
28 *
29 * Revision 1.1.1.1 1998/09/22 21:05:51 wsanchez
30 * Import of Mac OS X kernel (~semeria)
31 *
32 * Revision 1.1.1.1 1998/03/07 02:25:35 wsanchez
33 * Import of OSF Mach kernel (~mburg)
34 *
35 * Revision 1.1.2.1 1996/09/17 16:56:21 bruel
36 * created from standalone mach servers.
37 * [96/09/17 bruel]
38 *
39 * $EndLog$
40 */
41
42 #ifndef _MACH_TYPES_H_
43 #define _MACH_TYPES_H_
44
45 #include "machine/types.h"
46
47 #ifndef _SIZE_T
48 #define _SIZE_T
49 typedef unsigned long size_t;
50 #endif /* _SIZE_T */
51
52 /*
53 * Common type definitions that lots of old files seem to want.
54 */
55
56 typedef unsigned char u_char; /* unsigned char */
57 typedef unsigned short u_short; /* unsigned short */
58 typedef unsigned int u_int; /* unsigned int */
59 typedef unsigned long u_long; /* unsigned long */
60
61 typedef struct _quad_ {
62 unsigned int val[2]; /* 2 32-bit values make... */
63 } quad; /* an 8-byte item */
64
65 typedef char * caddr_t; /* address of a (signed) char */
66
67 typedef int time_t; /* a signed 32 */
68 typedef unsigned int daddr_t; /* an unsigned 32 */
69 #if 0 /* off_t should be 64-bit ! */
70 typedef unsigned int off_t; /* another unsigned 32 */
71 #endif
72
73
74 #define major(i) (((i) >> 8) & 0xFF)
75 #define minor(i) ((i) & 0xFF)
76 #define makedev(i,j) ((((i) & 0xFF) << 8) | ((j) & 0xFF))
77
78 #ifndef NULL
79 #define NULL ((void *) 0) /* the null pointer */
80 #endif
81
82 /*
83 * Shorthand type definitions for unsigned storage classes
84 */
85 typedef unsigned char uchar_t;
86 typedef unsigned short ushort_t;
87 typedef unsigned int uint_t;
88 typedef unsigned long ulong_t;
89 typedef volatile unsigned char vuchar_t;
90 typedef volatile unsigned short vushort_t;
91 typedef volatile unsigned int vuint_t;
92 typedef volatile unsigned long vulong_t;
93 #endif /* _MACH_TYPES_H_ */