From 2cfc5be7df26b6fbe9a293e2abf388a6e5b9a39e Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 28 Sep 2007 13:25:59 -0400 Subject: [PARISC] Wire up sys_fallocate (and compat_sys_fallocate) Signed-off-by: Kyle McMartin --- arch/parisc/kernel/sys_parisc32.c | 7 +++++++ arch/parisc/kernel/syscall_table.S | 1 + 2 files changed, 8 insertions(+) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index 2989c6682bf..50bbf33ee00 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c @@ -473,3 +473,10 @@ long sys32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char __user *buf, return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low, buf, len); } + +asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo, + u32 lenhi, u32 lenlo) +{ + return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo, + ((loff_t)lenhi << 32) | lenlo); +} diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 2540786a970..117438e9eb2 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S @@ -403,6 +403,7 @@ ENTRY_COMP(signalfd) ENTRY_COMP(timerfd) ENTRY_SAME(eventfd) + ENTRY_COMP(fallocate) /* 305 */ /* Nothing yet */ -- cgit v1.2.3 From 6f7d998e94ec7b7f08bd0c72fc05343435d7fa93 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Tue, 16 Oct 2007 14:24:58 -0700 Subject: [PARISC] Use page allocator instead of slab allocator in pci-dma.c Slab pages obtained via kmalloc are not cacheline aligned. Nor is it advisable to perform VM operations designed for page allocator pages on memory obtained via kmalloc. So replace the page sized allocations in kernel/pci-dma.c with page allocator pages. Signed-off-by: Christoph Lameter Cc: Hugh Dickins Cc: Grant Grundler Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Kyle McMartin --- arch/parisc/kernel/pci-dma.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c index 23c1388df1f..41f8e321e34 100644 --- a/arch/parisc/kernel/pci-dma.c +++ b/arch/parisc/kernel/pci-dma.c @@ -569,11 +569,10 @@ static void *fail_alloc_consistent(struct device *dev, size_t size, static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag) { - void *addr = NULL; + void *addr; - /* rely on kmalloc to be cacheline aligned */ - addr = kmalloc(size, flag); - if(addr) + addr = (void *)__get_free_pages(flag, get_order(size)); + if (addr) *dma_handle = (dma_addr_t)virt_to_phys(addr); return addr; @@ -582,7 +581,7 @@ static void *pa11_dma_alloc_noncoherent(struct device *dev, size_t size, static void pa11_dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, dma_addr_t iova) { - kfree(vaddr); + free_pages((unsigned long)vaddr, get_order(size)); return; } -- cgit v1.2.3 From efb80e7e097d0888e59fbbe4ded2ac5a256f556d Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:06:26 -0700 Subject: [PARISC] import necessary bits of libgcc.a Currently we're hacking libs-y to include libgcc.a, but this has unforeseen consequences since the userspace libgcc is linked with fpregs enabled. We need the kernel to stop using fpregs in an uncontrolled manner to implement lazy fpu state saves. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/parisc_ksyms.c | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c index 7aca704e96f..671ee5b9950 100644 --- a/arch/parisc/kernel/parisc_ksyms.c +++ b/arch/parisc/kernel/parisc_ksyms.c @@ -122,31 +122,9 @@ EXPORT_SYMBOL($$divI_12); EXPORT_SYMBOL($$divI_14); EXPORT_SYMBOL($$divI_15); -extern void __ashrdi3(void); -extern void __ashldi3(void); -extern void __lshrdi3(void); -extern void __muldi3(void); - -EXPORT_SYMBOL(__ashrdi3); -EXPORT_SYMBOL(__ashldi3); -EXPORT_SYMBOL(__lshrdi3); -EXPORT_SYMBOL(__muldi3); - asmlinkage void * __canonicalize_funcptr_for_compare(void *); EXPORT_SYMBOL(__canonicalize_funcptr_for_compare); -#ifdef CONFIG_64BIT -extern void __divdi3(void); -extern void __udivdi3(void); -extern void __umoddi3(void); -extern void __moddi3(void); - -EXPORT_SYMBOL(__divdi3); -EXPORT_SYMBOL(__udivdi3); -EXPORT_SYMBOL(__umoddi3); -EXPORT_SYMBOL(__moddi3); -#endif - #ifndef CONFIG_64BIT extern void $$dyncall(void); EXPORT_SYMBOL($$dyncall); -- cgit v1.2.3 From 730e844d57693f464c7f9954a0f7102414164c3f Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:03:45 -0700 Subject: [PARISC] Kill pointless variable use in time.c Clean up a pointless use of a variable in update_cr16_clocksource. It just looks silly. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/time.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 8b3062a5c81..24be86bba94 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@ -189,16 +189,14 @@ static struct clocksource clocksource_cr16 = { #ifdef CONFIG_SMP int update_cr16_clocksource(void) { - int change = 0; - /* since the cr16 cycle counters are not synchronized across CPUs, we'll check if we should switch to a safe clocksource: */ if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) { clocksource_change_rating(&clocksource_cr16, 0); - change = 1; + return 1; } - return change; + return 0; } #else int update_cr16_clocksource(void) -- cgit v1.2.3 From f8b9e5945738d25c04d6735c2a070f574d2b34c5 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:03:50 -0700 Subject: [PARISC] Unbreak processor_probe when we have more than NR_CPUS If we already have NR_CPUS worth of cpus online, we obviously shouldn't be trying to bring up more... Fixes a particularly vexing issue I had when running another machines kernel on my rp3440. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/processor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c index 549f5484342..370086fb833 100644 --- a/arch/parisc/kernel/processor.c +++ b/arch/parisc/kernel/processor.c @@ -82,7 +82,12 @@ static int __cpuinit processor_probe(struct parisc_device *dev) unsigned long cpuid; struct cpuinfo_parisc *p; -#ifndef CONFIG_SMP +#ifdef CONFIG_SMP + if (num_online_cpus() >= NR_CPUS) { + printk(KERN_INFO "num_online_cpus() >= NR_CPUS\n"); + return 1; + } +#else if (boot_cpu_data.cpu_count > 0) { printk(KERN_INFO "CONFIG_SMP=n ignoring additional CPUs\n"); return 1; -- cgit v1.2.3 From 7819994312fd4c3c04456abb6a64c810ecde3db4 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:03:56 -0700 Subject: [PARISC] Kill incorrect cast warning in unwinder Signed-off-by: Kyle McMartin --- arch/parisc/kernel/unwind.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index cf780cb3b91..701b2d2d888 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c @@ -209,8 +209,8 @@ static int unwind_init(void) static int unwind_special(struct unwind_frame_info *info, unsigned long pc, int frame_size) { - void handle_interruption(int, struct pt_regs *); - static unsigned long *hi = (unsigned long)&handle_interruption; + extern void handle_interruption(int, struct pt_regs *); + static unsigned long *hi = (unsigned long *)&handle_interruption; if (pc == get_func_addr(hi)) { struct pt_regs *regs = (struct pt_regs *)(info->sp - frame_size - PT_SZ_ALGN); -- cgit v1.2.3 From be1b3d8cb141c0705d61af2e2372d72ff16c7d04 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Thu, 18 Oct 2007 00:04:25 -0700 Subject: [PARISC] Beautify parisc vmlinux.lds.S Introduce a consistent layout of vmlinux. The same layout has been introduced for most architectures. And the same time move a few label definitions inside the curly brackets so they are assigned the correct starting address. Before a ld inserted alignment would have casued the label to pint before the actual start of the section. Signed-off-by: Sam Ravnborg Signed-off-by: Kyle McMartin --- arch/parisc/kernel/vmlinux.lds.S | 319 +++++++++++++++++++++++---------------- 1 file changed, 185 insertions(+), 134 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index ee7a16eb6fd..d6951bb5a9c 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -46,168 +46,219 @@ jiffies = jiffies_64; #endif SECTIONS { + . = KERNEL_BINARY_TEXT_START; - . = KERNEL_BINARY_TEXT_START; - - _text = .; /* Text and read-only data */ - .text ALIGN(16) : { - TEXT_TEXT - SCHED_TEXT - LOCK_TEXT - *(.text.do_softirq) - *(.text.sys_exit) - *(.text.do_sigaltstack) - *(.text.do_fork) - *(.text.*) - *(.fixup) - *(.lock.text) /* out-of-line lock text */ - *(.gnu.warning) + _text = .; /* Text and read-only data */ + .text ALIGN(16) : { + TEXT_TEXT + SCHED_TEXT + LOCK_TEXT + *(.text.do_softirq) + *(.text.sys_exit) + *(.text.do_sigaltstack) + *(.text.do_fork) + *(.text.*) + *(.fixup) + *(.lock.text) /* out-of-line lock text */ + *(.gnu.warning) } = 0 + /* End of text section */ + _etext = .; - _etext = .; /* End of text section */ + RODATA + BUG_TABLE - RODATA - - BUG_TABLE - - /* writeable */ - . = ALIGN(ASM_PAGE_SIZE); /* Make sure this is page aligned so - that we can properly leave these - as writable */ - data_start = .; - - . = ALIGN(16); /* Exception table */ - __start___ex_table = .; - __ex_table : { *(__ex_table) } - __stop___ex_table = .; + /* writeable */ + /* Make sure this is page aligned so + * that we can properly leave these + * as writable + */ + . = ALIGN(ASM_PAGE_SIZE); + data_start = .; + . = ALIGN(16); + /* Exception table */ + __ex_table : { + __start___ex_table = .; + *(__ex_table) + __stop___ex_table = .; + } - NOTES + NOTES - __start___unwind = .; /* unwind info */ - .PARISC.unwind : { *(.PARISC.unwind) } - __stop___unwind = .; + /* unwind info */ + .PARISC.unwind : { + __start___unwind = .; + *(.PARISC.unwind) + __stop___unwind = .; + } - /* rarely changed data like cpu maps */ - . = ALIGN(16); - .data.read_mostly : { *(.data.read_mostly) } + /* rarely changed data like cpu maps */ + . = ALIGN(16); + .data.read_mostly : { + *(.data.read_mostly) + } - . = ALIGN(L1_CACHE_BYTES); - .data : { /* Data */ - DATA_DATA - CONSTRUCTORS + . = ALIGN(L1_CACHE_BYTES); + /* Data */ + .data : { + DATA_DATA + CONSTRUCTORS } - . = ALIGN(L1_CACHE_BYTES); - .data.cacheline_aligned : { *(.data.cacheline_aligned) } + . = ALIGN(L1_CACHE_BYTES); + .data.cacheline_aligned : { + *(.data.cacheline_aligned) + } - /* PA-RISC locks requires 16-byte alignment */ - . = ALIGN(16); - .data.lock_aligned : { *(.data.lock_aligned) } + /* PA-RISC locks requires 16-byte alignment */ + . = ALIGN(16); + .data.lock_aligned : { + *(.data.lock_aligned) + } - . = ALIGN(ASM_PAGE_SIZE); - /* nosave data is really only used for software suspend...it's here - * just in case we ever implement it */ - __nosave_begin = .; - .data_nosave : { *(.data.nosave) } - . = ALIGN(ASM_PAGE_SIZE); - __nosave_end = .; + /* nosave data is really only used for software suspend...it's here + * just in case we ever implement it + */ + . = ALIGN(ASM_PAGE_SIZE); + __nosave_begin = .; + .data_nosave : { + *(.data.nosave) + } + . = ALIGN(ASM_PAGE_SIZE); + __nosave_end = .; - _edata = .; /* End of data section */ + /* End of data section */ + _edata = .; - __bss_start = .; /* BSS */ - /* page table entries need to be PAGE_SIZE aligned */ - . = ALIGN(ASM_PAGE_SIZE); - .data.vmpages : { - *(.data.vm0.pmd) - *(.data.vm0.pgd) - *(.data.vm0.pte) + /* BSS */ + __bss_start = .; + /* page table entries need to be PAGE_SIZE aligned */ + . = ALIGN(ASM_PAGE_SIZE); + .data.vmpages : { + *(.data.vm0.pmd) + *(.data.vm0.pgd) + *(.data.vm0.pte) + } + .bss : { + *(.bss) + *(COMMON) } - .bss : { *(.bss) *(COMMON) } - __bss_stop = .; + __bss_stop = .; - /* assembler code expects init_task to be 16k aligned */ - . = ALIGN(16384); /* init_task */ - .data.init_task : { *(.data.init_task) } + /* assembler code expects init_task to be 16k aligned */ + . = ALIGN(16384); + /* init_task */ + .data.init_task : { + *(.data.init_task) + } - /* The interrupt stack is currently partially coded, but not yet - * implemented */ - . = ALIGN(16384); - init_istack : { *(init_istack) } + /* The interrupt stack is currently partially coded, but not yet + * implemented + */ + . = ALIGN(16384); + init_istack : { + *(init_istack) + } #ifdef CONFIG_64BIT - . = ALIGN(16); /* Linkage tables */ - .opd : { *(.opd) } PROVIDE (__gp = .); - .plt : { *(.plt) } - .dlt : { *(.dlt) } + . = ALIGN(16); + /* Linkage tables */ + .opd : { + *(.opd) + } PROVIDE (__gp = .); + .plt : { + *(.plt) + } + .dlt : { + *(.dlt) + } #endif - /* reserve space for interrupt stack by aligning __init* to 16k */ - . = ALIGN(16384); - __init_begin = .; - .init.text : { - _sinittext = .; - *(.init.text) - _einittext = .; - } - .init.data : { *(.init.data) } - . = ALIGN(16); - __setup_start = .; - .init.setup : { *(.init.setup) } - __setup_end = .; - __initcall_start = .; - .initcall.init : { - INITCALLS - } - __initcall_end = .; - __con_initcall_start = .; - .con_initcall.init : { *(.con_initcall.init) } - __con_initcall_end = .; - SECURITY_INIT - /* alternate instruction replacement. This is a mechanism x86 uses - * to detect the CPU type and replace generic instruction sequences - * with CPU specific ones. We don't currently do this in PA, but - * it seems like a good idea... */ - . = ALIGN(4); - __alt_instructions = .; - .altinstructions : { *(.altinstructions) } - __alt_instructions_end = .; - .altinstr_replacement : { *(.altinstr_replacement) } - /* .exit.text is discard at runtime, not link time, to deal with references - from .altinstructions and .eh_frame */ - .exit.text : { *(.exit.text) } - .exit.data : { *(.exit.data) } + /* reserve space for interrupt stack by aligning __init* to 16k */ + . = ALIGN(16384); + __init_begin = .; + .init.text : { + _sinittext = .; + *(.init.text) + _einittext = .; + } + .init.data : { + *(.init.data) + } + . = ALIGN(16); + .init.setup : { + __setup_start = .; + *(.init.setup) + __setup_end = .; + } + .initcall.init : { + __initcall_start = .; + INITCALLS + __initcall_end = .; + } + .con_initcall.init : { + __con_initcall_start = .; + *(.con_initcall.init) + __con_initcall_end = .; + } + SECURITY_INIT + + /* alternate instruction replacement. This is a mechanism x86 uses + * to detect the CPU type and replace generic instruction sequences + * with CPU specific ones. We don't currently do this in PA, but + * it seems like a good idea... + */ + . = ALIGN(4); + .altinstructions : { + __alt_instructions = .; + *(.altinstructions) + __alt_instructions_end = .; + } + .altinstr_replacement : { + *(.altinstr_replacement) + } + + /* .exit.text is discard at runtime, not link time, to deal with references + * from .altinstructions and .eh_frame + */ + .exit.text : { + *(.exit.text) + } + .exit.data : { + *(.exit.data) + } #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(ASM_PAGE_SIZE); - __initramfs_start = .; - .init.ramfs : { *(.init.ramfs) } - __initramfs_end = .; + . = ALIGN(ASM_PAGE_SIZE); + .init.ramfs : { + __initramfs_start = .; + *(.init.ramfs) + __initramfs_end = .; + } #endif - PERCPU(ASM_PAGE_SIZE) + PERCPU(ASM_PAGE_SIZE) + . = ALIGN(ASM_PAGE_SIZE); + __init_end = .; + /* freed after init ends here */ + _end = . ; - . = ALIGN(ASM_PAGE_SIZE); - __init_end = .; - /* freed after init ends here */ - - _end = . ; - - /* Sections to be discarded */ - /DISCARD/ : { - *(.exitcall.exit) + /* Sections to be discarded */ + /DISCARD/ : { + *(.exitcall.exit) #ifdef CONFIG_64BIT - /* temporary hack until binutils is fixed to not emit these - for static binaries */ - *(.interp) - *(.dynsym) - *(.dynstr) - *(.dynamic) - *(.hash) - *(.gnu.hash) + /* temporary hack until binutils is fixed to not emit these + * for static binaries + */ + *(.interp) + *(.dynsym) + *(.dynstr) + *(.dynamic) + *(.hash) + *(.gnu.hash) #endif } - STABS_DEBUG - .note 0 : { *(.note) } - + STABS_DEBUG + .note 0 : { *(.note) } } -- cgit v1.2.3 From 1c593571093ae0f259d3bd7a66988a7a8eb5c7bc Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Thu, 18 Oct 2007 00:04:34 -0700 Subject: [PARISC] Kill off ASM_PAGE_SIZE use We have the macro _AC() generally available now so the calculation of PAGE_SIZE can be made assembler compatible. Introduce use of _AC() and kill all users of ASM_PAGE_SIZE. Signed-off-by: Sam Ravnborg Signed-off-by: Kyle McMartin --- arch/parisc/kernel/asm-offsets.c | 1 - arch/parisc/kernel/syscall.S | 11 ++++++----- arch/parisc/kernel/vmlinux.lds.S | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c index d3b7917a87c..8c2bcdbd494 100644 --- a/arch/parisc/kernel/asm-offsets.c +++ b/arch/parisc/kernel/asm-offsets.c @@ -290,7 +290,6 @@ int main(void) DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT); DEFINE(ASM_PT_INITIAL, PT_INITIAL); - DEFINE(ASM_PAGE_SIZE, PAGE_SIZE); DEFINE(ASM_PAGE_SIZE_DIV64, PAGE_SIZE/64); DEFINE(ASM_PAGE_SIZE_DIV128, PAGE_SIZE/128); BLANK(); diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 56f6231cb86..06cde9e700e 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,7 @@ * pointers. */ - .align ASM_PAGE_SIZE + .align PAGE_SIZE ENTRY(linux_gateway_page) /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ @@ -597,7 +598,7 @@ cas_action: /* Make sure nothing else is placed on this page */ - .align ASM_PAGE_SIZE + .align PAGE_SIZE END(linux_gateway_page) ENTRY(end_linux_gateway_page) @@ -608,7 +609,7 @@ ENTRY(end_linux_gateway_page) .section .rodata,"a" - .align ASM_PAGE_SIZE + .align PAGE_SIZE /* Light-weight-syscall table */ /* Start of lws table. */ ENTRY(lws_table) @@ -617,13 +618,13 @@ ENTRY(lws_table) END(lws_table) /* End of lws table */ - .align ASM_PAGE_SIZE + .align PAGE_SIZE ENTRY(sys_call_table) #include "syscall_table.S" END(sys_call_table) #ifdef CONFIG_64BIT - .align ASM_PAGE_SIZE + .align PAGE_SIZE ENTRY(sys_call_table64) #define SYSCALL_TABLE_64BIT #include "syscall_table.S" diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index d6951bb5a9c..d6dbcbcdcc2 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -73,7 +73,7 @@ SECTIONS * that we can properly leave these * as writable */ - . = ALIGN(ASM_PAGE_SIZE); + . = ALIGN(PAGE_SIZE); data_start = .; . = ALIGN(16); /* Exception table */ @@ -119,12 +119,12 @@ SECTIONS /* nosave data is really only used for software suspend...it's here * just in case we ever implement it */ - . = ALIGN(ASM_PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __nosave_begin = .; .data_nosave : { *(.data.nosave) } - . = ALIGN(ASM_PAGE_SIZE); + . = ALIGN(PAGE_SIZE); __nosave_end = .; /* End of data section */ @@ -133,7 +133,7 @@ SECTIONS /* BSS */ __bss_start = .; /* page table entries need to be PAGE_SIZE aligned */ - . = ALIGN(ASM_PAGE_SIZE); + . = ALIGN(PAGE_SIZE); .data.vmpages : { *(.data.vm0.pmd) *(.data.vm0.pgd) @@ -229,7 +229,7 @@ SECTIONS *(.exit.data) } #ifdef CONFIG_BLK_DEV_INITRD - . = ALIGN(ASM_PAGE_SIZE); + . = ALIGN(PAGE_SIZE); .init.ramfs : { __initramfs_start = .; *(.init.ramfs) @@ -237,8 +237,8 @@ SECTIONS } #endif - PERCPU(ASM_PAGE_SIZE) - . = ALIGN(ASM_PAGE_SIZE); + PERCPU(PAGE_SIZE) + . = ALIGN(PAGE_SIZE); __init_end = .; /* freed after init ends here */ _end = . ; -- cgit v1.2.3 From 80af0876991093e9a607968cddbd64f1fbe613e7 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:04:43 -0700 Subject: [PARISC] Kill off the last vestiges of ASM_PAGE_SIZE Sam's previous patch missed a few uses of ASM_PAGE_SIZE. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/head.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S index 9676c486bb6..369919d828f 100644 --- a/arch/parisc/kernel/head.S +++ b/arch/parisc/kernel/head.S @@ -95,7 +95,7 @@ $bss_loop: 1: stw %r3,0(%r4) - ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 + ldo (PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 addib,> -1,%r1,1b #if PT_NLEVELS == 3 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4 -- cgit v1.2.3 From 6ebeafff6452d89b294ba9b7402529b981b9624c Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:04:50 -0700 Subject: [PARISC] Clean up pointless ASM_PAGE_SIZE_DIV use Signed-off-by: Kyle McMartin --- arch/parisc/kernel/asm-offsets.c | 2 -- arch/parisc/kernel/pacache.S | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c index 8c2bcdbd494..eaa79bc14d9 100644 --- a/arch/parisc/kernel/asm-offsets.c +++ b/arch/parisc/kernel/asm-offsets.c @@ -290,8 +290,6 @@ int main(void) DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT); DEFINE(ASM_PT_INITIAL, PT_INITIAL); - DEFINE(ASM_PAGE_SIZE_DIV64, PAGE_SIZE/64); - DEFINE(ASM_PAGE_SIZE_DIV128, PAGE_SIZE/128); BLANK(); DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space)); diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S index 90b24087852..5901092e019 100644 --- a/arch/parisc/kernel/pacache.S +++ b/arch/parisc/kernel/pacache.S @@ -289,7 +289,7 @@ ENTRY(copy_user_page_asm) */ ldd 0(%r25), %r19 - ldi ASM_PAGE_SIZE_DIV128, %r1 + ldi (PAGE_SIZE / 128), %r1 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */ ldw 128(%r25), %r0 /* prefetch 2 */ @@ -355,7 +355,7 @@ ENTRY(copy_user_page_asm) * use ldd/std on a 32 bit kernel. */ ldw 0(%r25), %r19 - ldi ASM_PAGE_SIZE_DIV64, %r1 + ldi (PAGE_SIZE / 64), %r1 1: ldw 4(%r25), %r20 @@ -553,7 +553,7 @@ ENTRY(__clear_user_page_asm) pdtlb 0(%r28) #ifdef CONFIG_64BIT - ldi ASM_PAGE_SIZE_DIV128, %r1 + ldi (PAGE_SIZE / 128), %r1 /* PREFETCH (Write) has not (yet) been proven to help here */ /* #define PREFETCHW_OP ldd 256(%0), %r0 */ @@ -578,7 +578,7 @@ ENTRY(__clear_user_page_asm) ldo 128(%r28), %r28 #else /* ! CONFIG_64BIT */ - ldi ASM_PAGE_SIZE_DIV64, %r1 + ldi (PAGE_SIZE / 64), %r1 1: stw %r0, 0(%r28) -- cgit v1.2.3 From 873d50e2e56741406ff9d68c275f0c560e896a80 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:04:53 -0700 Subject: [PARISC] Remove hardcoded uses of PAGE_SIZE Signed-off-by: Kyle McMartin --- arch/parisc/kernel/entry.S | 4 ++-- arch/parisc/kernel/hpmc.S | 4 ++-- arch/parisc/kernel/init_task.c | 2 +- arch/parisc/kernel/syscall.S | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index 42598abf457..f324939bb9a 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -652,7 +652,7 @@ .text - .align 4096 + .align PAGE_SIZE ENTRY(fault_vector_20) /* First vector is invalid (0) */ @@ -904,7 +904,7 @@ ENDPROC(_switch_to) * */ - .align 4096 + .align PAGE_SIZE ENTRY(syscall_exit_rfi) mfctl %cr30,%r16 diff --git a/arch/parisc/kernel/hpmc.S b/arch/parisc/kernel/hpmc.S index 43b41df0b54..2cbf13b3ef1 100644 --- a/arch/parisc/kernel/hpmc.S +++ b/arch/parisc/kernel/hpmc.S @@ -55,13 +55,13 @@ * IODC requires 7K byte stack. That leaves 1K byte for os_hpmc. */ - .align 4096 + .align PAGE_SIZE hpmc_stack: .block 16384 #define HPMC_IODC_BUF_SIZE 0x8000 - .align 4096 + .align PAGE_SIZE hpmc_iodc_buf: .block HPMC_IODC_BUF_SIZE diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c index 446f98d3fd7..3b2f7d395bd 100644 --- a/arch/parisc/kernel/init_task.c +++ b/arch/parisc/kernel/init_task.c @@ -49,7 +49,7 @@ EXPORT_SYMBOL(init_mm); * way process stacks are handled. This is done by having a special * "init_task" linker map entry.. */ -unsigned char interrupt_stack[ISTACK_SIZE] __attribute__ ((section("init_istack"), aligned(4096))); +unsigned char interrupt_stack[ISTACK_SIZE] __attribute__ ((section("init_istack"), aligned(PAGE_SIZE))); union thread_union init_thread_union __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = { INIT_THREAD_INFO(init_task) }; diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 06cde9e700e..69b6eebc466 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S @@ -637,7 +637,7 @@ END(sys_call_table64) will use this set of locks */ .section .data - .align 4096 + .align PAGE_SIZE ENTRY(lws_lock_start) /* lws locks */ .align 16 -- cgit v1.2.3 From 6cc4525d29e22ab831387b6fac371e0118693a25 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Thu, 18 Oct 2007 00:04:56 -0700 Subject: [PARISC] Kill off broken irqstack code It's been unfinished and broken long enough, and I have some ideas on how to do it more cleanly. Signed-off-by: Kyle McMartin --- arch/parisc/kernel/entry.S | 37 +++---------------------------------- arch/parisc/kernel/head.S | 4 ---- arch/parisc/kernel/init_task.c | 1 - arch/parisc/kernel/smp.c | 12 ------------ arch/parisc/kernel/vmlinux.lds.S | 8 -------- 5 files changed, 3 insertions(+), 59 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index f324939bb9a..111d47284ea 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -98,7 +98,6 @@ * The "get_stack" macros are responsible for determining the * kernel stack value. * - * For Faults: * If sr7 == 0 * Already using a kernel stack, so call the * get_stack_use_r30 macro to push a pt_regs structure @@ -110,26 +109,6 @@ * task pointer pointed to by cr30. Set the stack * pointer to point to the end of the task structure. * - * For Interrupts: - * If sr7 == 0 - * Already using a kernel stack, check to see if r30 - * is already pointing to the per processor interrupt - * stack. If it is, call the get_stack_use_r30 macro - * to push a pt_regs structure on the stack, and store - * registers there. Otherwise, call get_stack_use_cr31 - * to get a pointer to the base of the interrupt stack - * and push a pt_regs structure on that stack. - * else - * Need to set up a kernel stack, so call the - * get_stack_use_cr30 macro to set up a pointer - * to the pt_regs structure contained within the - * task pointer pointed to by cr30. Set the stack - * pointer to point to the end of the task structure. - * N.B: We don't use the interrupt stack for the - * first interrupt from userland, because signals/ - * resched's are processed when returning to userland, - * and we can sleep in those cases. - * * Note that we use shadowed registers for temps until * we can save %r26 and %r29. %r26 is used to preserve * %r8 (a shadowed register) which temporarily contained @@ -1086,23 +1065,13 @@ intr_do_preempt: intr_extint: CMPIB=,n 0,%r16,1f + get_stack_use_cr30 - b,n 3f + b,n 2f 1: -#if 0 /* Interrupt Stack support not working yet! */ - mfctl %cr31,%r1 - copy %r30,%r17 - /* FIXME! depi below has hardcoded idea of interrupt stack size (32k)*/ - DEPI 0,31,15,%r17 - CMPB=,n %r1,%r17,2f - get_stack_use_cr31 - b,n 3f -#endif -2: get_stack_use_r30 - -3: +2: save_specials %r29 virt_map save_general %r29 diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S index 369919d828f..a7b8859488b 100644 --- a/arch/parisc/kernel/head.S +++ b/arch/parisc/kernel/head.S @@ -128,10 +128,6 @@ $pgt_fill_loop: /* And the stack pointer too */ ldo THREAD_SZ_ALGN(%r6),%sp - /* And the interrupt stack */ - load32 interrupt_stack,%r6 - mtctl %r6,%cr31 - #ifdef CONFIG_SMP /* Set the smp rendevous address into page zero. ** It would be safer to do this in init_smp_config() but diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c index 3b2f7d395bd..26198a074d6 100644 --- a/arch/parisc/kernel/init_task.c +++ b/arch/parisc/kernel/init_task.c @@ -49,7 +49,6 @@ EXPORT_SYMBOL(init_mm); * way process stacks are handled. This is done by having a special * "init_task" linker map entry.. */ -unsigned char interrupt_stack[ISTACK_SIZE] __attribute__ ((section("init_istack"), aligned(PAGE_SIZE))); union thread_union init_thread_union __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = { INIT_THREAD_INFO(init_task) }; diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index d7bc7bb42c9..85fc7754ec2 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -432,22 +432,10 @@ smp_cpu_init(int cpunum) void __init smp_callin(void) { int slave_id = cpu_now_booting; -#if 0 - void *istack; -#endif smp_cpu_init(slave_id); preempt_disable(); -#if 0 /* NOT WORKING YET - see entry.S */ - istack = (void *)__get_free_pages(GFP_KERNEL,ISTACK_ORDER); - if (istack == NULL) { - printk(KERN_CRIT "Failed to allocate interrupt stack for cpu %d\n",slave_id); - BUG(); - } - mtctl(istack,31); -#endif - flush_cache_all_local(); /* start with known state */ flush_tlb_all_local(NULL); diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S index d6dbcbcdcc2..40d0ff9b81a 100644 --- a/arch/parisc/kernel/vmlinux.lds.S +++ b/arch/parisc/kernel/vmlinux.lds.S @@ -153,14 +153,6 @@ SECTIONS *(.data.init_task) } - /* The interrupt stack is currently partially coded, but not yet - * implemented - */ - . = ALIGN(16384); - init_istack : { - *(init_istack) - } - #ifdef CONFIG_64BIT . = ALIGN(16); /* Linkage tables */ -- cgit v1.2.3 From 9611f61eb5baf22b6b6ed46c2c196c10e1fade6a Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Sun, 14 Oct 2007 10:13:31 -0400 Subject: [PARISC] Fix infinite loop in /proc/iomem pcibios_link_hba_resources() could corrupt the resource tree by inserting resources in the wrong place. Fix this by calling pci_claim_resource() for PCI-PCI bridges. Delete pcibios_link_hba_resources as we shouldn't need it any more. Also get rid of lba_claim_dev_resources() and just call pci_claim_resource() directly. Signed-off-by: Matthew Wilcox Signed-off-by: Kyle McMartin --- arch/parisc/kernel/pci.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index 563df0072de..8263d490b1b 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c @@ -194,31 +194,6 @@ void __init pcibios_init_bus(struct pci_bus *bus) pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bridge_ctl); } - -/* KLUGE: Link the child and parent resources - generic PCI didn't */ -static void -pcibios_link_hba_resources( struct resource *hba_res, struct resource *r) -{ - if (!r->parent) { - printk(KERN_EMERG "PCI: resource not parented! [%p-%p]\n", - (void*) r->start, (void*) r->end); - r->parent = hba_res; - - /* reverse link is harder *sigh* */ - if (r->parent->child) { - if (r->parent->sibling) { - struct resource *next = r->parent->sibling; - while (next->sibling) - next = next->sibling; - next->sibling = r; - } else { - r->parent->sibling = r; - } - } else - r->parent->child = r; - } -} - /* called by drivers/pci/setup-bus.c:pci_setup_bridge(). */ void __devinit pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res) @@ -245,13 +220,6 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev, DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", region->start, region->end); - - /* KLUGE ALERT - ** if this resource isn't linked to a "parent", then it seems - ** to be a child of the HBA - lets link it in. - */ - pcibios_link_hba_resources(&hba->io_space, bus->resource[0]); - pcibios_link_hba_resources(&hba->lmmio_space, bus->resource[1]); } void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, -- cgit v1.2.3 From 7425ada2d07b0bdc082f34069eadbbe5a8e465d2 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 19 Oct 2007 21:41:33 -0700 Subject: [PARISC] Zap unused variable warnings in pci.c 'bus' was basically useless and 'hba' is only applicable on 64bit. Sigh, there's got to be a cleaner way to do this... Signed-off-by: Kyle McMartin --- arch/parisc/kernel/pci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'arch/parisc/kernel') diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index 8263d490b1b..507d0ac99f6 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c @@ -198,8 +198,9 @@ void __init pcibios_init_bus(struct pci_bus *bus) void __devinit pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res) { - struct pci_bus *bus = dev->bus; - struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); +#ifdef CONFIG_64BIT + struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data); +#endif if (res->flags & IORESOURCE_IO) { /* @@ -218,7 +219,7 @@ void __devinit pcibios_resource_to_bus(struct pci_dev *dev, } DBG_RES("pcibios_resource_to_bus(%02x %s [%lx,%lx])\n", - bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", + dev->bus->number, res->flags & IORESOURCE_IO ? "IO" : "MEM", region->start, region->end); } @@ -226,8 +227,7 @@ void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, struct pci_bus_region *region) { #ifdef CONFIG_64BIT - struct pci_bus *bus = dev->bus; - struct pci_hba_data *hba = HBA_DATA(bus->bridge->platform_data); + struct pci_hba_data *hba = HBA_DATA(dev->bus->bridge->platform_data); #endif if (res->flags & IORESOURCE_MEM) { -- cgit v1.2.3