Subject: Re: Initialising pools using link sets
To: ITOH Yasufumi <itohy@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 04/08/2004 22:52:52
ITOH Yasufumi wrote:
> I'm not saying for or against this change, but
>
> simonb@wasabisystems.com writes:
>
> > --- sys/pool.h 9 Jan 2004 19:00:16 -0000 1.42
> > +++ sys/pool.h 5 Apr 2004 05:46:56 -0000
> ...
> > +#define POOL_INIT(pp, size, align, align_offset, flags, wchan, palloc) \
> > +struct pool pp; \
> > +static const struct link_pool_init _link_ ## pp[1] = { \
> > + { &pp, size, align, align_offset, flags, wchan, palloc } \
> > +}; \
> > +__link_set_add_data(pools, _link_ ## pp)
>
> if you use const data, please use __link_set_add_rodata().
Interestingly, it seems to have gone into a readonly section anyway:
4 link_set_pools 000000ec c03e01b4 c03e01b4 002e11b4 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
Probably the "static const ..."? That said, I've changed the macro to
use __link_set_add_rodata anyway.
Thanks,
Simon.
--
Simon Burge <simonb@wasabisystems.com>
NetBSD Support and Service: http://www.wasabisystems.com/