Commit 3a883dd4 authored by David Mosberger's avatar David Mosberger

ia64: Take advantage of <asm/sections.h>.

parent fa3fc4fe
......@@ -9,6 +9,7 @@
#include <asm/patch.h>
#include <asm/processor.h>
#include <asm/sections.h>
#include <asm/system.h>
#include <asm/unistd.h>
......@@ -176,16 +177,8 @@ patch_brl_fsys_bubble_down (unsigned long start, unsigned long end)
void
ia64_patch_gate (void)
{
extern char __start_gate_mckinley_e9_patchlist;
extern char __end_gate_mckinley_e9_patchlist;
extern char __start_gate_vtop_patchlist;
extern char __end_gate_vtop_patchlist;
extern char __start_gate_fsyscall_patchlist;
extern char __end_gate_fsyscall_patchlist;
extern char __start_gate_brl_fsys_bubble_down_patchlist;
extern char __end_gate_brl_fsys_bubble_down_patchlist;
# define START(name) ((unsigned long) &__start_gate_##name##_patchlist)
# define END(name) ((unsigned long)&__end_gate_##name##_patchlist)
# define START(name) ((unsigned long) __start_gate_##name##_patchlist)
# define END(name) ((unsigned long)__end_gate_##name##_patchlist)
patch_fsyscall_table(START(fsyscall), END(fsyscall));
patch_brl_fsys_bubble_down(START(brl_fsys_bubble_down), END(brl_fsys_bubble_down));
......
......@@ -41,6 +41,7 @@
#include <asm/pgtable.h>
#include <asm/processor.h>
#include <asm/sal.h>
#include <asm/sections.h>
#include <asm/smp.h>
#include <asm/system.h>
#include <asm/unistd.h>
......@@ -49,8 +50,6 @@
# error "struct cpuinfo_ia64 too big!"
#endif
extern char _end;
#ifdef CONFIG_SMP
unsigned long __per_cpu_offset[NR_CPUS];
#endif
......@@ -279,7 +278,6 @@ sort_regions (struct rsvd_region *rsvd_region, int max)
static void
find_memory (void)
{
# define KERNEL_END (&_end)
unsigned long bootmap_size;
int n = 0;
......@@ -300,7 +298,7 @@ find_memory (void)
n++;
rsvd_region[n].start = (unsigned long) ia64_imva((void *)KERNEL_START);
rsvd_region[n].end = (unsigned long) ia64_imva(KERNEL_END);
rsvd_region[n].end = (unsigned long) ia64_imva(_end);
n++;
#ifdef CONFIG_BLK_DEV_INITRD
......@@ -363,13 +361,12 @@ find_memory (void)
void __init
setup_arch (char **cmdline_p)
{
extern unsigned long *__start___vtop_patchlist[], *__end____vtop_patchlist[];
extern unsigned long ia64_iobase;
unsigned long phys_iobase;
unw_init();
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end____vtop_patchlist);
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
*cmdline_p = __va(ia64_boot_param->command_line);
strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
......@@ -390,19 +387,6 @@ setup_arch (char **cmdline_p)
find_memory();
#if 0
/* XXX fix me */
init_mm.start_code = (unsigned long) &_stext;
init_mm.end_code = (unsigned long) &_etext;
init_mm.end_data = (unsigned long) &_edata;
init_mm.brk = (unsigned long) &_end;
code_resource.start = virt_to_bus(&_text);
code_resource.end = virt_to_bus(&_etext) - 1;
data_resource.start = virt_to_bus(&_etext);
data_resource.end = virt_to_bus(&_edata) - 1;
#endif
/* process SAL system table: */
ia64_sal_init(efi.sal_systab);
......@@ -687,7 +671,6 @@ get_max_cacheline_size (void)
void
cpu_init (void)
{
extern char __per_cpu_start[], __phys_per_cpu_start[];
extern void __init ia64_mmu_init (void *);
unsigned long num_phys_stacked;
pal_vm_info_2_u_t vmi;
......@@ -696,7 +679,6 @@ cpu_init (void)
void *cpu_data;
#ifdef CONFIG_SMP
extern char __per_cpu_end[];
int cpu;
/*
......@@ -812,9 +794,6 @@ cpu_init (void)
void
check_bugs (void)
{
extern char __start___mckinley_e9_bundles[];
extern char __end___mckinley_e9_bundles[];
ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
(unsigned long) __end___mckinley_e9_bundles);
}
......@@ -23,6 +23,7 @@
#include <asm/hw_irq.h>
#include <asm/ptrace.h>
#include <asm/sal.h>
#include <asm/sections.h>
#include <asm/system.h>
extern unsigned long wall_jiffies;
......@@ -41,7 +42,6 @@ static void
do_profile (unsigned long ip)
{
extern unsigned long prof_cpu_mask;
extern char _stext;
if (!prof_buffer)
return;
......@@ -49,7 +49,7 @@ do_profile (unsigned long ip)
if (!((1UL << smp_processor_id()) & prof_cpu_mask))
return;
ip -= (unsigned long) &_stext;
ip -= (unsigned long) _stext;
ip >>= prof_shift;
/*
* Don't ignore out-of-bounds IP values silently, put them into the last
......
......@@ -39,6 +39,7 @@
#include <asm/ptrace.h>
#include <asm/ptrace_offsets.h>
#include <asm/rse.h>
#include <asm/sections.h>
#include <asm/system.h>
#include <asm/uaccess.h>
......@@ -2178,7 +2179,7 @@ __initcall(create_gate_table);
void __init
unw_init (void)
{
extern int ia64_unw_start, ia64_unw_end, __gp;
extern char __gp[];
extern void unw_hash_index_t_is_too_narrow (void);
long i, off;
......@@ -2211,8 +2212,8 @@ unw_init (void)
unw.lru_head = UNW_CACHE_SIZE - 1;
unw.lru_tail = 0;
init_unwind_table(&unw.kernel_table, "kernel", KERNEL_START, (unsigned long) &__gp,
&ia64_unw_start, &ia64_unw_end);
init_unwind_table(&unw.kernel_table, "kernel", KERNEL_START, (unsigned long) __gp,
__start_unwind, __end_unwind);
}
/*
......
......@@ -27,6 +27,7 @@
#include <asm/patch.h>
#include <asm/pgalloc.h>
#include <asm/sal.h>
#include <asm/sections.h>
#include <asm/system.h>
#include <asm/tlb.h>
#include <asm/uaccess.h>
......@@ -34,9 +35,6 @@
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
/* References to section boundaries: */
extern char _stext, _etext, _edata, __init_begin, __init_end, _end;
extern void ia64_tlb_init (void);
unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL;
......@@ -151,8 +149,8 @@ free_initmem (void)
{
unsigned long addr, eaddr;
addr = (unsigned long) ia64_imva(&__init_begin);
eaddr = (unsigned long) ia64_imva(&__init_end);
addr = (unsigned long) ia64_imva(__init_begin);
eaddr = (unsigned long) ia64_imva(__init_end);
while (addr < eaddr) {
ClearPageReserved(virt_to_page(addr));
set_page_count(virt_to_page(addr), 1);
......@@ -161,7 +159,7 @@ free_initmem (void)
addr += PAGE_SIZE;
}
printk(KERN_INFO "Freeing unused kernel memory: %ldkB freed\n",
(&__init_end - &__init_begin) >> 10);
(__init_end - __init_begin) >> 10);
}
void
......@@ -308,7 +306,6 @@ static void
setup_gate (void)
{
struct page *page;
extern char __start_gate_section[];
/*
* Map the gate page twice: once read-only to export the ELF headers etc. and once
......@@ -671,7 +668,7 @@ mem_init (void)
kclist_add(&kcore_mem, __va(0), max_low_pfn * PAGE_SIZE);
kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
kclist_add(&kcore_kernel, &_stext, &_end - &_stext);
kclist_add(&kcore_kernel, _stext, _end - _stext);
for_each_pgdat(pgdat)
totalram_pages += free_all_bootmem_node(pgdat);
......@@ -679,9 +676,9 @@ mem_init (void)
reserved_pages = 0;
efi_memmap_walk(count_reserved_pages, &reserved_pages);
codesize = (unsigned long) &_etext - (unsigned long) &_stext;
datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
codesize = (unsigned long) _etext - (unsigned long) _stext;
datasize = (unsigned long) _edata - (unsigned long) _etext;
initsize = (unsigned long) __init_end - (unsigned long) __init_begin;
printk(KERN_INFO "Memory: %luk/%luk available (%luk code, %luk reserved, "
"%luk data, %luk init)\n", (unsigned long) nr_free_pages() << (PAGE_SHIFT - 10),
......
......@@ -59,7 +59,7 @@ SECTIONS
{
__start___vtop_patchlist = .;
*(.data.patch.vtop)
__end____vtop_patchlist = .;
__end___vtop_patchlist = .;
}
.data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
......@@ -89,9 +89,9 @@ SECTIONS
{ *(.IA_64.unwind_info*) }
.IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET)
{
ia64_unw_start = .;
__start_unwind = .;
*(.IA_64.unwind*)
ia64_unw_end = .;
__end_unwind = .;
}
RODATA
......
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