xref: /linux/tools/include/nolibc/sys/sysmacros.h (revision 015a99fa76650e7d6efa3e36f20c0f5b346fe9ce)
1*e1211e22SThomas Weißschuh /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2*e1211e22SThomas Weißschuh /*
3*e1211e22SThomas Weißschuh  * Sysmacro definitions for NOLIBC
4*e1211e22SThomas Weißschuh  * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
5*e1211e22SThomas Weißschuh  */
6*e1211e22SThomas Weißschuh 
7*e1211e22SThomas Weißschuh /* make sure to include all global symbols */
8*e1211e22SThomas Weißschuh #include "../nolibc.h"
9*e1211e22SThomas Weißschuh 
10*e1211e22SThomas Weißschuh #ifndef _NOLIBC_SYS_SYSMACROS_H
11*e1211e22SThomas Weißschuh #define _NOLIBC_SYS_SYSMACROS_H
12*e1211e22SThomas Weißschuh 
13*e1211e22SThomas Weißschuh #include "../std.h"
14*e1211e22SThomas Weißschuh 
15*e1211e22SThomas Weißschuh /* WARNING, it only deals with the 4096 first majors and 256 first minors */
16*e1211e22SThomas Weißschuh #define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff)))
17*e1211e22SThomas Weißschuh #define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff))
18*e1211e22SThomas Weißschuh #define minor(dev) ((unsigned int)((dev) & 0xff))
19*e1211e22SThomas Weißschuh 
20*e1211e22SThomas Weißschuh #endif /* _NOLIBC_SYS_SYSMACROS_H */
21