per-cpu data...

Rusty Russell (rusty@rustcorp.com.au)
Fri, 12 Jul 2002 16:01:52 +1000


IIUC, __per_cpu_data is insufficient for Alpha as stands, to use
thread-specific gcc tricks (__thread prepended to the decl, even
though they had a perfectly good __attribute__ extension already).

So, I guess we're stuck with something like:

DECLARE_PER_CPU(int x);

If we're going to do this, we can also mangle the name as well to
avoid accidental "direct" accesses:

eg:
#define DECLARE_PER_CPU(var)
var##__percpu __attribute__((section(".percpu")))

/* If not SMP: */
#define per_cpu(var) var##__percpu

(From my reading, ## on "int x" and "__per_cpu" is well-defined).

Thoughts?
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/