> > > How come param is declared as unsigned long then in the body
> > > of the ehci_tasklet, it is typecasted as (struct ehci_hcd *)?
> > >  Should param be declared as (void *param) not unsigned long?
> > 
> > It's declared as "unsigned long" because that's how tasklets work.

(I should have mentioned "struct tasklet_struct" in <linux/interrupt.h> ...)


> > If "unsigned long" is bigger than a pointer, the extra bits get safely
> > discarded.
> 
> sizeof(unsigned long) is always guaranteed to be equal to sizeof(void *)
> on Linux.  It's one of the compiler assumptions the kernel makes (there
> are some others, and I had a list around here somewhere with them, but I
> can't find it right now...it's in the lkml archives from a few years
> ago if anyone is interested)

It'd be good to see a list of those somewhere in the Documentation
directory ... even better to get rid of such assumptions.  For what it's
worth, the classic assumption was that "sizeof (char *) == sizeof (int)",
and I recall it was the BSD VAX UNIXes that started to assume it
was "unsigned long" not "int" (back when "void *" didn't exist :).

Such assumptions broke where "sizeof (int) == sizeof (short)", and
more recently where the codegen models preserve another classic
BSD-ism, "sizeof (long) == sizeof (int)" ... I think some current 64bit
systems use "sizeof (long long) == sizeof (void *)".

- Dave



_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to