diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 14:53:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 14:53:42 -0400 |
commit | 5129df03d0c44b2d5a5f9d7d52f3b079706b9a8f (patch) | |
tree | 799e309a7db032cb7abe9f0fa910c2989c3fdab5 /include/asm-generic | |
parent | 4d429480352c63db2228489f0db9fd381cdc3c9c (diff) | |
parent | 6988f20fe04e9ef3aea488cb8ab57fbeb78e12f0 (diff) |
Merge branch 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
* 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
percpu: Unify input section names
percpu: Avoid extra NOP in percpu_cmpxchg16b_double
percpu: Cast away printk format warning
percpu: Always align percpu output section to PAGE_SIZE
Fix up fairly trivial conflict in arch/x86/include/asm/percpu.h as per Tejun
Diffstat (limited to 'include/asm-generic')
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 077c00d94f6e..db22d136ad08 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * HEAD_TEXT_SECTION | 15 | * HEAD_TEXT_SECTION |
16 | * INIT_TEXT_SECTION(PAGE_SIZE) | 16 | * INIT_TEXT_SECTION(PAGE_SIZE) |
17 | * INIT_DATA_SECTION(...) | 17 | * INIT_DATA_SECTION(...) |
18 | * PERCPU(CACHELINE_SIZE, PAGE_SIZE) | 18 | * PERCPU_SECTION(CACHELINE_SIZE) |
19 | * __init_end = .; | 19 | * __init_end = .; |
20 | * | 20 | * |
21 | * _stext = .; | 21 | * _stext = .; |
@@ -682,6 +682,28 @@ | |||
682 | } | 682 | } |
683 | 683 | ||
684 | /** | 684 | /** |
685 | * PERCPU_INPUT - the percpu input sections | ||
686 | * @cacheline: cacheline size | ||
687 | * | ||
688 | * The core percpu section names and core symbols which do not rely | ||
689 | * directly upon load addresses. | ||
690 | * | ||
691 | * @cacheline is used to align subsections to avoid false cacheline | ||
692 | * sharing between subsections for different purposes. | ||
693 | */ | ||
694 | #define PERCPU_INPUT(cacheline) \ | ||
695 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | ||
696 | *(.data..percpu..first) \ | ||
697 | . = ALIGN(PAGE_SIZE); \ | ||
698 | *(.data..percpu..page_aligned) \ | ||
699 | . = ALIGN(cacheline); \ | ||
700 | *(.data..percpu..readmostly) \ | ||
701 | . = ALIGN(cacheline); \ | ||
702 | *(.data..percpu) \ | ||
703 | *(.data..percpu..shared_aligned) \ | ||
704 | VMLINUX_SYMBOL(__per_cpu_end) = .; | ||
705 | |||
706 | /** | ||
685 | * PERCPU_VADDR - define output section for percpu area | 707 | * PERCPU_VADDR - define output section for percpu area |
686 | * @cacheline: cacheline size | 708 | * @cacheline: cacheline size |
687 | * @vaddr: explicit base address (optional) | 709 | * @vaddr: explicit base address (optional) |
@@ -703,52 +725,33 @@ | |||
703 | * | 725 | * |
704 | * Note that this macros defines __per_cpu_load as an absolute symbol. | 726 | * Note that this macros defines __per_cpu_load as an absolute symbol. |
705 | * If there is no need to put the percpu section at a predetermined | 727 | * If there is no need to put the percpu section at a predetermined |
706 | * address, use PERCPU(). | 728 | * address, use PERCPU_SECTION. |
707 | */ | 729 | */ |
708 | #define PERCPU_VADDR(cacheline, vaddr, phdr) \ | 730 | #define PERCPU_VADDR(cacheline, vaddr, phdr) \ |
709 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 731 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
710 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ | 732 | .data..percpu vaddr : AT(VMLINUX_SYMBOL(__per_cpu_load) \ |
711 | - LOAD_OFFSET) { \ | 733 | - LOAD_OFFSET) { \ |
712 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 734 | PERCPU_INPUT(cacheline) \ |
713 | *(.data..percpu..first) \ | ||
714 | . = ALIGN(PAGE_SIZE); \ | ||
715 | *(.data..percpu..page_aligned) \ | ||
716 | . = ALIGN(cacheline); \ | ||
717 | *(.data..percpu..readmostly) \ | ||
718 | . = ALIGN(cacheline); \ | ||
719 | *(.data..percpu) \ | ||
720 | *(.data..percpu..shared_aligned) \ | ||
721 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
722 | } phdr \ | 735 | } phdr \ |
723 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu); | 736 | . = VMLINUX_SYMBOL(__per_cpu_load) + SIZEOF(.data..percpu); |
724 | 737 | ||
725 | /** | 738 | /** |
726 | * PERCPU - define output section for percpu area, simple version | 739 | * PERCPU_SECTION - define output section for percpu area, simple version |
727 | * @cacheline: cacheline size | 740 | * @cacheline: cacheline size |
728 | * @align: required alignment | ||
729 | * | 741 | * |
730 | * Align to @align and outputs output section for percpu area. This macro | 742 | * Align to PAGE_SIZE and outputs output section for percpu area. This |
731 | * doesn't manipulate @vaddr or @phdr and __per_cpu_load and | 743 | * macro doesn't manipulate @vaddr or @phdr and __per_cpu_load and |
732 | * __per_cpu_start will be identical. | 744 | * __per_cpu_start will be identical. |
733 | * | 745 | * |
734 | * This macro is equivalent to ALIGN(@align); PERCPU_VADDR(@cacheline,,) | 746 | * This macro is equivalent to ALIGN(PAGE_SIZE); PERCPU_VADDR(@cacheline,,) |
735 | * except that __per_cpu_load is defined as a relative symbol against | 747 | * except that __per_cpu_load is defined as a relative symbol against |
736 | * .data..percpu which is required for relocatable x86_32 configuration. | 748 | * .data..percpu which is required for relocatable x86_32 configuration. |
737 | */ | 749 | */ |
738 | #define PERCPU(cacheline, align) \ | 750 | #define PERCPU_SECTION(cacheline) \ |
739 | . = ALIGN(align); \ | 751 | . = ALIGN(PAGE_SIZE); \ |
740 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ | 752 | .data..percpu : AT(ADDR(.data..percpu) - LOAD_OFFSET) { \ |
741 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ | 753 | VMLINUX_SYMBOL(__per_cpu_load) = .; \ |
742 | VMLINUX_SYMBOL(__per_cpu_start) = .; \ | 754 | PERCPU_INPUT(cacheline) \ |
743 | *(.data..percpu..first) \ | ||
744 | . = ALIGN(PAGE_SIZE); \ | ||
745 | *(.data..percpu..page_aligned) \ | ||
746 | . = ALIGN(cacheline); \ | ||
747 | *(.data..percpu..readmostly) \ | ||
748 | . = ALIGN(cacheline); \ | ||
749 | *(.data..percpu) \ | ||
750 | *(.data..percpu..shared_aligned) \ | ||
751 | VMLINUX_SYMBOL(__per_cpu_end) = .; \ | ||
752 | } | 755 | } |
753 | 756 | ||
754 | 757 | ||