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