summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-08-12 20:27:49 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-08-12 20:27:49 -0700
commita2314817f1e46d6596a5f86d8f7cd1def5e7846d (patch)
tree402a20644aa4af03fa8263d0e04bf856d56c7599 /include/linux
parent466e44bb94c10842f9e34b4692e01bd7210c2a89 (diff)
[PATCH] DECLARE_PER_CPU/DEFINE_PER_CPU patch
This old __per_cpu_data define wasn't enough if an arch wants to use the gcc __thread prefix (thread local storage), which needs to go *before* the type in the definition. So we have to go for a DECLARE macro, and while we're there, separate DECLARE and DEFINE, as definitions of per-cpu data cannot live in modules. This also means that accidental direct references to per-cpu variables will be caught at compile time.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/percpu.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index deac3ced6a2c..06ff863fbc95 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -1,16 +1,9 @@
#ifndef __LINUX_PERCPU_H
#define __LINUX_PERCPU_H
-#include <linux/config.h>
-
-#ifdef CONFIG_SMP
-#define __per_cpu_data __attribute__((section(".data.percpu")))
+#include <linux/spinlock.h> /* For preempt_disable() */
#include <asm/percpu.h>
-#else
-#define __per_cpu_data
-#define per_cpu(var, cpu) var
-#define __get_cpu_var(var) var
-#endif
#define get_cpu_var(var) ({ preempt_disable(); __get_cpu_var(var); })
#define put_cpu_var(var) preempt_enable()
+
#endif /* __LINUX_PERCPU_H */