Re: sizeof(dev_t)

2009-07-13 Thread Pei Lin
i think gcc guys want to give a common abstract about "dev_t" not only for linux kernel. So they designed the 64 bit "dev_t" and didn't want to care about kernel's quickly changing. Maybe one day kernel's "dev_t" will update to 64 bit. ^_^. gcc is a compiler ,in my opinion should not be bind in on

Re: sizeof(dev_t)

2009-07-13 Thread SandeepKsinha
Hi Greg, > I am not passing a dev_t as a binary from userspace to kernel space. > > Its a part of the structure. > > Which means it is a "binary" value :) > Yes, it actually is. > > > E.g > > > > struct device_info { > > > > dev_t dev_num; > > ... > > > > } > > Exactly. > > Don't do that, a

Re: sizeof(dev_t)

2009-07-13 Thread Greg KH
On Mon, Jul 13, 2009 at 10:57:05AM +0530, SandeepKsinha wrote: > On Sun, Jul 12, 2009 at 11:44 PM, Greg KH wrote: > > On Sun, Jul 12, 2009 at 10:16:17PM +0530, SandeepKsinha wrote: > > > Hi, > > > to my surprise, > > > the sizeof dev_t differs in usersp

Re: sizeof(dev_t)

2009-07-13 Thread Pei Lin
http://www.cs.helsinki.fi/linux/linux-kernel/2002-02/0452.html i think it is different interface between gcc guys and kernel guys. 2009/7/13 Pei Lin : > WORDSIZE define in /usr/include/bits/wordsize.h by compiler. > > In my opinion, i think why does user space use double size for kernel > space i

Re: sizeof(dev_t)

2009-07-13 Thread Pei Lin
WORDSIZE define in /usr/include/bits/wordsize.h by compiler. In my opinion, i think why does user space use double size for kernel space is that it is easy represented for major and minor dev number, and in kernel space 20 bit for major and 12 bit for minor. 2009/7/13 SandeepKsinha : > > ail.com>

Re: sizeof(dev_t)

2009-07-13 Thread SandeepKsinha
ail.com> wrote: > FYI > > /usr/include/bits/types.h > > /* Fixed-size types, underlying types depend on word size and compiler. */ > typedef signed char __int8_t; > typedef unsigned char __uint8_t; > typedef signed short int __int16_t; > typedef unsigned short int __uint16_t; > typedef signed int

Re: sizeof(dev_t)

2009-07-13 Thread Pei Lin
ace configuration for 64. >> Is it the problem ? > > Explained above. > >> >> BRs, >> >> Lin >> >> 2009/7/13 SandeepKsinha : >> > Hi Greg, >> > >> > find my reply inline. >> > >> > On Sun, Jul 12, 2009 at 11:

Re: sizeof(dev_t)

2009-07-12 Thread SandeepKsinha
> 2009/7/13 SandeepKsinha : > > Hi Greg, > > > > find my reply inline. > > > > On Sun, Jul 12, 2009 at 11:44 PM, Greg KH wrote: > >> > >> On Sun, Jul 12, 2009 at 10:16:17PM +0530, SandeepKsinha wrote: > >> > Hi, > >> > t

Re: sizeof(dev_t)

2009-07-12 Thread Pei Lin
gt;> > Hi, >> > to my surprise, >> > the sizeof dev_t differs in userspace and kernel. >> > Its 8 bytes in userspace and 4bytes in kernel. >> > >> > I am working on a driver, where I include the headers in both user and >> > kernel space. &g

Re: sizeof(dev_t)

2009-07-12 Thread SandeepKsinha
Hi Greg, find my reply inline. On Sun, Jul 12, 2009 at 11:44 PM, Greg KH wrote: > On Sun, Jul 12, 2009 at 10:16:17PM +0530, SandeepKsinha wrote: > > Hi, > > to my surprise, > > the sizeof dev_t differs in userspace and kernel. > > Its 8 bytes in userspace and 4by

Re: sizeof(dev_t)

2009-07-12 Thread Greg KH
On Sun, Jul 12, 2009 at 10:16:17PM +0530, SandeepKsinha wrote: > Hi, > to my surprise, > the sizeof dev_t differs in userspace and kernel. > Its 8 bytes in userspace and 4bytes in kernel. > > I am working on a driver, where I include the headers in both user and > kernel spa

Re: sizeof(dev_t)

2009-07-12 Thread Razvan Deaconescu
On Sun, 2009-07-12 at 22:16 +0530, SandeepKsinha wrote: > > And why the difference ??? There are different definitions: * userspace: check /usr/include/bits/types.h and /usr/include/bits/typesizes.h for __DEV_T_TYPE, __UQUAD_TYPE, __dev_t * kernelspace[1] Razvan [1] http://lxr.linux.no/linux+v

sizeof(dev_t)

2009-07-12 Thread SandeepKsinha
Hi, to my surprise, the sizeof dev_t differs in userspace and kernel. Its 8 bytes in userspace and 4bytes in kernel. I am working on a driver, where I include the headers in both user and kernel space. And I get wrong values due to the difference in sizes. How do I handle such a situation