Commit 16675c51 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: add asm/sections.h

parent a479e93c
...@@ -45,7 +45,7 @@ char *avail_high; ...@@ -45,7 +45,7 @@ char *avail_high;
unsigned int heap_use; unsigned int heap_use;
unsigned int heap_max; unsigned int heap_max;
extern char _end[]; extern char _start[];
extern char _vmlinux_start[]; extern char _vmlinux_start[];
extern char _vmlinux_end[]; extern char _vmlinux_end[];
extern char _sysmap_start[]; extern char _sysmap_start[];
...@@ -85,7 +85,6 @@ void ...@@ -85,7 +85,6 @@ void
start(unsigned long a1, unsigned long a2, void *promptr) start(unsigned long a1, unsigned long a2, void *promptr)
{ {
unsigned long i, claim_addr, claim_size; unsigned long i, claim_addr, claim_size;
extern char _start;
struct bi_record *bi_recs; struct bi_record *bi_recs;
kernel_entry_t kernel_entry; kernel_entry_t kernel_entry;
Elf64_Ehdr *elf64; Elf64_Ehdr *elf64;
...@@ -101,7 +100,7 @@ start(unsigned long a1, unsigned long a2, void *promptr) ...@@ -101,7 +100,7 @@ start(unsigned long a1, unsigned long a2, void *promptr)
if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4) if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)
exit(); 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 #if 0
sysmap.size = (unsigned long)(_sysmap_end - _sysmap_start); sysmap.size = (unsigned long)(_sysmap_end - _sysmap_start);
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "iSeries_setup.h" #include "iSeries_setup.h"
#include <asm/naca.h> #include <asm/naca.h>
#include <asm/paca.h> #include <asm/paca.h>
#include <asm/sections.h>
#include <asm/iSeries/LparData.h> #include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvCallHpt.h> #include <asm/iSeries/HvCallHpt.h>
#include <asm/iSeries/HvLpConfig.h> #include <asm/iSeries/HvLpConfig.h>
...@@ -91,9 +92,6 @@ extern unsigned long embedded_sysmap_end; ...@@ -91,9 +92,6 @@ extern unsigned long embedded_sysmap_end;
extern unsigned long iSeries_recal_tb; extern unsigned long iSeries_recal_tb;
extern unsigned long iSeries_recal_titan; extern unsigned long iSeries_recal_titan;
extern char _stext;
extern char _etext;
static int mf_initialized = 0; static int mf_initialized = 0;
struct MemoryBlock { struct MemoryBlock {
...@@ -387,7 +385,7 @@ iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -387,7 +385,7 @@ iSeries_init(unsigned long r3, unsigned long r4, unsigned long r5,
if (p > cmd_line && p[-1] != ' ') if (p > cmd_line && p[-1] != ' ')
continue; continue;
dprof_shift = simple_strtoul(q, &q, 0); 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; dprof_len >>= dprof_shift;
size = ((dprof_len * sizeof(unsigned int)) + (PAGE_SIZE-1)) & PAGE_MASK; size = ((dprof_len * sizeof(unsigned int)) + (PAGE_SIZE-1)) & PAGE_MASK;
dprof_buffer = (unsigned int *)((klimit + (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) ...@@ -868,7 +866,7 @@ static void iSeries_setup_dprofile(void)
paca[i].prof_shift = dprof_shift; paca[i].prof_shift = dprof_shift;
paca[i].prof_len = dprof_len-1; paca[i].prof_len = dprof_len-1;
paca[i].prof_buffer = dprof_buffer; paca[i].prof_buffer = dprof_buffer;
paca[i].prof_stext = (unsigned *)&_stext; paca[i].prof_stext = (unsigned *)_stext;
mb(); mb();
paca[i].prof_enabled = 1; paca[i].prof_enabled = 1;
} }
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#include <asm/iSeries/HvCallHpt.h> #include <asm/iSeries/HvCallHpt.h>
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/cputable.h> #include <asm/cputable.h>
#include <asm/sections.h>
struct task_struct *last_task_used_math = NULL; struct task_struct *last_task_used_math = NULL;
...@@ -424,8 +425,6 @@ void initialize_paca_hardware_interrupt_stack(void) ...@@ -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) char *ppc_find_proc_name(unsigned *p, char *buf, unsigned buflen)
{ {
unsigned long tb_flags; unsigned long tb_flags;
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <asm/paca.h> #include <asm/paca.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/time.h> #include <asm/time.h>
#include <asm/sections.h>
extern unsigned long klimit; extern unsigned long klimit;
/* extern void *stab; */ /* extern void *stab; */
...@@ -489,7 +490,6 @@ extern void sort_exception_table(void); ...@@ -489,7 +490,6 @@ extern void sort_exception_table(void);
void __init setup_arch(char **cmdline_p) void __init setup_arch(char **cmdline_p)
{ {
extern int panic_timeout; extern int panic_timeout;
extern char _etext[], _edata[];
extern void do_init_bootmem(void); extern void do_init_bootmem(void);
calibrate_delay = ppc64_calibrate_delay; calibrate_delay = ppc64_calibrate_delay;
...@@ -516,7 +516,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -516,7 +516,7 @@ void __init setup_arch(char **cmdline_p)
init_mm.start_code = PAGE_OFFSET; init_mm.start_code = PAGE_OFFSET;
init_mm.end_code = (unsigned long) _etext; init_mm.end_code = (unsigned long) _etext;
init_mm.end_data = (unsigned long) _edata; 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 */ /* Save unparsed command line copy for /proc/cmdline */
strcpy(saved_command_line, cmd_line); strcpy(saved_command_line, cmd_line);
......
...@@ -58,10 +58,10 @@ ...@@ -58,10 +58,10 @@
#include <asm/iSeries/HvCallXm.h> #include <asm/iSeries/HvCallXm.h>
#endif #endif
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/time.h> #include <asm/time.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/sections.h>
void smp_local_timer_interrupt(struct pt_regs *); void smp_local_timer_interrupt(struct pt_regs *);
...@@ -108,7 +108,6 @@ static inline void ppc64_do_profile(struct pt_regs *regs) ...@@ -108,7 +108,6 @@ static inline void ppc64_do_profile(struct pt_regs *regs)
{ {
unsigned long nip; unsigned long nip;
extern unsigned long prof_cpu_mask; extern unsigned long prof_cpu_mask;
extern char _stext;
profile_hook(regs); profile_hook(regs);
...@@ -127,7 +126,7 @@ static inline void ppc64_do_profile(struct pt_regs *regs) ...@@ -127,7 +126,7 @@ static inline void ppc64_do_profile(struct pt_regs *regs)
if (!((1<<smp_processor_id()) & prof_cpu_mask)) if (!((1<<smp_processor_id()) & prof_cpu_mask))
return; return;
nip -= (unsigned long) &_stext; nip -= (unsigned long)_stext;
nip >>= prof_shift; nip >>= prof_shift;
/* /*
* Don't ignore out-of-bounds EIP values silently, * Don't ignore out-of-bounds EIP values silently,
......
...@@ -348,12 +348,12 @@ check_bug_trap(struct pt_regs *regs) ...@@ -348,12 +348,12 @@ check_bug_trap(struct pt_regs *regs)
/* this is a WARN_ON rather than BUG/BUG_ON */ /* this is a WARN_ON rather than BUG/BUG_ON */
printk(KERN_ERR "Badness in %s at %s:%d\n", printk(KERN_ERR "Badness in %s at %s:%d\n",
bug->function, bug->file, bug->function, bug->file,
bug->line & ~BUG_WARNING_TRAP); (unsigned int)bug->line & ~BUG_WARNING_TRAP);
dump_stack(); dump_stack();
return 1; return 1;
} }
printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n", 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; return 0;
} }
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
#include <asm/cputable.h> #include <asm/cputable.h>
#include <asm/ppcdebug.h> #include <asm/ppcdebug.h>
#include <asm/sections.h>
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
#include <asm/iSeries/iSeries_dma.h> #include <asm/iSeries/iSeries_dma.h>
...@@ -69,9 +69,6 @@ int mem_init_done; ...@@ -69,9 +69,6 @@ int mem_init_done;
unsigned long ioremap_bot = IMALLOC_BASE; unsigned long ioremap_bot = IMALLOC_BASE;
extern pgd_t swapper_pg_dir[]; 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 struct task_struct *current_set[NR_CPUS];
extern pgd_t ioremap_dir[]; extern pgd_t ioremap_dir[];
...@@ -384,15 +381,15 @@ void free_initmem(void) ...@@ -384,15 +381,15 @@ void free_initmem(void)
{ {
unsigned long addr; unsigned long addr;
addr = (unsigned long)(&__init_begin); addr = (unsigned long)__init_begin;
for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr)); ClearPageReserved(virt_to_page(addr));
set_page_count(virt_to_page(addr), 1); set_page_count(virt_to_page(addr), 1);
free_page(addr); free_page(addr);
totalram_pages++; totalram_pages++;
} }
printk ("Freeing unused kernel memory: %luk freed\n", 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 #ifdef CONFIG_BLK_DEV_INITRD
...@@ -589,11 +586,11 @@ void __init mem_init(void) ...@@ -589,11 +586,11 @@ void __init mem_init(void)
addr += PAGE_SIZE) { addr += PAGE_SIZE) {
if (!PageReserved(virt_to_page(addr))) if (!PageReserved(virt_to_page(addr)))
continue; continue;
if (addr < (ulong) etext) if (addr < (unsigned long)_etext)
codepages++; codepages++;
else if (addr >= (unsigned long)&__init_begin else if (addr >= (unsigned long)__init_begin
&& addr < (unsigned long)&__init_end) && addr < (unsigned long)__init_end)
initpages++; initpages++;
else if (addr < klimit) else if (addr < klimit)
datapages++; datapages++;
......
#ifndef _PPC64_SECTIONS_H
#define _PPC64_SECTIONS_H
extern char _end[];
#include <asm-generic/sections.h>
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment