Print this page
6136 sysmacros.h unnecessarily polutes the namespace
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/mkdev.h
+++ new/usr/src/uts/common/sys/mkdev.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23 23 *
24 24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 25 * Use is subject to license terms.
26 26 */
27 27
28 28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 29 /* All Rights Reserved */
30 30
31 31 #ifndef _SYS_MKDEV_H
32 32 #define _SYS_MKDEV_H
33 33
34 34 #include <sys/types.h>
35 35
36 36 #ifdef __cplusplus
37 37 extern "C" {
38 38 #endif
39 39
40 40 /*
41 41 * SVR3/Pre-EFT device number constants.
42 42 */
43 43 #define ONBITSMAJOR 7 /* # of SVR3 major device bits */
44 44 #define ONBITSMINOR 8 /* # of SVR3 minor device bits */
45 45 #define OMAXMAJ 0x7f /* SVR3 max major value */
46 46 #define OMAXMIN 0xff /* SVR3 max major value */
47 47
48 48 /*
49 49 * 32-bit Solaris device major/minor sizes.
50 50 */
51 51 #define NBITSMAJOR32 14
52 52 #define NBITSMINOR32 18
53 53 #define MAXMAJ32 0x3ffful /* SVR4 max major value */
54 54 #define MAXMIN32 0x3fffful /* SVR4 max minor value */
55 55
56 56 #define NBITSMAJOR64 32 /* # of major device bits in 64-bit Solaris */
57 57 #define NBITSMINOR64 32 /* # of minor device bits in 64-bit Solaris */
58 58
59 59 #ifdef _LP64
60 60
61 61 #define MAXMAJ64 0xfffffffful /* max major value */
62 62 #define MAXMIN64 0xfffffffful /* max minor value */
63 63
64 64 #define NBITSMAJOR NBITSMAJOR64
65 65 #define NBITSMINOR NBITSMINOR64
66 66 #define MAXMAJ MAXMAJ64
67 67 #define MAXMIN MAXMIN64
68 68
69 69 #else /* !_LP64 */
↓ open down ↓ |
69 lines elided |
↑ open up ↑ |
70 70
71 71 #define NBITSMAJOR NBITSMAJOR32
72 72 #define NBITSMINOR NBITSMINOR32
73 73 #define MAXMAJ MAXMAJ32
74 74 #define MAXMIN MAXMIN32
75 75
76 76 #endif /* !_LP64 */
77 77
78 78 #if !defined(_KERNEL)
79 79
80 -/*
81 - * Undefine sysmacros.h device macros.
82 - */
83 -#undef makedev
84 -#undef major
85 -#undef minor
86 -
87 80 extern dev_t makedev(const major_t, const minor_t);
88 81 extern major_t major(const dev_t);
89 82 extern minor_t minor(const dev_t);
90 83 extern dev_t __makedev(const int, const major_t, const minor_t);
91 84 extern major_t __major(const int, const dev_t);
92 85 extern minor_t __minor(const int, const dev_t);
93 86
94 87 #define OLDDEV 0 /* old device format */
95 88 #define NEWDEV 1 /* new device format */
96 89
97 90 #define makedev(maj, min) (__makedev(NEWDEV, maj, min))
98 91 #define major(dev) (__major(NEWDEV, dev))
99 92 #define minor(dev) (__minor(NEWDEV, dev))
100 93
101 94 #endif /* !defined(_KERNEL) */
102 95
103 96 #ifdef __cplusplus
104 97 }
105 98 #endif
106 99
107 100 #endif /* _SYS_MKDEV_H */
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX