Re: per-cpu data...

Rusty Russell (rusty@rustcorp.com.au)
Thu, 25 Jul 2002 10:28:13 +1000


In message <20020724133128.A7192@kushida.apsleyroad.org> you write:
> Rusty Russell wrote:
> > (From my reading, ## on "int x" and "__per_cpu" is well-defined).
>
> DECLARE_PER_CPU (int x[3]);
>
> doesn't work, although you can always do
>
> typedef int three_ints_t[3];
> DECLARE_PER_CPU (three_ints_t x);
>
> I encountered the same thing while doing a user-space
> `MAKE_THREAD_SPECIFIC' macro. The solution I went for looks like this:
>
> #define DECLARE_PER_CPU(type, name) \
> __attribute__ ((__section (".percpu"))) __typeof__ (type) name##__per_cpu

Hmmm.... Yeah, might as well go the whole way.

Thanks!
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/