diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-02 17:17:45 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-09 02:47:38 -0400 |
commit | 944916858a430a0627e483657d4cfa2cd2dfb4f7 (patch) | |
tree | 37fa713f9c336daab10b132bd3e00c57f6111b71 /arch/powerpc/kernel | |
parent | 91c60b5b8209627590b31c07262e40c27d27d272 (diff) |
powerpc: Shield code specific to 64-bit server processors
This is a random collection of added ifdef's around portions of
code that only mak sense on server processors. Using either
CONFIG_PPC_STD_MMU_64 or CONFIG_PPC_BOOK3S as seems appropriate.
This is meant to make the future merging of Book3E 64-bit support
easier.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 5 |
5 files changed, 13 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 7d46e5d5b207..8564a412e7a6 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -117,6 +117,7 @@ notrace void raw_local_irq_restore(unsigned long en) | |||
117 | if (!en) | 117 | if (!en) |
118 | return; | 118 | return; |
119 | 119 | ||
120 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
120 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { | 121 | if (firmware_has_feature(FW_FEATURE_ISERIES)) { |
121 | /* | 122 | /* |
122 | * Do we need to disable preemption here? Not really: in the | 123 | * Do we need to disable preemption here? Not really: in the |
@@ -134,6 +135,7 @@ notrace void raw_local_irq_restore(unsigned long en) | |||
134 | if (local_paca->lppaca_ptr->int_dword.any_int) | 135 | if (local_paca->lppaca_ptr->int_dword.any_int) |
135 | iseries_handle_interrupts(); | 136 | iseries_handle_interrupts(); |
136 | } | 137 | } |
138 | #endif /* CONFIG_PPC_STD_MMU_64 */ | ||
137 | 139 | ||
138 | /* | 140 | /* |
139 | * if (get_paca()->hard_enabled) return; | 141 | * if (get_paca()->hard_enabled) return; |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index dd6c7a3bf72c..461c91625a80 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -420,6 +420,9 @@ int pcibios_unmap_io_space(struct pci_bus *bus) | |||
420 | * so flushing the hash table is the only sane way to make sure | 420 | * so flushing the hash table is the only sane way to make sure |
421 | * that no hash entries are covering that removed bridge area | 421 | * that no hash entries are covering that removed bridge area |
422 | * while still allowing other busses overlapping those pages | 422 | * while still allowing other busses overlapping those pages |
423 | * | ||
424 | * Note: If we ever support P2P hotplug on Book3E, we'll have | ||
425 | * to do an appropriate TLB flush here too | ||
423 | */ | 426 | */ |
424 | if (bus->self) { | 427 | if (bus->self) { |
425 | struct resource *res = bus->resource[0]; | 428 | struct resource *res = bus->resource[0]; |
@@ -427,8 +430,10 @@ int pcibios_unmap_io_space(struct pci_bus *bus) | |||
427 | pr_debug("IO unmapping for PCI-PCI bridge %s\n", | 430 | pr_debug("IO unmapping for PCI-PCI bridge %s\n", |
428 | pci_name(bus->self)); | 431 | pci_name(bus->self)); |
429 | 432 | ||
433 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
430 | __flush_hash_table_range(&init_mm, res->start + _IO_BASE, | 434 | __flush_hash_table_range(&init_mm, res->start + _IO_BASE, |
431 | res->end + _IO_BASE + 1); | 435 | res->end + _IO_BASE + 1); |
436 | #endif | ||
432 | return 0; | 437 | return 0; |
433 | } | 438 | } |
434 | 439 | ||
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 7b44a33f03c2..3e7135bbe40f 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -650,7 +650,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
650 | p->thread.ksp_limit = (unsigned long)task_stack_page(p) + | 650 | p->thread.ksp_limit = (unsigned long)task_stack_page(p) + |
651 | _ALIGN_UP(sizeof(struct thread_info), 16); | 651 | _ALIGN_UP(sizeof(struct thread_info), 16); |
652 | 652 | ||
653 | #ifdef CONFIG_PPC64 | 653 | #ifdef CONFIG_PPC_STD_MMU_64 |
654 | if (cpu_has_feature(CPU_FTR_SLB)) { | 654 | if (cpu_has_feature(CPU_FTR_SLB)) { |
655 | unsigned long sp_vsid; | 655 | unsigned long sp_vsid; |
656 | unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp; | 656 | unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp; |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index ce01ff2474da..d4405b95bfaa 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -585,7 +585,7 @@ static void __init check_cpu_pa_features(unsigned long node) | |||
585 | ibm_pa_features, ARRAY_SIZE(ibm_pa_features)); | 585 | ibm_pa_features, ARRAY_SIZE(ibm_pa_features)); |
586 | } | 586 | } |
587 | 587 | ||
588 | #ifdef CONFIG_PPC64 | 588 | #ifdef CONFIG_PPC_STD_MMU_64 |
589 | static void __init check_cpu_slb_size(unsigned long node) | 589 | static void __init check_cpu_slb_size(unsigned long node) |
590 | { | 590 | { |
591 | u32 *slb_size_ptr; | 591 | u32 *slb_size_ptr; |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index c410c606955d..42221055f0c4 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -417,9 +417,11 @@ void __init setup_system(void) | |||
417 | if (ppc64_caches.iline_size != 0x80) | 417 | if (ppc64_caches.iline_size != 0x80) |
418 | printk("ppc64_caches.icache_line_size = 0x%x\n", | 418 | printk("ppc64_caches.icache_line_size = 0x%x\n", |
419 | ppc64_caches.iline_size); | 419 | ppc64_caches.iline_size); |
420 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
420 | if (htab_address) | 421 | if (htab_address) |
421 | printk("htab_address = 0x%p\n", htab_address); | 422 | printk("htab_address = 0x%p\n", htab_address); |
422 | printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); | 423 | printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); |
424 | #endif /* CONFIG_PPC_STD_MMU_64 */ | ||
423 | if (PHYSICAL_START > 0) | 425 | if (PHYSICAL_START > 0) |
424 | printk("physical_start = 0x%lx\n", | 426 | printk("physical_start = 0x%lx\n", |
425 | PHYSICAL_START); | 427 | PHYSICAL_START); |
@@ -511,8 +513,9 @@ void __init setup_arch(char **cmdline_p) | |||
511 | irqstack_early_init(); | 513 | irqstack_early_init(); |
512 | emergency_stack_init(); | 514 | emergency_stack_init(); |
513 | 515 | ||
516 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
514 | stabs_alloc(); | 517 | stabs_alloc(); |
515 | 518 | #endif | |
516 | /* set up the bootmem stuff with available memory */ | 519 | /* set up the bootmem stuff with available memory */ |
517 | do_init_bootmem(); | 520 | do_init_bootmem(); |
518 | sparse_init(); | 521 | sparse_init(); |