1
0

sysmacros.h 394 B

123456789101112131415
  1. #ifndef _SYS_SYSMACROS_H
  2. #define _SYS_SYSMACROS_H
  3. #define major(x) \
  4. ((unsigned)( (((x)>>31>>1) & 0xfffff000) | (((x)>>8) & 0x00000fff) ))
  5. #define minor(x) \
  6. ((unsigned)( (((x)>>12) & 0xffffff00) | ((x) & 0x000000ff) ))
  7. #define makedev(x,y) ( \
  8. (((x)&0xfffff000ULL) << 32) | \
  9. (((x)&0x00000fffULL) << 8) | \
  10. (((y)&0xffffff00ULL) << 12) | \
  11. (((y)&0x000000ffULL)) )
  12. #endif