Re: need type to carry kernel pointers to user space

From: Werner Almesberger (almesber@lrc.di.epfl.ch)
Date: Thu Jan 20 2000 - 12:08:45 EST


Richard B. Johnson wrote:
> Okay. I get it. The "catch-all" which will work on every architecture,
> including those which have not been invented yet, is a (don't laugh)
> character array. Think about it. Simple casts+dereference gets to/from
> anything you want. Sixteen bytes per element, with the start aligned
> properly, will store anything up to 128 bits in length.

Yes, zeroing and casts would work for the kernel (zeroing in order to
avoid garbage from confusing user space if we don't use the entire
fixed-size field), along with the right alignment, and the user space
could just do a memcmp-equivalent that's optimized this type of object.

Still looks a bit clumsy to me when compared to the sheer elegance of
an assignment and "normal" operations, but maybe that's just a
question of perception.

Yep, sounds okay. Let's go for this approach then.

Thanks,
- Werner

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:21 EST