mac80211: use a structure to hold the mesh config information element
[safe/jmp/linux-2.6] / include / linux / percpu-defs.h
index cf32838..9bd0319 100644 (file)
  */
 #define DECLARE_PER_CPU_SECTION(type, name, sec)                       \
        extern __PCPU_DUMMY_ATTRS char __pcpu_scope_##name;             \
-       extern __PCPU_ATTRS(sec) __weak __typeof__(type) per_cpu__##name
+       extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name
 
 #define DEFINE_PER_CPU_SECTION(type, name, sec)                                \
        __PCPU_DUMMY_ATTRS char __pcpu_scope_##name;                    \
        __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;                   \
-       __PCPU_ATTRS(sec) __weak __typeof__(type) per_cpu__##name
+       __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES __weak                 \
+       __typeof__(type) per_cpu__##name
 #else
 /*
  * Normal declaration and definition macros.
@@ -70,7 +71,8 @@
        extern __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name
 
 #define DEFINE_PER_CPU_SECTION(type, name, sec)                                \
-       __PCPU_ATTRS(sec) __typeof__(type) per_cpu__##name
+       __PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES                        \
+       __typeof__(type) per_cpu__##name
 #endif
 
 /*
        DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \
        ____cacheline_aligned_in_smp
 
+#define DECLARE_PER_CPU_ALIGNED(type, name)                            \
+       DECLARE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION)    \
+       ____cacheline_aligned
+
+#define DEFINE_PER_CPU_ALIGNED(type, name)                             \
+       DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION)     \
+       ____cacheline_aligned
+
 /*
  * Declaration/definition used for per-CPU variables that must be page aligned.
  */
-#define DECLARE_PER_CPU_PAGE_ALIGNED(type, name)                               \
-       DECLARE_PER_CPU_SECTION(type, name, ".page_aligned")
+#define DECLARE_PER_CPU_PAGE_ALIGNED(type, name)                       \
+       DECLARE_PER_CPU_SECTION(type, name, ".page_aligned")            \
+       __aligned(PAGE_SIZE)
 
 #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name)                                \
-       DEFINE_PER_CPU_SECTION(type, name, ".page_aligned")
+       DEFINE_PER_CPU_SECTION(type, name, ".page_aligned")             \
+       __aligned(PAGE_SIZE)
 
 /*
  * Intermodule exports for per-CPU variables.