The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
sysmacros.h
Go to the documentation of this file.
1#pragma once
2
3/**
4 * @file sys/sysmacros.h
5 * @brief device numbers: a major (the driver) and a minor (the device),
6 * packed as Linux packs them in 32 bits.
7 */
8
9#define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff))
10#define minor(dev) ((unsigned int)(((dev) & 0xff) | (((dev) >> 12) & 0xfff00)))
11#define makedev(ma, mi) ((((ma) & 0xfff) << 8) | ((mi) & 0xff) | (((mi) & 0xfff00) << 12))