tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: UVM typedef struct

On Mon, Aug 10, 2009 at 05:45:54PM -0700, Jason Thorpe wrote:
> On Jun 16, 2009, at 12:02 PM, Antti Kantee wrote:
> >The underlying problem is that I do not see any benefit from arbitrary
> >typedefs such as struct x -> x_t.  Will we get u32_t next?
> No, the real benefit is "x * -> x_t".

Actually that is the one you must not do ...
Since you can't then define 'const x *' etc.

But I agree that most code shouldn't be dependant on the offsets of the
majority of the members of most functions, and definitely not on the
size of such structures.

For example the contents of 'struct proc' and 'struct lwp' should not
be exposed to any driver code, just to some parts of kern.
Possibly you have a sub-structure which is exposed, and can grow, that
contains fields that are commonly needed.


David Laight:

Home | Main Index | Thread Index | Old Index