[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1523436662.1414.12.camel@intel.com>
Date: Wed, 11 Apr 2018 08:51:03 +0000
From: "Zhang, Ning A" <ning.a.zhang@...el.com>
To: "pombredanne@...b.com" <pombredanne@...b.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"kstewart@...uxfoundation.org" <kstewart@...uxfoundation.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 3 version of MKDEV: kernel, uapi, libc, why?
Hi, Greg, Thomas
I find 3 version of MKDEV (actually 2 + makedev)
in include/linux/kdev_t.h
#define MINORBITS 20
#define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi))
in inlcude/uapi/linux/kdev_t.h
#define MKDEV(ma,mi) ((ma)<<8 | (mi))
in Android bionic
#define makedev(__major, __minor) \
( \
(((__major) & 0xfffff000ULL) << 32) | (((__major) & 0xfffULL) <<
8) | \
(((__minor) & 0xffffff00ULL) << 12) | (((__minor) & 0xffULL)) \
)
if I use mknod("renderD128", S_IFCHR|0666, MKDEV(226, 128));
I get wrong device:
crw-rw-rw- 1 root graphics 0, 57984 2011-11-11 11:20 renderD128
if I use ("renderD128",S_IFCHR|0666, makedev(226, 128));
I get right device.
but, when I use: mknod("card0", S_IFCHR|0666, MKDEV(226, 0));
I can get right device.
BR.
Ning.
Powered by blists - more mailing lists