Re: per-cpu data...

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Wed Jul 24 2002 - 07:31:29 EST


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/



This archive was generated by hypermail 2b29 : Tue Jul 30 2002 - 14:00:15 EST