summaryrefslogtreecommitdiff
path: root/tools/include/nolibc/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/nolibc/types.h')
-rw-r--r--tools/include/nolibc/types.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index 563dbbad0496..b1bff5e717b6 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -162,4 +162,9 @@ struct stat {
time_t st_ctime; /* time of last status change */
};
+/* WARNING, it only deals with the 4096 first majors and 256 first minors */
+#define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff)))
+#define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff))
+#define minor(dev) ((unsigned int)(((dev) & 0xff))
+
#endif /* _NOLIBC_TYPES_H */