need type to carry kernel pointers to user space
Mitchell Blank Jr
mitch en sfgoth.com
Jue Ene 20 01:14:13 CST 2000
Richard B. Johnson wrote:
> > Recently, we had a discussion on the linux-atm list about the best approach
> > for passing kernel pointers to user space, and back. The idea is as follows:
> [SNIPPED...]
>
> A pointer in user space is not a pointer in kernel space! Kernel data
> is referenced by a discriptor, referenced as KERNEL_DS, which is not
> accessible from user-mode privilege.
Yes, we (the linux-atm folks) of course know that. The pointer is
treated as an opaque descriptor in user space, just like a file
descriptor is passed back from open(). We just need a type
that is garaunteed to hold a kernel-mode pointer given weird cases
like sparc64 (suppose mips64 and hppa64 will be similar when support
for them arrives)
Personally, I'm advocating __u64. Note that no long-long calculations
need to be done on 32-bit archs - the kernel will cast it down to
"unsigned long" first thing - so all those unpleasantries don't
come into play.
-Mitch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
Más información sobre la lista de distribución Ayuda