From 16675c518364f45262ef272524802f8d6c8b5eee Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Tue, 29 Jul 2003 10:00:32 +1000 Subject: ppc64: add asm/sections.h --- arch/ppc64/boot/main.c | 5 ++--- arch/ppc64/kernel/iSeries_setup.c | 8 +++----- arch/ppc64/kernel/process.c | 3 +-- arch/ppc64/kernel/setup.c | 4 ++-- arch/ppc64/kernel/time.c | 5 ++--- arch/ppc64/kernel/traps.c | 4 ++-- arch/ppc64/mm/init.c | 17 +++++++---------- include/asm-ppc64/sections.h | 8 ++++++++ 8 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 include/asm-ppc64/sections.h diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c index 51e402af5f8f..f5a9718efd4a 100644 --- a/arch/ppc64/boot/main.c +++ b/arch/ppc64/boot/main.c @@ -45,7 +45,7 @@ char *avail_high; unsigned int heap_use; unsigned int heap_max; -extern char _end[]; +extern char _start[]; extern char _vmlinux_start[]; extern char _vmlinux_end[]; extern char _sysmap_start[]; @@ -85,7 +85,6 @@ void start(unsigned long a1, unsigned long a2, void *promptr) { unsigned long i, claim_addr, claim_size; - extern char _start; struct bi_record *bi_recs; kernel_entry_t kernel_entry; Elf64_Ehdr *elf64; @@ -101,7 +100,7 @@ start(unsigned long a1, unsigned long a2, void *promptr) if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4) exit(); - printf("zImage starting: loaded at 0x%x\n\r", (unsigned)&_start); + printf("zImage starting: loaded at 0x%x\n\r", (unsigned)_start); #if 0 sysmap.size = (unsigned long)(_sysmap_end - _sysmap_start); diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c index b4d54e1c8337..fa1e3317a52a 100644 --- a/arch/ppc64/kernel/iSeries_setup.c +++ b/arch/ppc64/kernel/iSeries_setup.c @@ -39,6 +39,7 @@ #include "iSeries_setup.h" #include #include +#include #include #include #include @@ -91,9 +92,6 @@ extern unsigned long embedded_sysmap_end; extern unsigned long iSeries_recal_tb; extern unsigned long iSeries_recal_titan; -extern char _stext; -extern char _etext; - static int mf_initialized = 0; struct MemoryBlock { @@ -387,7 +385,7 @@ iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5, if (p > cmd_line && p[-1] != ' ') continue; dprof_shift = simple_strtoul(q, &q, 0); - dprof_len = (unsigned long)&_etext - (unsigned long)&_stext; + dprof_len = (unsigned long)_etext - (unsigned long)_stext; dprof_len >>= dprof_shift; size = ((dprof_len * sizeof(unsigned int)) + (PAGE_SIZE-1)) & PAGE_MASK; dprof_buffer = (unsigned int *)((klimit + (PAGE_SIZE-1)) & PAGE_MASK); @@ -868,7 +866,7 @@ static void iSeries_setup_dprofile(void) paca[i].prof_shift = dprof_shift; paca[i].prof_len = dprof_len-1; paca[i].prof_buffer = dprof_buffer; - paca[i].prof_stext = (unsigned *)&_stext; + paca[i].prof_stext = (unsigned *)_stext; mb(); paca[i].prof_enabled = 1; } diff --git a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c index c22a54fe544f..df5d9ffe60c5 100644 --- a/arch/ppc64/kernel/process.c +++ b/arch/ppc64/kernel/process.c @@ -46,6 +46,7 @@ #include #include #include +#include struct task_struct *last_task_used_math = NULL; @@ -424,8 +425,6 @@ void initialize_paca_hardware_interrupt_stack(void) } } -extern char _stext[], _etext[], __init_begin[], __init_end[]; - char *ppc_find_proc_name(unsigned *p, char *buf, unsigned buflen) { unsigned long tb_flags; diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index 3a1c3d8447eb..b5d5db07a447 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c @@ -38,6 +38,7 @@ #include #include #include +#include extern unsigned long klimit; /* extern void *stab; */ @@ -489,7 +490,6 @@ extern void sort_exception_table(void); void __init setup_arch(char **cmdline_p) { extern int panic_timeout; - extern char _etext[], _edata[]; extern void do_init_bootmem(void); calibrate_delay = ppc64_calibrate_delay; @@ -516,7 +516,7 @@ void __init setup_arch(char **cmdline_p) init_mm.start_code = PAGE_OFFSET; init_mm.end_code = (unsigned long) _etext; init_mm.end_data = (unsigned long) _edata; - init_mm.brk = (unsigned long) klimit; + init_mm.brk = klimit; /* Save unparsed command line copy for /proc/cmdline */ strcpy(saved_command_line, cmd_line); diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c index 262d46277e73..6657873853b3 100644 --- a/arch/ppc64/kernel/time.c +++ b/arch/ppc64/kernel/time.c @@ -58,10 +58,10 @@ #include #endif #include - #include #include #include +#include void smp_local_timer_interrupt(struct pt_regs *); @@ -108,7 +108,6 @@ static inline void ppc64_do_profile(struct pt_regs *regs) { unsigned long nip; extern unsigned long prof_cpu_mask; - extern char _stext; profile_hook(regs); @@ -127,7 +126,7 @@ static inline void ppc64_do_profile(struct pt_regs *regs) if (!((1<>= prof_shift; /* * Don't ignore out-of-bounds EIP values silently, diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c index 97b2b5173dc6..564f01f8df6e 100644 --- a/arch/ppc64/kernel/traps.c +++ b/arch/ppc64/kernel/traps.c @@ -348,12 +348,12 @@ check_bug_trap(struct pt_regs *regs) /* this is a WARN_ON rather than BUG/BUG_ON */ printk(KERN_ERR "Badness in %s at %s:%d\n", bug->function, bug->file, - bug->line & ~BUG_WARNING_TRAP); + (unsigned int)bug->line & ~BUG_WARNING_TRAP); dump_stack(); return 1; } printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n", - bug->function, bug->file, bug->line); + bug->function, bug->file, (unsigned int)bug->line); return 0; } diff --git a/arch/ppc64/mm/init.c b/arch/ppc64/mm/init.c index 4218cb8d59dc..c651f7addaec 100644 --- a/arch/ppc64/mm/init.c +++ b/arch/ppc64/mm/init.c @@ -57,8 +57,8 @@ #include #include #include - #include +#include #ifdef CONFIG_PPC_ISERIES #include @@ -69,9 +69,6 @@ int mem_init_done; unsigned long ioremap_bot = IMALLOC_BASE; extern pgd_t swapper_pg_dir[]; -extern char __init_begin, __init_end; -extern char _start[], _end[]; -extern char _stext[], etext[]; extern struct task_struct *current_set[NR_CPUS]; extern pgd_t ioremap_dir[]; @@ -384,15 +381,15 @@ void free_initmem(void) { unsigned long addr; - addr = (unsigned long)(&__init_begin); - for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { + addr = (unsigned long)__init_begin; + for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) { ClearPageReserved(virt_to_page(addr)); set_page_count(virt_to_page(addr), 1); free_page(addr); totalram_pages++; } printk ("Freeing unused kernel memory: %luk freed\n", - (&__init_end - &__init_begin) >> 10); + ((unsigned long)__init_end - (unsigned long)__init_begin) >> 10); } #ifdef CONFIG_BLK_DEV_INITRD @@ -589,11 +586,11 @@ void __init mem_init(void) addr += PAGE_SIZE) { if (!PageReserved(virt_to_page(addr))) continue; - if (addr < (ulong) etext) + if (addr < (unsigned long)_etext) codepages++; - else if (addr >= (unsigned long)&__init_begin - && addr < (unsigned long)&__init_end) + else if (addr >= (unsigned long)__init_begin + && addr < (unsigned long)__init_end) initpages++; else if (addr < klimit) datapages++; diff --git a/include/asm-ppc64/sections.h b/include/asm-ppc64/sections.h new file mode 100644 index 000000000000..b74722491931 --- /dev/null +++ b/include/asm-ppc64/sections.h @@ -0,0 +1,8 @@ +#ifndef _PPC64_SECTIONS_H +#define _PPC64_SECTIONS_H + +extern char _end[]; + +#include + +#endif -- cgit v1.2.3