[ARM] use asm/sections.h
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Mon, 1 Dec 2008 11:53:07 +0000 (11:53 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 1 Dec 2008 11:53:07 +0000 (11:53 +0000)
Update to use the asm/sections.h header rather than declaring these
symbols ourselves.  Change __data_start to _data to conform with the
naming found within asm/sections.h.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/head-common.S
arch/arm/kernel/module.c
arch/arm/kernel/setup.c
arch/arm/kernel/vmlinux.lds.S
arch/arm/mm/init.c
arch/arm/mm/mm.h
arch/arm/mm/mmu.c
arch/arm/mm/nommu.c

index bde52df1c668e994c3d8c4d6c53ff01f01cacad3..991952c644d1e597afba81c82eb5337ea4c9182b 100644 (file)
@@ -18,7 +18,7 @@
 __switch_data:
        .long   __mmap_switched
        .long   __data_loc                      @ r4
-       .long   __data_start                    @ r5
+       .long   _data                           @ r5
        .long   __bss_start                     @ r6
        .long   _end                            @ r7
        .long   processor_id                    @ r4
index b8d965dcd6fdbfaec4172dc541030e15b5b653c9..dab48f27263f0e20c2e3bdbaf2f1c5ffaf1a1c1f 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/string.h>
 
 #include <asm/pgtable.h>
+#include <asm/sections.h>
 
 #ifdef CONFIG_XIP_KERNEL
 /*
@@ -29,9 +30,8 @@
  * MODULES_VADDR is redefined here and not in asm/memory.h to avoid
  * recompiling the whole kernel when CONFIG_XIP_KERNEL is turned on/off.
  */
-extern void _etext;
 #undef MODULES_VADDR
-#define MODULES_VADDR  (((unsigned long)&_etext + ~PGDIR_MASK) & PGDIR_MASK)
+#define MODULES_VADDR  (((unsigned long)_etext + ~PGDIR_MASK) & PGDIR_MASK)
 #endif
 
 #ifdef CONFIG_MMU
index 4f6ae06d085564c58a262396669c28509f3e8e49..7049815d66d566e7d89c08fd3c25e33b8c48c995 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/cputype.h>
 #include <asm/elf.h>
 #include <asm/procinfo.h>
+#include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/cacheflush.h>
@@ -61,7 +62,6 @@ __setup("fpe=", fpe_setup);
 
 extern void paging_init(struct machine_desc *desc);
 extern void reboot_setup(char *str);
-extern void _text, _etext, __data_start, _edata, _end;
 
 unsigned int processor_id;
 EXPORT_SYMBOL(processor_id);
@@ -484,10 +484,10 @@ request_standard_resources(struct meminfo *mi, struct machine_desc *mdesc)
        struct resource *res;
        int i;
 
-       kernel_code.start   = virt_to_phys(&_text);
-       kernel_code.end     = virt_to_phys(&_etext - 1);
-       kernel_data.start   = virt_to_phys(&__data_start);
-       kernel_data.end     = virt_to_phys(&_end - 1);
+       kernel_code.start   = virt_to_phys(_text);
+       kernel_code.end     = virt_to_phys(_etext - 1);
+       kernel_data.start   = virt_to_phys(_data);
+       kernel_data.end     = virt_to_phys(_end - 1);
 
        for (i = 0; i < mi->nr_banks; i++) {
                if (mi->bank[i].size == 0)
@@ -715,10 +715,10 @@ void __init setup_arch(char **cmdline_p)
                parse_tags(tags);
        }
 
-       init_mm.start_code = (unsigned long) &_text;
-       init_mm.end_code   = (unsigned long) &_etext;
-       init_mm.end_data   = (unsigned long) &_edata;
-       init_mm.brk        = (unsigned long) &_end;
+       init_mm.start_code = (unsigned long) _text;
+       init_mm.end_code   = (unsigned long) _etext;
+       init_mm.end_data   = (unsigned long) _edata;
+       init_mm.brk        = (unsigned long) _end;
 
        memcpy(boot_command_line, from, COMMAND_LINE_SIZE);
        boot_command_line[COMMAND_LINE_SIZE-1] = '\0';
index 4898bdcfe7dd638b5c4d9962f3932244a1249a38..00216071eaf72d2bf87ddccbfe4f6a95e4ce2d4f 100644 (file)
@@ -119,7 +119,7 @@ SECTIONS
 #endif
 
        .data : AT(__data_loc) {
-               __data_start = .;       /* address in memory */
+               _data = .;              /* address in memory */
 
                /*
                 * first, the init task union, aligned
index ab5c9abd5c345e1eb9ed369027e75c0f86c96d84..34df4d9d03a6afb6f7a65627bb86d3da56c05cba 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/initrd.h>
 
 #include <asm/mach-types.h>
+#include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/sizes.h>
 #include <asm/tlb.h>
@@ -129,7 +130,7 @@ find_bootmap_pfn(int node, struct meminfo *mi, unsigned int bootmap_pages)
 {
        unsigned int start_pfn, i, bootmap_pfn;
 
-       start_pfn   = PAGE_ALIGN(__pa(&_end)) >> PAGE_SHIFT;
+       start_pfn   = PAGE_ALIGN(__pa(_end)) >> PAGE_SHIFT;
        bootmap_pfn = 0;
 
        for_each_nodebank(i, mi, node) {
@@ -515,9 +516,9 @@ void __init mem_init(void)
        }
        printk(" = %luMB total\n", num_physpages >> (20 - PAGE_SHIFT));
 
-       codesize = &_etext - &_text;
-       datasize = &_end - &__data_start;
-       initsize = &__init_end - &__init_begin;
+       codesize = _etext - _text;
+       datasize = _end - _data;
+       initsize = __init_end - __init_begin;
 
        printk(KERN_NOTICE "Memory: %luKB available (%dK code, "
                "%dK data, %dK init)\n",
@@ -538,8 +539,8 @@ void __init mem_init(void)
 void free_initmem(void)
 {
        if (!machine_is_integrator() && !machine_is_cintegrator())
-               totalram_pages += free_area(__phys_to_pfn(__pa(&__init_begin)),
-                                           __phys_to_pfn(__pa(&__init_end)),
+               totalram_pages += free_area(__phys_to_pfn(__pa(__init_begin)),
+                                           __phys_to_pfn(__pa(__init_end)),
                                            "init");
 }
 
index 94367bdbb5a8579863b22437656216f8bd1b371d..95bbe112965e1a53953eb2a224c6418805876d7e 100644 (file)
@@ -34,5 +34,3 @@ struct pglist_data;
 void __init create_mapping(struct map_desc *md);
 void __init bootmem_init(void);
 void reserve_node_zero(struct pglist_data *pgdat);
-
-extern void _text, _stext, _etext, __data_start, _end, __init_begin, __init_end;
index c0b9a78d7b87eb2c38622656cad3a933bce535ea..2ab5f962a0533c0131ab8f9cfaf73b53abaf5d49 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <asm/cputype.h>
 #include <asm/mach-types.h>
+#include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/sizes.h>
 #include <asm/tlb.h>
@@ -730,7 +731,7 @@ static inline void prepare_page_table(void)
 
 #ifdef CONFIG_XIP_KERNEL
        /* The XIP kernel is mapped in the module area -- skip over it */
-       addr = ((unsigned long)&_etext + PGDIR_SIZE - 1) & PGDIR_MASK;
+       addr = ((unsigned long)_etext + PGDIR_SIZE - 1) & PGDIR_MASK;
 #endif
        for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE)
                pmd_clear(pmd_off_k(addr));
@@ -756,10 +757,10 @@ void __init reserve_node_zero(pg_data_t *pgdat)
         * Note that this can only be in node 0.
         */
 #ifdef CONFIG_XIP_KERNEL
-       reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start,
+       reserve_bootmem_node(pgdat, __pa(_data), _end - _data,
                        BOOTMEM_DEFAULT);
 #else
-       reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext,
+       reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext,
                        BOOTMEM_DEFAULT);
 #endif
 
@@ -838,7 +839,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
 #ifdef CONFIG_XIP_KERNEL
        map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK);
        map.virtual = MODULES_VADDR;
-       map.length = ((unsigned long)&_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK;
+       map.length = ((unsigned long)_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK;
        map.type = MT_ROM;
        create_mapping(&map);
 #endif
index c085f4e8248b0827205986bfe75f62eb8dbbb995..ad7bacc693b2553b3571eee8ee4ec54b1bb44de5 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/io.h>
 
 #include <asm/cacheflush.h>
+#include <asm/sections.h>
 #include <asm/page.h>
 #include <asm/mach/arch.h>
 
@@ -25,10 +26,10 @@ void __init reserve_node_zero(pg_data_t *pgdat)
         * Note that this can only be in node 0.
         */
 #ifdef CONFIG_XIP_KERNEL
-       reserve_bootmem_node(pgdat, __pa(&__data_start), &_end - &__data_start,
+       reserve_bootmem_node(pgdat, __pa(_data), _end - _data,
                        BOOTMEM_DEFAULT);
 #else
-       reserve_bootmem_node(pgdat, __pa(&_stext), &_end - &_stext,
+       reserve_bootmem_node(pgdat, __pa(_stext), _end - _stext,
                        BOOTMEM_DEFAULT);
 #endif