From 59e18a2e1c8f6642c307032939daaf474c16344e Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sun, 26 Mar 2006 01:39:31 -0800 Subject: [PATCH] bitops: parisc: use generic bitops - remove __{,test_and_}{set,clear,change}_bit() and test_bit() - remove ffz() - remove generic_fls64() - remove generic_hweight{32,16,8}() - remove generic_hweight64() - remove sched_find_first_bit() - remove find_{next,first}{,_zero}_bit() - remove ext2_{set,clear,test,find_first_zero,find_next_zero}_bit() Signed-off-by: Akinobu Mita Cc: Kyle McMartin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/parisc/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'arch/parisc/Kconfig') diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index eca33cfa8a4c..6b3c50964ca9 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -25,6 +25,14 @@ config RWSEM_GENERIC_SPINLOCK config RWSEM_XCHGADD_ALGORITHM bool +config GENERIC_FIND_NEXT_BIT + bool + default y + +config GENERIC_HWEIGHT + bool + default y + config GENERIC_CALIBRATE_DELAY bool default y -- cgit 1.4.1 From b8ce0aadcdebbaf5ec013c57e2a0803060817bcc Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Tue, 7 Mar 2006 14:12:13 -0700 Subject: [PARISC] Add CONFIG_HPPA_IOREMAP to conditionally enable ioremap Instead of making it a #define in asm/io.h, allow user to select to turn on IOREMAP from the config menu. Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/Kconfig | 11 +++++++++++ arch/parisc/mm/ioremap.c | 13 ++++++------- include/asm-parisc/io.h | 16 +++++----------- 3 files changed, 22 insertions(+), 18 deletions(-) (limited to 'arch/parisc/Kconfig') diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 6b3c50964ca9..fc5755d1db57 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -138,6 +138,17 @@ config 64BIT enable this option otherwise. The 64bit kernel is significantly bigger and slower than the 32bit one. +config HPPA_IOREMAP + bool "Enable IOREMAP functionality (EXPERIMENTAL)" + depends on EXPERIMENTAL + default n + help + Enable this option if you want to enable real IOREMAPPING on PA-RISC. + Currently we just "simulate" I/O remapping, and enabling this option + will just crash your machine. + + Say N here, unless you are a real PA-RISC Linux kernel hacker. + config SMP bool "Symmetric multi-processing support" ---help--- diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c index edd9a9559cba..028772144191 100644 --- a/arch/parisc/mm/ioremap.c +++ b/arch/parisc/mm/ioremap.c @@ -72,7 +72,7 @@ remap_area_pmd(pmd_t *pmd, unsigned long address, unsigned long size, return 0; } -#if USE_HPPA_IOREMAP +#ifdef CONFIG_HPPA_IOREMAP static int remap_area_pages(unsigned long address, unsigned long phys_addr, unsigned long size, unsigned long flags) @@ -114,7 +114,7 @@ remap_area_pages(unsigned long address, unsigned long phys_addr, return error; } -#endif /* USE_HPPA_IOREMAP */ +#endif /* CONFIG_HPPA_IOREMAP */ #ifdef CONFIG_DEBUG_IOREMAP static unsigned long last = 0; @@ -154,8 +154,7 @@ EXPORT_SYMBOL(__raw_bad_addr); */ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { -#if !(USE_HPPA_IOREMAP) - +#if !defined(CONFIG_HPPA_IOREMAP) unsigned long end = phys_addr + size - 1; /* Support EISA addresses */ if ((phys_addr >= 0x00080000 && end < 0x000fffff) @@ -222,10 +221,10 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l void iounmap(void __iomem *addr) { -#if !(USE_HPPA_IOREMAP) - return; -#else +#ifdef CONFIG_HPPA_IOREMAP if (addr > high_memory) return vfree((void *) (PAGE_MASK & (unsigned long __force) addr)); +#else + return; #endif } diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index be0c7234a6da..2fb253255102 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h @@ -26,11 +26,7 @@ extern unsigned long parisc_vmerge_max_size; */ #ifdef CONFIG_DEBUG_IOREMAP -#ifdef CONFIG_64BIT -#define NYBBLE_SHIFT 60 -#else -#define NYBBLE_SHIFT 28 -#endif +#define NYBBLE_SHIFT (BITS_PER_LONG - 4) extern void gsc_bad_addr(unsigned long addr); extern void __raw_bad_addr(const volatile void __iomem *addr); #define gsc_check_addr(addr) \ @@ -181,13 +177,11 @@ extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) extern void iounmap(void __iomem *addr); /* - * USE_HPPA_IOREMAP is the magic flag to enable or disable real ioremap() + * CONFIG_HPPA_IOREMAP is the magic flag to enable or disable real ioremap() * functionality. It's currently disabled because it may not work on some * machines. */ -#define USE_HPPA_IOREMAP 0 - -#if USE_HPPA_IOREMAP +#ifdef CONFIG_HPPA_IOREMAP static inline unsigned char __raw_readb(const volatile void __iomem *addr) { return (*(volatile unsigned char __force *) (addr)); @@ -221,7 +215,7 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add { *(volatile unsigned long long __force *) addr = b; } -#else /* !USE_HPPA_IOREMAP */ +#else /* !CONFIG_HPPA_IOREMAP */ static inline unsigned char __raw_readb(const volatile void __iomem *addr) { __raw_check_addr(addr); @@ -271,7 +265,7 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add gsc_writeq(b, (unsigned long) addr); } -#endif /* !USE_HPPA_IOREMAP */ +#endif /* !CONFIG_HPPA_IOREMAP */ /* readb can never be const, so use __fswab instead of le*_to_cpu */ #define readb(addr) __raw_readb(addr) -- cgit 1.4.1 From 29ef8295327653ff09a56285c35213cd31fa54b3 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Thu, 23 Mar 2006 00:32:46 -0700 Subject: [PARISC] Enable ioremap functionality unconditionally Enable CONFIG_HPPA_IOREMAP by default and remove all now unnecessary code. Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- arch/parisc/Kconfig | 11 --------- arch/parisc/mm/ioremap.c | 16 ++----------- include/asm-parisc/io.h | 58 +----------------------------------------------- 3 files changed, 3 insertions(+), 82 deletions(-) (limited to 'arch/parisc/Kconfig') diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index fc5755d1db57..6b3c50964ca9 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -138,17 +138,6 @@ config 64BIT enable this option otherwise. The 64bit kernel is significantly bigger and slower than the 32bit one. -config HPPA_IOREMAP - bool "Enable IOREMAP functionality (EXPERIMENTAL)" - depends on EXPERIMENTAL - default n - help - Enable this option if you want to enable real IOREMAPPING on PA-RISC. - Currently we just "simulate" I/O remapping, and enabling this option - will just crash your machine. - - Say N here, unless you are a real PA-RISC Linux kernel hacker. - config SMP bool "Symmetric multi-processing support" ---help--- diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c index 028772144191..5a22e1cab217 100644 --- a/arch/parisc/mm/ioremap.c +++ b/arch/parisc/mm/ioremap.c @@ -72,7 +72,6 @@ remap_area_pmd(pmd_t *pmd, unsigned long address, unsigned long size, return 0; } -#ifdef CONFIG_HPPA_IOREMAP static int remap_area_pages(unsigned long address, unsigned long phys_addr, unsigned long size, unsigned long flags) @@ -114,7 +113,6 @@ remap_area_pages(unsigned long address, unsigned long phys_addr, return error; } -#endif /* CONFIG_HPPA_IOREMAP */ #ifdef CONFIG_DEBUG_IOREMAP static unsigned long last = 0; @@ -154,21 +152,16 @@ EXPORT_SYMBOL(__raw_bad_addr); */ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) { -#if !defined(CONFIG_HPPA_IOREMAP) +#ifdef CONFIG_EISA + #error FIXME. unsigned long end = phys_addr + size - 1; /* Support EISA addresses */ if ((phys_addr >= 0x00080000 && end < 0x000fffff) || (phys_addr >= 0x00500000 && end < 0x03bfffff)) { phys_addr |= 0xfc000000; } - -#ifdef CONFIG_DEBUG_IOREMAP - return (void __iomem *)(phys_addr - (0x1UL << NYBBLE_SHIFT)); -#else - return (void __iomem *)phys_addr; #endif -#else void *addr; struct vm_struct *area; unsigned long offset, last_addr; @@ -216,15 +209,10 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l } return (void __iomem *) (offset + (char *)addr); -#endif } void iounmap(void __iomem *addr) { -#ifdef CONFIG_HPPA_IOREMAP if (addr > high_memory) return vfree((void *) (PAGE_MASK & (unsigned long __force) addr)); -#else - return; -#endif } diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index 2fb253255102..bcfe0b09c93f 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h @@ -176,12 +176,7 @@ extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) extern void iounmap(void __iomem *addr); -/* - * CONFIG_HPPA_IOREMAP is the magic flag to enable or disable real ioremap() - * functionality. It's currently disabled because it may not work on some - * machines. - */ -#ifdef CONFIG_HPPA_IOREMAP + static inline unsigned char __raw_readb(const volatile void __iomem *addr) { return (*(volatile unsigned char __force *) (addr)); @@ -215,57 +210,6 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add { *(volatile unsigned long long __force *) addr = b; } -#else /* !CONFIG_HPPA_IOREMAP */ -static inline unsigned char __raw_readb(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readb((unsigned long) addr); -} -static inline unsigned short __raw_readw(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readw((unsigned long) addr); -} -static inline unsigned int __raw_readl(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readl((unsigned long) addr); -} -static inline unsigned long long __raw_readq(const volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - return gsc_readq((unsigned long) addr); -} - -static inline void __raw_writeb(unsigned char b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writeb(b, (unsigned long) addr); -} -static inline void __raw_writew(unsigned short b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writew(b, (unsigned long) addr); -} -static inline void __raw_writel(unsigned int b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writel(b, (unsigned long) addr); -} -static inline void __raw_writeq(unsigned long long b, volatile void __iomem *addr) -{ - __raw_check_addr(addr); - - gsc_writeq(b, (unsigned long) addr); -} -#endif /* !CONFIG_HPPA_IOREMAP */ /* readb can never be const, so use __fswab instead of le*_to_cpu */ #define readb(addr) __raw_readb(addr) -- cgit 1.4.1 From 50a34dbd612925f2ec55b1781632835ef36b97d5 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Fri, 24 Mar 2006 21:24:21 -0700 Subject: [PARISC] Add PREEMPT support Signed-off-by: Kyle McMartin --- arch/parisc/Kconfig | 6 +----- arch/parisc/kernel/entry.S | 39 ++++++++++++++++++++++++++++++++++++--- include/asm-parisc/thread_info.h | 3 ++- 3 files changed, 39 insertions(+), 9 deletions(-) (limited to 'arch/parisc/Kconfig') diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 6b3c50964ca9..2fdf21989dc2 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig @@ -177,14 +177,10 @@ config ARCH_DISCONTIGMEM_DEFAULT def_bool y depends on ARCH_DISCONTIGMEM_ENABLE +source "kernel/Kconfig.preempt" source "kernel/Kconfig.hz" source "mm/Kconfig" -config PREEMPT - bool -# bool "Preemptible Kernel" - default n - config COMPAT def_bool y depends on 64BIT diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index 6d17c0a3431b..7c95d7663c29 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -1014,14 +1014,21 @@ intr_restore: nop nop +#ifndef CONFIG_PREEMPT +# define intr_do_preempt intr_restore +#endif /* !CONFIG_PREEMPT */ + .import schedule,code intr_do_resched: - /* Only do reschedule if we are returning to user space */ + /* Only call schedule on return to userspace. If we're returning + * to kernel space, we may schedule if CONFIG_PREEMPT, otherwise + * we jump back to intr_restore. + */ LDREG PT_IASQ0(%r16), %r20 - CMPIB= 0,%r20,intr_restore /* backward */ + CMPIB= 0, %r20, intr_do_preempt nop LDREG PT_IASQ1(%r16), %r20 - CMPIB= 0,%r20,intr_restore /* backward */ + CMPIB= 0, %r20, intr_do_preempt nop #ifdef CONFIG_64BIT @@ -1037,6 +1044,32 @@ intr_do_resched: #endif ldo R%intr_check_sig(%r2), %r2 + /* preempt the current task on returning to kernel + * mode from an interrupt, iff need_resched is set, + * and preempt_count is 0. otherwise, we continue on + * our merry way back to the current running task. + */ +#ifdef CONFIG_PREEMPT + .import preempt_schedule_irq,code +intr_do_preempt: + rsm PSW_SM_I, %r0 /* disable interrupts */ + + /* current_thread_info()->preempt_count */ + mfctl %cr30, %r1 + LDREG TI_PRE_COUNT(%r1), %r19 + CMPIB<> 0, %r19, intr_restore /* if preempt_count > 0 */ + nop /* prev insn branched backwards */ + + /* check if we interrupted a critical path */ + LDREG PT_PSW(%r16), %r20 + bb,<,n %r20, 31 - PSW_SM_I, intr_restore + nop + + BL preempt_schedule_irq, %r2 + nop + + b intr_restore /* ssm PSW_SM_I done by intr_restore */ +#endif /* CONFIG_PREEMPT */ .import do_signal,code intr_do_signal: diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h index ac32f140b83a..f2f83b04cd8b 100644 --- a/include/asm-parisc/thread_info.h +++ b/include/asm-parisc/thread_info.h @@ -49,7 +49,8 @@ struct thread_info { #endif /* !__ASSEMBLY */ -#define PREEMPT_ACTIVE 0x10000000 +#define PREEMPT_ACTIVE_BIT 28 +#define PREEMPT_ACTIVE (1 << PREEMPT_ACTIVE_BIT) /* * thread information flags -- cgit 1.4.1