Having thought and experimented more, I don't see why we need inline assembly at
all and why DPCPU_DEFINE can not simply be defined as follows:
#define DPCPU_DEFINE(t, n) \
t DPCPU_NAME(n) __section("set_pcpu") \
__aligned(CACHE_LINE_SIZE) __used
And, honestly, I can not understand the following comment in pcpu.h, although I
think I understand what's going on.
> /*
> * Define a set for pcpu data.
> *
> * We don't use SET_DECLARE because it defines the set as 'a' when we
Hmm, SET_DECLARE doesn't do anything like that.
Perhaps __MAKE_SET or one of its aliases was meant here?
> * want 'aw'. gcc considers uninitialized data in a separate section
> * writable, and there is no generic zero initializer that works for
> * structs and scalars.
> */
So, what's the problem here?
Don't we want that data to be considered writable? Haven't we just said that we
want "aw"? Don't we explicitly create a section with "aw" flags?
And why do we need a (universal) initializer? Why is it mentioned here at all?
Educate me. I demand it! :-)
--
Andriy Gapon
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"