per-cpu data...

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Fri Jul 12 2002 - 01:01:52 EST


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/



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:22 EST