Re: per-cpu data...

Jamie Lokier (lk@tantalophile.demon.co.uk)
Wed, 24 Jul 2002 13:31:29 +0100


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

enjoy,
-- Jamie
-
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/