diff options
Diffstat (limited to 'arch/parisc/mm/init.c')
| -rw-r--r-- | arch/parisc/mm/init.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 25ad28d63e88..0667f2b4f977 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c | |||
| @@ -31,10 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 32 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
| 33 | 33 | ||
| 34 | extern char _text; /* start of kernel code, defined by linker */ | ||
| 35 | extern int data_start; | 34 | extern int data_start; |
| 36 | extern char _end; /* end of BSS, defined by linker */ | ||
| 37 | extern char __init_begin, __init_end; | ||
| 38 | 35 | ||
| 39 | #ifdef CONFIG_DISCONTIGMEM | 36 | #ifdef CONFIG_DISCONTIGMEM |
| 40 | struct node_map_data node_data[MAX_NUMNODES] __read_mostly; | 37 | struct node_map_data node_data[MAX_NUMNODES] __read_mostly; |
| @@ -319,8 +316,8 @@ static void __init setup_bootmem(void) | |||
| 319 | 316 | ||
| 320 | reserve_bootmem_node(NODE_DATA(0), 0UL, | 317 | reserve_bootmem_node(NODE_DATA(0), 0UL, |
| 321 | (unsigned long)(PAGE0->mem_free + PDC_CONSOLE_IO_IODC_SIZE)); | 318 | (unsigned long)(PAGE0->mem_free + PDC_CONSOLE_IO_IODC_SIZE)); |
| 322 | reserve_bootmem_node(NODE_DATA(0),__pa((unsigned long)&_text), | 319 | reserve_bootmem_node(NODE_DATA(0), __pa((unsigned long)_text), |
| 323 | (unsigned long)(&_end - &_text)); | 320 | (unsigned long)(_end - _text)); |
| 324 | reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT), | 321 | reserve_bootmem_node(NODE_DATA(0), (bootmap_start_pfn << PAGE_SHIFT), |
| 325 | ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT)); | 322 | ((bootmap_pfn - bootmap_start_pfn) << PAGE_SHIFT)); |
| 326 | 323 | ||
| @@ -355,8 +352,8 @@ static void __init setup_bootmem(void) | |||
| 355 | #endif | 352 | #endif |
| 356 | 353 | ||
| 357 | data_resource.start = virt_to_phys(&data_start); | 354 | data_resource.start = virt_to_phys(&data_start); |
| 358 | data_resource.end = virt_to_phys(&_end)-1; | 355 | data_resource.end = virt_to_phys(_end) - 1; |
| 359 | code_resource.start = virt_to_phys(&_text); | 356 | code_resource.start = virt_to_phys(_text); |
| 360 | code_resource.end = virt_to_phys(&data_start)-1; | 357 | code_resource.end = virt_to_phys(&data_start)-1; |
| 361 | 358 | ||
| 362 | /* We don't know which region the kernel will be in, so try | 359 | /* We don't know which region the kernel will be in, so try |
| @@ -385,12 +382,12 @@ void free_initmem(void) | |||
| 385 | */ | 382 | */ |
| 386 | local_irq_disable(); | 383 | local_irq_disable(); |
| 387 | 384 | ||
| 388 | memset(&__init_begin, 0x00, | 385 | memset(__init_begin, 0x00, |
| 389 | (unsigned long)&__init_end - (unsigned long)&__init_begin); | 386 | (unsigned long)__init_end - (unsigned long)__init_begin); |
| 390 | 387 | ||
| 391 | flush_data_cache(); | 388 | flush_data_cache(); |
| 392 | asm volatile("sync" : : ); | 389 | asm volatile("sync" : : ); |
| 393 | flush_icache_range((unsigned long)&__init_begin, (unsigned long)&__init_end); | 390 | flush_icache_range((unsigned long)__init_begin, (unsigned long)__init_end); |
| 394 | asm volatile("sync" : : ); | 391 | asm volatile("sync" : : ); |
| 395 | 392 | ||
| 396 | local_irq_enable(); | 393 | local_irq_enable(); |
| @@ -398,8 +395,8 @@ void free_initmem(void) | |||
| 398 | 395 | ||
| 399 | /* align __init_begin and __init_end to page size, | 396 | /* align __init_begin and __init_end to page size, |
| 400 | ignoring linker script where we might have tried to save RAM */ | 397 | ignoring linker script where we might have tried to save RAM */ |
| 401 | init_begin = PAGE_ALIGN((unsigned long)(&__init_begin)); | 398 | init_begin = PAGE_ALIGN((unsigned long)(__init_begin)); |
| 402 | init_end = PAGE_ALIGN((unsigned long)(&__init_end)); | 399 | init_end = PAGE_ALIGN((unsigned long)(__init_end)); |
| 403 | for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { | 400 | for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { |
| 404 | ClearPageReserved(virt_to_page(addr)); | 401 | ClearPageReserved(virt_to_page(addr)); |
| 405 | init_page_count(virt_to_page(addr)); | 402 | init_page_count(virt_to_page(addr)); |
| @@ -578,7 +575,7 @@ static void __init map_pages(unsigned long start_vaddr, unsigned long start_padd | |||
| 578 | extern const unsigned long fault_vector_20; | 575 | extern const unsigned long fault_vector_20; |
| 579 | extern void * const linux_gateway_page; | 576 | extern void * const linux_gateway_page; |
| 580 | 577 | ||
| 581 | ro_start = __pa((unsigned long)&_text); | 578 | ro_start = __pa((unsigned long)_text); |
| 582 | ro_end = __pa((unsigned long)&data_start); | 579 | ro_end = __pa((unsigned long)&data_start); |
| 583 | fv_addr = __pa((unsigned long)&fault_vector_20) & PAGE_MASK; | 580 | fv_addr = __pa((unsigned long)&fault_vector_20) & PAGE_MASK; |
| 584 | gw_addr = __pa((unsigned long)&linux_gateway_page) & PAGE_MASK; | 581 | gw_addr = __pa((unsigned long)&linux_gateway_page) & PAGE_MASK; |
