diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-12-27 03:35:12 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-27 03:35:12 -0500 |
commit | 86ed40bd6fe511d26bb8f3fa65a84cb65c235366 (patch) | |
tree | 12ec939078887d6f5bc437cfd8ac34eff610c715 /arch/sparc | |
parent | b74e34dbdeb39136e0557930a373392b7d644f43 (diff) |
sparc: unify sections.h
While doing this use standard names for start/end
so we could use definitions straight from asm-generic
for all the typical symbols.
This also allowed us to drop the use of PROVIDE in the linker
script so sprc is less non-standard on this area.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/sections.h | 16 | ||||
-rw-r--r-- | arch/sparc/include/asm/sections_32.h | 6 | ||||
-rw-r--r-- | arch/sparc/include/asm/sections_64.h | 9 | ||||
-rw-r--r-- | arch/sparc/kernel/head_32.S | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/vmlinux.lds.S | 3 | ||||
-rw-r--r-- | arch/sparc/mm/init_32.c | 14 | ||||
-rw-r--r-- | arch/sparc/mm/sun4c.c | 4 |
7 files changed, 19 insertions, 35 deletions
diff --git a/arch/sparc/include/asm/sections.h b/arch/sparc/include/asm/sections.h index c7c69b00967f..0b0553bbd8a0 100644 --- a/arch/sparc/include/asm/sections.h +++ b/arch/sparc/include/asm/sections.h | |||
@@ -1,8 +1,10 @@ | |||
1 | #ifndef ___ASM_SPARC_SECTIONS_H | 1 | #ifndef __SPARC_SECTIONS_H |
2 | #define ___ASM_SPARC_SECTIONS_H | 2 | #define __SPARC_SECTIONS_H |
3 | #if defined(__sparc__) && defined(__arch64__) | 3 | |
4 | #include <asm/sections_64.h> | 4 | /* nothing to see, move along */ |
5 | #else | 5 | #include <asm-generic/sections.h> |
6 | #include <asm/sections_32.h> | 6 | |
7 | #endif | 7 | /* sparc entry point */ |
8 | extern char _start[]; | ||
9 | |||
8 | #endif | 10 | #endif |
diff --git a/arch/sparc/include/asm/sections_32.h b/arch/sparc/include/asm/sections_32.h deleted file mode 100644 index 6832841df051..000000000000 --- a/arch/sparc/include/asm/sections_32.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _SPARC_SECTIONS_H | ||
2 | #define _SPARC_SECTIONS_H | ||
3 | |||
4 | #include <asm-generic/sections.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/sparc/include/asm/sections_64.h b/arch/sparc/include/asm/sections_64.h deleted file mode 100644 index 3f4b9fdc28d0..000000000000 --- a/arch/sparc/include/asm/sections_64.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef _SPARC64_SECTIONS_H | ||
2 | #define _SPARC64_SECTIONS_H | ||
3 | |||
4 | /* nothing to see, move along */ | ||
5 | #include <asm-generic/sections.h> | ||
6 | |||
7 | extern char _start[]; | ||
8 | |||
9 | #endif | ||
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S index 51b40426f9c6..f0b4b516304f 100644 --- a/arch/sparc/kernel/head_32.S +++ b/arch/sparc/kernel/head_32.S | |||
@@ -990,7 +990,7 @@ sun4c_continue_boot: | |||
990 | 990 | ||
991 | /* Zero out our BSS section. */ | 991 | /* Zero out our BSS section. */ |
992 | set __bss_start , %o0 ! First address of BSS | 992 | set __bss_start , %o0 ! First address of BSS |
993 | set end , %o1 ! Last address of BSS | 993 | set _end , %o1 ! Last address of BSS |
994 | add %o0, 0x1, %o0 | 994 | add %o0, 0x1, %o0 |
995 | 1: | 995 | 1: |
996 | stb %g0, [%o0] | 996 | stb %g0, [%o0] |
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S index 59c8d090920c..76267085b13b 100644 --- a/arch/sparc/kernel/vmlinux.lds.S +++ b/arch/sparc/kernel/vmlinux.lds.S | |||
@@ -49,7 +49,6 @@ SECTIONS | |||
49 | *(.gnu.warning) | 49 | *(.gnu.warning) |
50 | } = 0 | 50 | } = 0 |
51 | _etext = .; | 51 | _etext = .; |
52 | PROVIDE (etext = .); | ||
53 | 52 | ||
54 | RO_DATA(PAGE_SIZE) | 53 | RO_DATA(PAGE_SIZE) |
55 | .data : { | 54 | .data : { |
@@ -69,7 +68,6 @@ SECTIONS | |||
69 | } | 68 | } |
70 | /* End of data section */ | 69 | /* End of data section */ |
71 | _edata = .; | 70 | _edata = .; |
72 | PROVIDE (edata = .); | ||
73 | 71 | ||
74 | /* init_task */ | 72 | /* init_task */ |
75 | . = ALIGN(THREAD_SIZE); | 73 | . = ALIGN(THREAD_SIZE); |
@@ -172,7 +170,6 @@ SECTIONS | |||
172 | *(COMMON) | 170 | *(COMMON) |
173 | } | 171 | } |
174 | _end = . ; | 172 | _end = . ; |
175 | PROVIDE (end = .); | ||
176 | 173 | ||
177 | /DISCARD/ : { | 174 | /DISCARD/ : { |
178 | EXIT_TEXT | 175 | EXIT_TEXT |
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index 677c1e187a23..fec926021f49 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/pagemap.h> | 25 | #include <linux/pagemap.h> |
26 | #include <linux/poison.h> | 26 | #include <linux/poison.h> |
27 | 27 | ||
28 | #include <asm/sections.h> | ||
28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
29 | #include <asm/vac-ops.h> | 30 | #include <asm/vac-ops.h> |
30 | #include <asm/page.h> | 31 | #include <asm/page.h> |
@@ -48,9 +49,6 @@ unsigned long sparc_unmapped_base; | |||
48 | 49 | ||
49 | struct pgtable_cache_struct pgt_quicklists; | 50 | struct pgtable_cache_struct pgt_quicklists; |
50 | 51 | ||
51 | /* References to section boundaries */ | ||
52 | extern char __init_begin, __init_end, _start, _end, etext , edata; | ||
53 | |||
54 | /* Initial ramdisk setup */ | 52 | /* Initial ramdisk setup */ |
55 | extern unsigned int sparc_ramdisk_image; | 53 | extern unsigned int sparc_ramdisk_image; |
56 | extern unsigned int sparc_ramdisk_size; | 54 | extern unsigned int sparc_ramdisk_size; |
@@ -450,9 +448,9 @@ void __init mem_init(void) | |||
450 | 448 | ||
451 | totalram_pages += totalhigh_pages; | 449 | totalram_pages += totalhigh_pages; |
452 | 450 | ||
453 | codepages = (((unsigned long) &etext) - ((unsigned long)&_start)); | 451 | codepages = (((unsigned long) &_etext) - ((unsigned long)&_start)); |
454 | codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT; | 452 | codepages = PAGE_ALIGN(codepages) >> PAGE_SHIFT; |
455 | datapages = (((unsigned long) &edata) - ((unsigned long)&etext)); | 453 | datapages = (((unsigned long) &_edata) - ((unsigned long)&_etext)); |
456 | datapages = PAGE_ALIGN(datapages) >> PAGE_SHIFT; | 454 | datapages = PAGE_ALIGN(datapages) >> PAGE_SHIFT; |
457 | initpages = (((unsigned long) &__init_end) - ((unsigned long) &__init_begin)); | 455 | initpages = (((unsigned long) &__init_end) - ((unsigned long) &__init_begin)); |
458 | initpages = PAGE_ALIGN(initpages) >> PAGE_SHIFT; | 456 | initpages = PAGE_ALIGN(initpages) >> PAGE_SHIFT; |
@@ -476,8 +474,10 @@ void __init mem_init(void) | |||
476 | void free_initmem (void) | 474 | void free_initmem (void) |
477 | { | 475 | { |
478 | unsigned long addr; | 476 | unsigned long addr; |
477 | unsigned long freed; | ||
479 | 478 | ||
480 | addr = (unsigned long)(&__init_begin); | 479 | addr = (unsigned long)(&__init_begin); |
480 | freed = (unsigned long)(&__init_end) - addr; | ||
481 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { | 481 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { |
482 | struct page *p; | 482 | struct page *p; |
483 | 483 | ||
@@ -490,8 +490,8 @@ void free_initmem (void) | |||
490 | totalram_pages++; | 490 | totalram_pages++; |
491 | num_physpages++; | 491 | num_physpages++; |
492 | } | 492 | } |
493 | printk(KERN_INFO "Freeing unused kernel memory: %dk freed\n", | 493 | printk(KERN_INFO "Freeing unused kernel memory: %ldk freed\n", |
494 | (&__init_end - &__init_begin) >> 10); | 494 | freed >> 10); |
495 | } | 495 | } |
496 | 496 | ||
497 | #ifdef CONFIG_BLK_DEV_INITRD | 497 | #ifdef CONFIG_BLK_DEV_INITRD |
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index ad0ce117f352..2ffacd67c424 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/seq_file.h> | 18 | #include <linux/seq_file.h> |
19 | #include <linux/scatterlist.h> | 19 | #include <linux/scatterlist.h> |
20 | 20 | ||
21 | #include <asm/sections.h> | ||
21 | #include <asm/page.h> | 22 | #include <asm/page.h> |
22 | #include <asm/pgalloc.h> | 23 | #include <asm/pgalloc.h> |
23 | #include <asm/pgtable.h> | 24 | #include <asm/pgtable.h> |
@@ -1951,7 +1952,6 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p | |||
1951 | } | 1952 | } |
1952 | 1953 | ||
1953 | extern void sparc_context_init(int); | 1954 | extern void sparc_context_init(int); |
1954 | extern unsigned long end; | ||
1955 | extern unsigned long bootmem_init(unsigned long *pages_avail); | 1955 | extern unsigned long bootmem_init(unsigned long *pages_avail); |
1956 | extern unsigned long last_valid_pfn; | 1956 | extern unsigned long last_valid_pfn; |
1957 | 1957 | ||
@@ -1962,7 +1962,7 @@ void __init sun4c_paging_init(void) | |||
1962 | extern struct resource sparc_iomap; | 1962 | extern struct resource sparc_iomap; |
1963 | unsigned long end_pfn, pages_avail; | 1963 | unsigned long end_pfn, pages_avail; |
1964 | 1964 | ||
1965 | kernel_end = (unsigned long) &end; | 1965 | kernel_end = (unsigned long) &_end; |
1966 | kernel_end = SUN4C_REAL_PGDIR_ALIGN(kernel_end); | 1966 | kernel_end = SUN4C_REAL_PGDIR_ALIGN(kernel_end); |
1967 | 1967 | ||
1968 | pages_avail = 0; | 1968 | pages_avail = 0; |