Skip to content

Commit

Permalink
Fixup setup.S build
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Sep 10, 2023
1 parent faf0113 commit 935613d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions elks/include/linuxmt/kdev_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
/* Some programs want their definitions of MAJOR and MINOR and MKDEV
* from the kernel sources. Here we use unsigned short instead of __u16.
*/
#ifdef __ASSEMBLER__
#define _CAST_U16
#else
#define _CAST_U16 (unsigned short)
#endif

#define MINORBITS 8
#define MINORMASK ((1 << MINORBITS) - 1)
#define MAJOR(dev) ((unsigned short) ((dev) >> MINORBITS))
#define MINOR(dev) ((unsigned short) ((dev) & MINORMASK))
#define MKDEV(major,minor) ((unsigned short) (((major) << MINORBITS) | (minor)))
#define MAJOR(dev) (_CAST_U16 ((dev) >> MINORBITS))
#define MINOR(dev) (_CAST_U16 ((dev) & MINORMASK))
#define MKDEV(major,minor) (_CAST_U16 (((major) << MINORBITS) | (minor)))
#define NODEV MKDEV(0,0)

#if defined(__KERNEL__) && !defined(__ASSEMBLER__)
Expand Down

0 comments on commit 935613d

Please sign in to comment.