Contents of /trunk/mkinitrd-magellan/klibc/usr/include/sys/sysmacros.h
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 723 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 723 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | /* |
2 | * sys/sysmacros.h |
3 | * |
4 | * Constructs to create and pick apart dev_t. The double-underscore |
5 | * versions are macros so they can be used as constants. |
6 | */ |
7 | |
8 | #ifndef _SYS_SYSMACROS_H |
9 | #define _SYS_SYSMACROS_H |
10 | |
11 | #ifndef _SYS_TYPES_H |
12 | # include <sys/types.h> |
13 | #endif |
14 | |
15 | #define __major(__d) (((__d) >> 8) & 0xfff) |
16 | static __inline__ int major(dev_t __d) |
17 | { |
18 | return __major(__d); |
19 | } |
20 | |
21 | #define __minor(__d) (((__d) & 0xff)|(((__d) >> 12) & 0xfff00)) |
22 | static __inline__ int minor(dev_t __d) |
23 | { |
24 | return __minor(__d); |
25 | } |
26 | |
27 | #define __makedev(__ma, __mi) \ |
28 | ((((__ma) & 0xfff) << 8)|((__mi) & 0xff)|(((__mi) & 0xfff00) << 12)) |
29 | static __inline__ dev_t makedev(int __ma, int __mi) |
30 | { |
31 | return __makedev(__ma, __mi); |
32 | } |
33 | |
34 | #endif /* _SYS_SYSMACROS_H */ |