percpu: Unify input section names
Mike Frysinger [Sun, 3 Apr 2011 23:41:32 +0000 (01:41 +0200)]
The two percpu helper macros have the section names duplicated.  So create
a new define to merge the two.  This also allows arches who need to link
things more directly themselves to avoid duplicating the input sections in
their linker script.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Tejun Heo <tj@kernel.org>

include/asm-generic/vmlinux.lds.h

index 32c45e5..bf90fbc 100644 (file)
        }
 
 /**
+ * PERCPU_INPUT - the percpu input sections
+ * @cacheline: cacheline size
+ *
+ * The core percpu section names and core symbols which do not rely
+ * directly upon load addresses.
+ *
+ * @cacheline is used to align subsections to avoid false cacheline
+ * sharing between subsections for different purposes.
+ */
+#define PERCPU_INPUT(cacheline)                                                \
+       VMLINUX_SYMBOL(__per_cpu_start) = .;                            \
+       *(.data..percpu..first)                                         \
+       . = ALIGN(PAGE_SIZE);                                           \
+       *(.data..percpu..page_aligned)                                  \
+       . = ALIGN(cacheline);                                           \
+       *(.data..percpu..readmostly)                                    \
+       . = ALIGN(cacheline);                                           \
+       *(.data..percpu)                                                \
+       *(.data..percpu..shared_aligned)                                \
+       VMLINUX_SYMBOL(__per_cpu_end) = .;
+
+/**
  * PERCPU_VADDR - define output section for percpu area
  * @cacheline: cacheline size
  * @vaddr: explicit base address (optional)
        VMLINUX_SYMBOL(__per_cpu_load) = .;                             \
        .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load)         \
                                - LOAD_OFFSET) {                        \
-               VMLINUX_SYMBOL(__per_cpu_start) = .;                    \
-               *(.data..percpu..first)                                 \
-               . = ALIGN(PAGE_SIZE);                                   \
-               *(.data..percpu..page_aligned)                          \
-               . = ALIGN(cacheline);                                   \
-               *(.data..percpu..readmostly)                            \
-               . = ALIGN(cacheline);                                   \
-               *(.data..percpu)                                        \
-               *(.data..percpu..shared_aligned)                        \
-               VMLINUX_SYMBOL(__per_cpu_end) = .;                      \
+               PERCPU_INPUT(cacheline)                                 \
        } phdr                                                          \
        . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu);
 
        . = ALIGN(align);                                               \
        .data..percpu   : AT(ADDR(.data..percpu) - LOAD_OFFSET) {       \
                VMLINUX_SYMBOL(__per_cpu_load) = .;                     \
-               VMLINUX_SYMBOL(__per_cpu_start) = .;                    \
-               *(.data..percpu..first)                                 \
-               . = ALIGN(PAGE_SIZE);                                   \
-               *(.data..percpu..page_aligned)                          \
-               . = ALIGN(cacheline);                                   \
-               *(.data..percpu..readmostly)                            \
-               . = ALIGN(cacheline);                                   \
-               *(.data..percpu)                                        \
-               *(.data..percpu..shared_aligned)                        \
-               VMLINUX_SYMBOL(__per_cpu_end) = .;                      \
+               PERCPU_INPUT(cacheline)                                 \
        }