Skip site navigation (1)Skip section navigation (2)
Date:      30 Sep 2003 18:25:38 +0100
From:      Doug Rabson <dfr@nlsystems.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        net@freebsd.org
Subject:   Re: finishing the if.h/if_var.h split
Message-ID:  <1064942737.14476.8.camel@builder02.qubesoft.com>
In-Reply-To: <20030930172536.U3713@gamplex.bde.org>
References:  <20030930010128.GA31222@Odin.AC.HMC.Edu> <20030930172536.U3713@gamplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2003-09-30 at 09:22, Bruce Evans wrote:

> That's one alternative.  (Far too) many places already use the simple
> alternative of just using "struct device *".  Grep shows 68 lines
> containing "struct device" in *.h and 32 in *.c.  For "device_t", the
> numbers are 2140 in *.h and 5089 in *.c.  This is in a sys tree with
> about 1000 matches of "device_t" in generated files.  There are non-bogus
> uses of "struct device" to avoid namespace pollution in <sys/rman.h>.
> Most other uses are just bogus (modulo the existence of device_t being
> non-bogus -- its opaqueness is negative since anything that wants to
> use it must include <sys/bus.h> and thus can see its internals.  style(9)
> says to not use negatively opaque typedefs).

The internals of struct device are not contained in <sys/bus.h> - it is
completely opaque to users outside subr_bus.c. The main 'bug' here is
the idea that its a good thing to export kernel data structures (struct
ifnet) to userland. The layout of struct ifnet is an implementation
detail - it shouldn't form part of the userland api.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1064942737.14476.8.camel>